L iY #UdZddlmZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZmZmZmZddlmZddlmZmZmZmZmZdd lmZdd lmZmZerdd lm Z e d Z!de"d<ejFZ$e Z%de"d<da&de"d<dZ'de"d<dZ(de"d<dZ)de"d<dZ*de"d<ejVe,Z-de"d<Gdde.e Z/Gd d!e.e Z0e(fdId"Z1dJd#Z2dKd$Z3dLd%Z4dMd&Z5ddd'd(d'ddde.d'd'f dNd)Z6ddd(e.f dOd*Z7dPd+Z8e5d,d-e6d.d/d'e90e6d1d2d3e90e6d4d5e96ejtdQd7Z;e6d8d9d5d'e9:e6d;dd5d'e9:e6d?d@d5d'e9:e6dAdBd5dCe<:e6dDdEd5dFe=:e5dGdHe6dIe.JdRdKZ>e6dLe.JdRdMZ?e6dNd5e9d3OejtdQdPZ@e5dQdRe6dSdTe/jje.d3Ue6dVdWdXe.d3Ue6dYdZd3e9d3Ue5d[d\e6d]d^d3e90e6d_d`d3e9d5ae6dbdcd3e90e6ddded'e90e6dfdgdhe.0e5didje6dkdlgd3me6dndogd3me6dpdqdXe.0e6dre.d3sejtdRdtZCe6due9JdQdvZDe6dwdxd3e90e6dydzd'e90e6d{d|d5d3e9:e6d}dSd~ZEe6ddde=0e6dd5dd'e9e6ddde.0e6ddde.d5ae6ddd3e90e6ddgd3me6ddd3e90e6ddde=0e6ddde=0e6ddd5d'd3e9e6ddd'e90e6ddde=0e6ddd'e90e6ddde=0e6ddie.d5ae5dde6ddde.0e6ddd3e90e6de=JdTdZFdgZGe6ddeGde6ddeGde5dde6ddd'e9d5ae5dde6ddde.d3d3dde5dde6ddd5d'e9:e6ddd5d'e9:e5ddūeHe0D]ZIeIe0jk(r%e5deIjdeIjdȝ7eIe0jk(re5deIjdɫ]eIe0jk(re5deIjdʫeIe0jk(re5deIjd˫eIe0jk(se5deIjd̫e7ddgdάϫe7dde0je0je0je0je0jgdѬϫe7dde0je0je0je0je0jgdӬϫe7dde0je0je0je0je0jgdլϫe7dde0je0je0je0je0jgd׬ϫe7dde0je0je0je0je0jgd٬ϫe7dde0je0je0je0je0jgd۬ϫe7dde0je0je0je0je0jgdݬϫe7dde0je0je0je0je0jgd߬ϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgde9e7dde0je0je0je0je0jgdϫe7d de0je0je0je0je0jgd ϫe7d de0je0je0je0je0jgd ϫe7d dgdϫe7ddgde=e7ddgde=e7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgdϫe7dde0je0je0je0je0jgde=e7dde0je0je0je0je0jgd ϫe7d!de0je0je0je0je0jgd"ϫe7d#de0je0je0je0je0jgd$ϫe7d%de0je0je0je0je0jgd&ϫe7d'de0je0je0je0je0jgd(ϫe7d)de0je0je0je0je0jgd*e9e7d+dgd,e9e7d-dgd.ϫe7d/dgd0ϫe5d1d2e6d3d34dUd5ZOdVd6ZPdWd7ZQdWd8ZRdXd9ZSdId:ZT dYd;ZUdZd<ZVd[d=ZWd\d>ZXd]d?ZYed@AZZd^dBZ[ d_ d`dCZ\dXdDZ]dXdEZ^dXdFZ_ da dbdGZ`e`e]d3He`e^e`e_d3Hy(czLoads the configuration data.) annotationsN) OrderedDict)Enum) TYPE_CHECKINGAnyFinalLiteral)Signal) config_util developmentenv_util file_utilutil) ConfigOption)StreamlitAPIException!StreamlitInvalidThemeSectionError)Callablez.Special test section just used for unit tests.)_testzOrderedDict[str, str]_section_descriptionsdict[str, ConfigOption]_config_options_templatezdict[str, ConfigOption] | None_config_options str | None_main_script_pathzr _USER_DEFINEDz-command-line argument or environment variable_DEFINED_BY_FLAGzenvironment variable_DEFINED_BY_ENV_VAR_LOGGERcDeZdZdZdZdZdZdZed dZ ed dZ y) ShowErrorDetailsConfigOptionsz7Valid options for the "client.showErrorDetails" config.full stacktracetypenonec |dvS)N)trueTrueTvals V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/config.pyis_true_variationz/ShowErrorDetailsConfigOptions.is_true_variationVs,,,c |dvS)N)falseFalseFr(r)s r+is_false_variationz0ShowErrorDetailsConfigOptions.is_false_variationZs///r-N)r*z str | boolreturnbool) __name__ __module__ __qualname____doc__FULL STACKTRACETYPENONE staticmethodr,r1r(r-r+r r Ns?A DJ D D--00r-r c$eZdZdZdZdZdZdZdZy)CustomThemeCategoriesz:Theme categories that can be set with custom theme config.sidebarlightdarkz light.sidebarz dark.sidebarN) r4r5r6r7SIDEBARLIGHTDARK LIGHT_SIDEBAR DARK_SIDEBARr(r-r+r>r>dsDG E D#M!Lr-r>cht5tt|||dddy#1swYyxYw)aSet config option. Run `streamlit config show` in the terminal to see all available options. This is an internal API. The public `st.set_option` API is implemented in `set_user_option`. Parameters ---------- key : str The config option key of the form "section.optionName". To see all available options, run `streamlit config show` on a terminal. value The new value to assign to this config option. where_defined : str Tells the config system where this was set. N) _config_lockget_config_options _set_option)keyvalue where_defineds r+ set_optionrNns.( /C .///s(1c t|}|jr t ||yt|d|d#t$r}td||d}~wwxYw)aSet a configuration option. Currently, only ``client`` configuration options can be set within the script itself: - ``client.showErrorDetails`` - ``client.showSidebarNavigation`` - ``client.toolbarMode`` Calling ``st.set_option`` with any other option will raise a ``StreamlitAPIException``. When changing a configuration option in a running app, you may need to trigger a rerun after changing the option to see the effects. Run ``streamlit config show`` in a terminal to see all available options. Parameters ---------- key : str The config option key of the form "section.optionName". To see all available options, run ``streamlit config show`` in a terminal. value The new value to assign to this config option. Example ------- >>> import streamlit as st >>> >>> st.set_option("client.showErrorDetails", True) zUnrecognized config option: NzV cannot be set on the fly. Set as command line option, e.g. streamlit run script.py --z, or in config.toml instead.)rKeyErrorr scriptablerN)rKrLoptkes r+set_user_optionrTswDR&s+ ~~3  %%%(E)E G  R#&B3%$HIrQRs 5 AA  Act5t}||vrtd|d||jcdddS#1swYyxYw)aReturn the current value of a given Streamlit configuration option. Run ``streamlit config show`` in a terminal to see all available options. Parameters ---------- key : str The config option key of the form "section.optionName". To see all available options, run ``streamlit config show`` in a terminal. Example ------- >>> import streamlit as st >>> >>> color = st.get_option("theme.primaryColor") Config key "" not defined.N)rHrI RuntimeErrorrL)rKconfig_optionss r+ get_optionrZsN& )+- n $cU.AB Bc"(( )))s ,=Act5t}i}|jD]+}|j|k(s|j||j <-|cdddS#1swYyxYw)aGet all of the config options for the given section. Run `streamlit config show` in the terminal to see all available options. Parameters ---------- section : str The name of the config section to fetch options for. Returns ------- dict[str, Any] A dict mapping the names of the options in the given section (without the section name as a prefix) to their values. N)rHrIvaluessectionrLname)r]rYoptions_for_sectionoptions r+get_options_for_sectionrash #+- $++- @F~~(39<<#FKK0 @####s/AAA&cD|tvrtd|d|t|<y)z=Create a config section and store it globally in this module.zCannot define section "" twice.N)rrX)r] descriptions r+_create_sectionres+''4WIXFGG%0'"r-Fvisiblec t|||||||||| | |  } | jtvr=td| jddj tj d|t vrtd|d| t |<| S)aCreate a ConfigOption and store it globally in this module. There are two ways to create a ConfigOption: (1) Simple, constant config options are created as follows: _create_option('section.optionName', description = 'Put the description here.', default_val = 12345) (2) More complex, programmable config options use decorator syntax to resolve their values at runtime: @_create_option('section.optionName') def _section_option_name(): """Put the description here.""" return 12345 To achieve this sugar, _create_option() returns a *callable object* of type ConfigObject, which then decorates the function. NOTE: ConfigObjects call their evaluation functions *every time* the option is requested. To prevent this, use the `streamlit.util.memoize` decorator as follows: @_create_option('section.memoizedOptionName') @util.memoize def _section_memoized_option_name(): """Put the description here.""" (This function is only called once.) """ return 12345 ) rd default_valrQ visibility deprecateddeprecation_textexpiration_date replaced_bytype_ sensitivemultiplez Section "z" must be one of z, .zCannot define option "rc)rr]rrXjoinkeysr) rKrdrhrQrirjrkrlrmrnrorpr`s r+_create_optionrtsb )' F~~22''8CXC]C]C_9`8aab c   &&3C5ABB$*S! Mr-ct|D]3}|dk(r|nd|j}t|d|||||dddddd 5y)z Create ConfigOption(s) for a theme-related config option and store it globally in this module. The same config option can be supported for multiple categories, e.g. "theme" and "theme.sidebar". themetheme.rqFN) rdrhrirnrQrjrkrlrmro)rLrt)r^ categoriesrdrhrirncatr]s r+_create_theme_optionsrz>s_" #vcii[-Aiq ##!!   r-cbt td t|=t|=y#t$rYywxYw)zVRemove a ConfigOption by key from the global store. Only for use in testing. NJ_config_options should always be populated here. This should never happen.)rrXr Exception)rKs r+_delete_optionr~asA  X   $S ) C    s " ..globalz2Global options that apply across all of Streamlit.z+global.disableWidgetStateDuplicationWarninga By default, Streamlit displays a warning when a user sets both a widget default value in the function defining the widget and a widget value via the widget's key in `st.session_state`. If you'd like to turn off this warning, set this to True. )rdrhrnz#global.showWarningOnDirectExecutionzu If True, will show a warning when you run a Streamlit-enabled script via "python my_script.py". Tglobal.developmentModehidden)rirnchtj xrdtvxrdtvxrdtvS)zzAre we in development mode. This option defaults to True if and only if Streamlit wasn't installed normally. z site-packagesz dist-packages__pypackages__)r is_pex__file__r(r-r+_global_development_moders? OO  - 8 + - 8 + - H , r-zglobal.e2eTestzUAre we in an e2e (playwright) test? Set automatically when our e2e tests are running.)rdrirhrnzglobal.unitTestzAre we in a unit test?zglobal.appTestzNAre we in an app test? Set automatically when the AppTest framework is runningz"global.suppressDeprecationWarningsz/Hide deprecation warnings in the streamlit app.zglobal.minCachedMessageSizezT Only cache ForwardMsgs that are greater than or equal to this minimum. g@zglobal.maxCachedMessageAgez Expire cached ForwardMsgs whose age is greater than this value. A message's age is defined by how many times its script has finished running since the message has been accessed. loggerz-Settings to customize Streamlit log messages.z logger.level)rnctdryy)zwLevel of logging for Streamlit's internal logger: "error", "warning", "info", or "debug". Default: "info" rdebuginfo)rZr(r-r+_logger_log_levelrs*+ r-zlogger.messageFormatc*tdrddlm}|Sy)a;String format for logging messages. If logger.datetimeFormat is set, logger messages will default to `%(asctime)s.%(msecs)03d %(message)s`. See Python's documentation for available attributes: https://docs.python.org/3/library/logging.html#formatter-objects Default: "%(asctime)s %(message)s" rrDEFAULT_LOG_MESSAGEz%(asctime)s %(message)s)rZstreamlit.loggerrrs r+_logger_message_formatrs*+8"" $r-zlogger.enableRich)rirnrQc, ddl}y#t$rYywxYw)a Controls whether uncaught app exceptions are logged via the rich library. If True and if rich is installed, exception tracebacks will be logged with syntax highlighting and formatting. Rich tracebacks are easier to read and show more code than standard Python tracebacks. If set to False, the default Python traceback formatting will be used. Defaults to True if rich is installed, False otherwise. rNTF)richr})rs r+_logger_enable_richrs#&   s  clientz(Settings for scripts that use Streamlit.zclient.showErrorDetailsa Controls whether uncaught app exceptions and deprecation warnings are displayed in the browser. This can be one of the following: - "full" : In the browser, Streamlit displays app deprecation warnings and exceptions, including exception types, exception messages, and associated tracebacks. - "stacktrace" : In the browser, Streamlit displays exceptions, including exception types, generic exception messages, and associated tracebacks. Deprecation warnings and full exception messages will only print to the console. - "type" : In the browser, Streamlit displays exception types and generic exception messages. Deprecation warnings, full exception messages, and associated tracebacks only print to the console. - "none" : In the browser, Streamlit displays generic exception messages. Deprecation warnings, full exception messages, associated tracebacks, and exception types will only print to the console. - True : This is deprecated. Streamlit displays "full" error details. - False : This is deprecated. Streamlit displays "stacktrace" error details. )rdrhrnrQzclient.toolbarModea Change the visibility of items in the toolbar, options menu, and settings dialog (top right of the app). Allowed values: - "auto" : Show the developer options if the app is accessed through localhost or through Streamlit Community Cloud as a developer. Hide them otherwise. - "developer" : Show the developer options. - "viewer" : Hide the developer options. - "minimal" : Show only options set externally (e.g. through Streamlit Community Cloud) or through st.set_page_config. If there are no options left, hide the menu. autozclient.showSidebarNavigationz Controls whether to display the default sidebar page navigation in a multi-page app. This only applies when app's pages are defined by the `pages/` directory. runnerz/Settings for how Streamlit executes your scriptzrunner.magicEnabledz Allows you to type a variable or string by itself in a single line of Python code to write it to the app. zrunner.postScriptGCz Run the Python Garbage Collector after each script execution. This can help avoid excess memory use in Streamlit apps, but could introduce delay in rerunning the app script for high-memory-use applications. )rdrhrnrizrunner.fastRerunsa[ Handle script rerun requests immediately, rather than waiting for script execution to reach a yield point. This makes Streamlit much more responsive to user interaction, but it can lead to race conditions in apps that mutate session_state data outside of explicit session_state assignment statements. z&runner.enforceSerializableSessionStateaF Raise an exception after adding unserializable data to Session State. Some execution environments may require serializing all data in Session State, so it may be useful to detect incompatibility during development, or when the execution environment will stop supporting it in the future. zrunner.enumCoercionaK Adjust how certain 'options' widgets like radio, selectbox, and multiselect coerce Enum members. This is useful when the Enum class gets re-defined during a script re-run. For more information, check out the docs: https://docs.streamlit.io/develop/concepts/design/custom-classes#enums Allowed values: - "off": Disables Enum coercion. - "nameOnly": Enum classes can be coerced if their member names match. - "nameAndValue": Enum classes can be coerced if their member names AND member values match. nameOnlyserverz!Settings for the Streamlit serverzserver.folderWatchLista List of directories to watch for changes. By default, Streamlit watches files in the current working directory and its subdirectories. Use this option to specify additional directories to watch. Paths must be absolute. )rdrhrpzserver.folderWatchBlacklista} List of directories to ignore for changes. By default, Streamlit watches files in the current working directory and its subdirectories. Use this option to specify exceptions within watched directories. Paths can be absolute or relative to the current working directory. Example: ['/home/user1/env', 'relative/path/to/folder'] zserver.fileWatcherTypea Change the type of file watcher used by Streamlit, or turn it off completely. Allowed values: - "auto" : Streamlit will attempt to use the watchdog module, and falls back to polling if watchdog isn't available. - "watchdog" : Force Streamlit to use the watchdog module. - "poll" : Force Streamlit to always use polling. - "none" : Streamlit will not watch files. zserver.cookieSecret)rnroc*tjS)zSymmetric key used to produce signed cookies. If deploying on multiple replicas, this should be set to the same value across all replicas to ensure they all share the same secret. Default: randomly generated secret key. )secrets token_hexr(r-r+_server_cookie_secretrs    r-zserver.headlessctjxr.tjd xrtjd S)zIf false, will attempt to open a browser window on start. Default: false unless (1) we are on a Linux box where DISPLAY is unset, or (2) we are running in the Streamlit Atom plugin. DISPLAYWAYLAND_DISPLAY)r IS_LINUX_OR_BSDosgetenvr(r-r+_server_headlessrs;    - )$ $ - +, ,r-zserver.showEmailPromptz Whether to show a terminal prompt for the user's email address when they run Streamlit (locally) for the first time. If you set `server.headless=True`, Streamlit will not show this prompt. zserver.runOnSavezK Automatically rerun script when the file is modified on disk. zserver.allowRunOnSavezF Allows users to automatically rerun when app is updated. zserver.addresscy)a The address where the server will listen for client and browser connections. Use this if you want to bind the server to a specific address. If set, the server will only be accessible from this address, and not from any aliases (like localhost). Default: (unset) Nr(r(r-r+_server_addressrs r- server.portzL The port where the server will listen for browser connections. i5!zserver.scriptHealthCheckEnableda Flag for enabling the script health check endpoint. It's used for checking if a script loads successfully. On success, the endpoint will return a 200 HTTP status code. On failure, the endpoint will return a 503 HTTP status code. Note: This is an experimental Streamlit internal API. The API is subject to change anytime so this should be used at your own risk )rirdrhrnzserver.baseUrlPathzN The base path for the URL where Streamlit should be served from. z!server.customComponentBaseUrlPatha& The base path for the URL where Streamlit should serve custom components. If this config var is set and a call to ``declare_component`` does not specify a URL, the component's URL will be set to ``f"{server.customComponentBaseUrlPath}/{component_name}/"``. server.enableCORSz Enables support for Cross-Origin Resource Sharing (CORS) protection, for added security. If XSRF protection is enabled and CORS protection is disabled at the same time, Streamlit will enable them both instead. zserver.corsAllowedOriginsah Allowed list of origins. If CORS protection is enabled (`server.enableCORS=True`), use this option to set a list of allowed origins that the Streamlit server will accept traffic from. This config option does nothing if CORS protection is disabled. Example: ['http://example.com', 'https://streamlit.io'] server.enableXsrfProtectionz Enables support for Cross-Site Request Forgery (XSRF) protection, for added security. If XSRF protection is enabled and CORS protection is disabled at the same time, Streamlit will enable them both instead. zserver.maxUploadSizezP Max size, in megabytes, for files uploaded with the file_uploader. zserver.maxMessageSizezh Max size, in megabytes, of messages that can be sent via the WebSocket connection. zserver.enableArrowTruncationz Enable automatically truncating all data structures that get serialized into Arrow (e.g. DataFrames) to ensure that the size is under `server.maxMessageSize`. )rdrirhrQrnz!server.enableWebsocketCompressionz8 Enables support for websocket compression. zserver.websocketPingIntervala, The interval (in seconds) at which the server pings the client to keep the websocket connection alive. The default value should work for most deployments. However, if you're experiencing frequent disconnections in certain proxy setups (e.g., "Connection error" messages), you may want to try adjusting this value. Note: When you set this option, Streamlit automatically sets the ping timeout to match this interval. For Tornado >=6.5, a value less than 30 may cause connection issues. zserver.enableStaticServingzd Enable serving files from a `static` directory in the running app's directory. zserver.disconnectedSessionTTLa TTL in seconds for sessions whose websockets have been disconnected. The server may choose to clean up session state, uploaded files, etc for a given session with no active websocket connection at any point after this time has passed. If you are using load balancing or replication in your deployment, you must enable session stickiness in your proxy to guarantee reconnection to the existing session. For more information, see https://docs.streamlit.io/replication. xserver.trustedUserHeadersa HTTP headers to embed in st.user. Configures HTTP headers whose values, on websocket connect, will be saved in st.user. Each key is the header name to map, and each value is the key in st.user to save the value under. If the configured header occurs multiple times in the request, the first value will be used. Multiple headers may not point to the same user key, and an error will be thrown on initialization if this is done. If configured using an environment variable or CLI option, it should be a single JSON-formatted dict of string-to-string. Note: This is an experimental API subject to change. browserz(Configuration of non-UI browser options.zbrowser.serverAddressa7 Internet address where users should point their browsers in order to connect to the app. Can be IP address or DNS name and path. This is used to: - Set the correct URL for CORS and XSRF protection purposes. - Show the URL on the terminal - Open the browser localhostzbrowser.gatherUsageStatsz< Whether to send usage statistics to Streamlit. browser.serverPortc*ttdS)aPort where users should point their browsers in order to connect to the app. This is used to: - Set the correct URL for XSRF protection purposes. - Show the URL on the terminal (part of `streamlit run`). - Open the browser automatically (part of `streamlit run`). This option is for advanced use cases. To change the port of your app, use `server.Port` instead. Default: whatever value is set in server.port. r)intrZr(r-r+_browser_server_portr s z-( ))r-zDO NOT USE THIS OPTION IN A PRODUCTION ENVIRONMENT. It has not gone through security audits or performance tests. For a production environment, we recommend performing SSL termination through a load balancer or reverse proxy.zserver.sslCertFilez Server certificate file for connecting via HTTPS. Must be set at the same time as "server.sslKeyFile". z )rdzserver.sslKeyFilez Cryptographic key file for connecting via HTTPS. Must be set at the same time as "server.sslCertFile". uiz6Configuration of UI elements displayed in the browser.z ui.hideTopBarz Flag to hide most of the UI elements found at the top of a Streamlit app. NOTE: This does *not* hide the main menu in the top-right of an app. mapboxz2Mapbox configuration that is being used by DeckGL.z mapbox.tokenzw If you'd like to show maps using Mapbox rather than Carto, use this to pass the Mapbox API token. z Instead of this, you should use either the MAPBOX_API_KEY environment variable or PyDeck's `api_keys` argument. z 2026-05-01)rdrhrnrorjrkrlmagicz4Settings for how Streamlit pre-processes your scriptzmagic.displayRootDocStringa% Streamlit's "magic" parser typically skips strings that appear to be docstrings. When this flag is set to True, Streamlit will instead display the root-level docstring in the app, just like any other magic string. This is useful for things like notebooks. z"magic.displayLastExprIfNoSemicolonz Make Streamlit's "magic" parser always display the last expression in the root file if it has no semicolon at the end. This matches the behavior of Jupyter notebooks, for example. rvz9Settings to define a custom theme for your Streamlit app.rwzSettings to define a custom z theme in your Streamlit app.z\Settings to define custom light theme properties that extend the defined [theme] properties.z[Settings to define custom dark theme properties that extend the defined [theme] properties.zSettings to define custom light theme properties for the sidebar that extend the defined [theme.sidebar] properties.zSettings to define custom dark theme properties for the sidebar that extend the defined [theme.sidebar] properties.basea} The theme that your custom theme inherits from. This can be one of the following: - "light": Streamlit's default light theme. - "dark": Streamlit's default dark theme. - A local file path to a TOML theme file: A local custom theme, like "themes/custom.toml". - A URL to a TOML theme file: An externally hosted custom theme, like "https://example.com/theme.toml". A TOML theme file must contain a [theme] table with theme options. Any theme options defined in the app's config.toml file will override those defined in the TOML theme file. )rxrd primaryColorz# Primary accent color. backgroundColorz* Background color of the app. secondaryBackgroundColorzA Background color used for most interactive widgets. textColorz- Color used for almost all text. redColoraq Red color used in the basic color palette. By default, this is #ff4b4b for the light theme and #ff2b2b for the dark theme. If `redColor` is provided, and `redBackgroundColor` isn't, then `redBackgroundColor` will be derived from `redColor` using 10% opacity for the light theme and 20% opacity for the dark theme. orangeColora Orange color used in the basic color palette. By default, this is #ffa421 for the light theme and #ff8700 for the dark theme. If `orangeColor` is provided, and `orangeBackgroundColor` isn't, then `orangeBackgroundColor` will be derived from `orangeColor` using 10% opacity for the light theme and 20% opacity for the dark theme. yellowColora Yellow color used in the basic color palette. By default, this is #faca2b for the light theme and #ffe312 for the dark theme. If `yellowColor` is provided, and `yellowBackgroundColor` isn't, then `yellowBackgroundColor` will be derived from `yellowColor` using 10% opacity for the light theme and 20% opacity for the dark theme. blueColorax Blue color used in the basic color palette. By default, this is #1c83e1 for the light theme and #0068c9 for the dark theme. If a `blueColor` is provided, and `blueBackgroundColor` isn't, then `blueBackgroundColor` will be derived from `blueColor` using 10% opacity for the light theme and 20% opacity for the dark theme. greenColora{ Green color used in the basic color palette. By default, this is #21c354 for the light theme and #09ab3b for the dark theme. If `greenColor` is provided, and `greenBackgroundColor` isn't, then `greenBackgroundColor` will be derived from `greenColor` using 10% opacity for the light theme and 20% opacity for the dark theme. violetColoraj Violet color used in the basic color palette. By default, this is #803df5 for both the light and dark themes. If a `violetColor` is provided, and `violetBackgroundColor` isn't, then `violetBackgroundColor` will be derived from `violetColor` using 10% opacity for the light theme and 20% opacity for the dark theme. grayColorav Gray color used in the basic color palette. By default, this is #a3a8b8 for the light theme and #555867 for the dark theme. If `grayColor` is provided, and `grayBackgroundColor` isn't, then `grayBackgroundColor` will be derived from `grayColor` using 10% opacity for the light theme and 20% opacity for the dark theme. redBackgroundColoraO Red background color used in the basic color palette. If `redColor` is provided, this defaults to `redColor` using 10% opacity for the light theme and 20% opacity for the dark theme. Otherwise, this is #ff2b2b with 10% opacity for light theme and #ff6c6c with 20% opacity for dark theme. orangeBackgroundColoraa Orange background color used for the basic color palette. If `orangeColor` is provided, this defaults to `orangeColor` using 10% opacity for the light theme and 20% opacity for the dark theme. Otherwise, this is #ffa421 with 10% opacity for the light theme and #ff8700 with 20% opacity for the dark theme. yellowBackgroundColoraa Yellow background color used for the basic color palette. If `yellowColor` is provided, this defaults to `yellowColor` using 10% opacity for the light theme and 20% opacity for the dark theme. Otherwise, this is #ffff12 with 10% opacity for the light theme and #ffff12 with 20% opacity for the dark theme. blueBackgroundColora[ Blue background color used for the basic color palette. If `blueColor` is provided, this defaults to `blueColor` using 10% opacity for the light theme and 20% opacity for the dark theme. Otherwise, this is #1c83ff with 10% opacity for the light theme and #3d9df3 with 20% opacity for the dark theme. greenBackgroundColora^ Green background color used for the basic color palette. If `greenColor` is provided, this defaults to `greenColor` using 10% opacity for the light theme and 20% opacity for the dark theme. Otherwise, this is #21c354 with 10% opacity for the light theme and #3dd56d with 20% opacity for the dark theme. violetBackgroundColoraY Violet background color used for the basic color palette. If `violetColor` is provided, this defaults to `violetColor` using 10% opacity for the light theme and 20% opacity for the dark theme. Otherwise, this is #9a5dff with 10% opacity for light theme and #9a5dff with 20% opacity for dark theme. grayBackgroundColora[ Gray background color used for the basic color palette. If `grayColor` is provided, this defaults to `grayColor` using 10% opacity for the light theme and 20% opacity for the dark theme. Otherwise, this is #31333f with 10% opacity for the light theme and #808495 with 20% opacity for the dark theme. redTextColora4 Red text color used for the basic color palette. If `redColor` is provided, this defaults to `redColor`, darkened by 15% for the light theme and lightened by 15% for the dark theme. Otherwise, this is #bd4043 for the light theme and #ff6c6c for the dark theme. orangeTextColora= Orange text color used for the basic color palette. If `orangeColor` is provided, this defaults to `orangeColor`, darkened by 15% for the light theme and lightened by 15% for the dark theme. Otherwise, this is #e2660c for the light theme and #ffbd45 for the dark theme. yellowTextColora= Yellow text color used for the basic color palette. If `yellowColor` is provided, this defaults to `yellowColor`, darkened by 15% for the light theme and lightened by 15% for the dark theme. Otherwise, this is #926c05 for the light theme and #ffffc2 for the dark theme. blueTextColora7 Blue text color used for the basic color palette. If `blueColor` is provided, this defaults to `blueColor`, darkened by 15% for the light theme and lightened by 15% for the dark theme. Otherwise, this is #0054a3 for the light theme and #3d9df3 for the dark theme. greenTextColora: Green text color used for the basic color palette. If `greenColor` is provided, this defaults to `greenColor`, darkened by 15% for the light theme and lightened by 15% for the dark theme. Otherwise, this is #158237 for the light theme and #5ce488 for the dark theme. violetTextColora= Violet text color used for the basic color palette. If `violetColor` is provided, this defaults to `violetColor`, darkened by 15% for the light theme and lightened by 15% for the dark theme. Otherwise, this is #583f84 for the light theme and #b27eff for the dark theme. grayTextColoraY Gray text color used for the basic color palette. If `grayColor` is provided, this defaults to `grayColor`, darkened by 15% for the light theme and lightened by 15% for the dark theme. Otherwise, this is #31333f with 60% opacity for the light theme and #fafafa with 60% opacity for the dark theme. linkColorzh Color used for all links. This defaults to the resolved value of `blueTextColor`. linkUnderlinezI Whether or not links should be displayed with an underline. )rxrdrn codeTextColorzp Text color used for code blocks. This defaults to the resolved value of `greenTextColor`. codeBackgroundColorz4 Background color used for code blocks. fontaa The font family for all text, except code blocks. This can be one of the following: - "sans-serif" - "serif" - "monospace" - The `family` value for a custom font table under [[theme.fontFaces]] - A URL to a CSS file in the format of ":" (like "Nunito:https://fonts.googleapis.com/css2?family=Nunito&display=swap") - A comma-separated list of these (as a single string) to specify fallbacks For example, you can use the following: font = "cool-font, fallback-cool-font, sans-serif" fontFacesae An array of fonts to use in your app. Each font in the array is a table (dictionary) that can have the following attributes, closely resembling CSS font-face definitions: - family - url - weight (optional) - style (optional) - unicodeRange (optional) To host a font with your app, enable static file serving with `server.enableStaticServing=true`. You can define multiple [[theme.fontFaces]] tables, including multiple tables with the same family if your font is defined by multiple files. For example, a font hosted with your app may have a [[theme.fontFaces]] table as follows: [[theme.fontFaces]] family = "font_name" url = "app/static/font_file.woff" weight = "400" style = "normal" baseFontSizez The root font size (in pixels) for the app. This determines the overall scale of text and UI elements. This is a positive integer. If this isn't set, the font size will be 16px. baseFontWeighta The root font weight for the app. This determines the overall weight of text and UI elements. This is an integer multiple of 100. Values can be between 100 and 600, inclusive. If this isn't set, the font weight will be set to 400 (normal weight). headingFonta) The font family to use for headings. This can be one of the following: - "sans-serif" - "serif" - "monospace" - The `family` value for a custom font table under [[theme.fontFaces]] - A URL to a CSS file in the format of ":" (like "Nunito:https://fonts.googleapis.com/css2?family=Nunito&display=swap") - A comma-separated list of these (as a single string) to specify fallbacks If this isn't set, Streamlit uses `theme.font` for headings. headingFontSizesa One or more font sizes for h1-h6 headings. If no sizes are set, Streamlit will use the default sizes for h1-h6 headings. Heading font sizes set in [theme] are not inherited by [theme.sidebar]. The following sizes are used by default: [ "2.75rem", # h1 (1.5rem for sidebar) "2.25rem", # h2 (1.25rem for sidebar) "1.75rem", # h3 (1.125rem for sidebar) "1.5rem", # h4 (1rem for sidebar) "1.25rem", # h5 (0.875rem for sidebar) "1rem", # h6 (0.75rem for sidebar) ] If you specify an array with fewer than six sizes, the unspecified heading sizes will be the default values. For example, you can use the following array to set the font sizes for h1-h3 headings while keeping h4-h6 headings at their default sizes: headingFontSizes = ["3rem", "2.875rem", "2.75rem"] Setting a single value (not in an array) will set the font size for all h1-h6 headings to that value: headingFontSizes = "2.75rem" Font sizes can be specified in pixels or rem, but rem is recommended. headingFontWeightsa One or more font weights for h1-h6 headings. If no weights are set, Streamlit will use the default weights for h1-h6 headings. Heading font weights set in [theme] are not inherited by [theme.sidebar]. The following weights are used by default: [ 700, # h1 (bold) 600, # h2 (semi-bold) 600, # h3 (semi-bold) 600, # h4 (semi-bold) 600, # h5 (semi-bold) 600, # h6 (semi-bold) ] If you specify an array with fewer than six weights, the unspecified heading weights will be the default values. For example, you can use the following array to set the font weights for h1-h2 headings while keeping h3-h6 headings at their default weights: headingFontWeights = [800, 700] Setting a single value (not in an array) will set the font weight for all h1-h6 headings to that value: headingFontWeights = 500 codeFonta The font family to use for code (monospace) in the sidebar. This can be one of the following: - "sans-serif" - "serif" - "monospace" - The `family` value for a custom font table under [[theme.fontFaces]] - A URL to a CSS file in the format of ":" (like "'Space Mono':https://fonts.googleapis.com/css2?family=Space+Mono&display=swap") - A comma-separated list of these (as a single string) to specify fallbacks codeFontSizea" The font size (in pixels or rem) for code blocks and code text. This applies to font in code blocks, `st.json`, and `st.help`. It doesn't apply to inline code, which is set by default to 0.75em. If this isn't set, the code font size will be 0.875rem. codeFontWeightaA The font weight for code blocks and code text. This applies to font in inline code, code blocks, `st.json`, and `st.help`. This is an integer multiple of 100. Values can be between 100 and 600, inclusive. If this isn't set, the code font weight will be 400 (normal weight). baseRadiusa The radius used as basis for the corners of most UI elements. This can be one of the following: - "none" - "small" - "medium" - "large" - "full" - The number in pixels or rem. For example, you can use "10px", "0.5rem", or "2rem". To follow best practices, use rem instead of pixels when specifying a numeric size. buttonRadiusa The radius used as basis for the corners of buttons. This can be one of the following: - "none" - "small" - "medium" - "large" - "full" - The number in pixels or rem. For example, you can use "10px", "0.5rem", or "2rem". To follow best practices, use rem instead of pixels when specifying a numeric size. If this isn't set, Streamlit uses `theme.baseRadius` instead. borderColorz6 The color of the border around elements. dataframeBorderColorz The color of the border around dataframes and tables. If this isn't set, Streamlit uses `theme.borderColor` instead. dataframeHeaderBackgroundColora The background color of the dataframe's header. This color applies to all non-interior cells of the dataframe. This includes the header row, the row-selection column (if present), and the bottom row of data editors with a dynamic number of rows. If this isn't set, Streamlit uses a mix of `theme.backgroundColor` and `theme.secondaryBackgroundColor`. showWidgetBorderz< Whether to show a border around input widgets. showSidebarBorderzi Whether to show a vertical separator between the sidebar and the main content area. chartCategoricalColorsa An array of colors to use for categorical chart data. This is a list of one or more color strings which are applied in order to categorical data. These colors apply to Plotly, Altair, and Vega-Lite charts. Invalid colors are skipped, and colors repeat cyclically if there are more categories than colors. If no chart categorical colors are set, Streamlit uses a default set of colors. For light themes, the following colors are the default: [ "#0068c9", # blue80 "#83c9ff", # blue40 "#ff2b2b", # red80 "#ffabab", # red40 "#29b09d", # blueGreen80 "#7defa1", # green40 "#ff8700", # orange80 "#ffd16a", # orange50 "#6d3fc0", # purple80 "#d5dae5", # gray40 ] For dark themes, the following colors are the default: [ "#83c9ff", # blue40 "#0068c9", # blue80 "#ffabab", # red40 "#ff2b2b", # red80 "#7defa1", # green40 "#29b09d", # blueGreen80 "#ffd16a", # orange50 "#ff8700", # orange80 "#6d3fc0", # purple80 "#d5dae5", # gray40 ] chartSequentialColorsaw An array of ten colors to use for sequential or continuous chart data. The ten colors create a gradient color scale. These colors apply to Plotly, Altair, and Vega-Lite charts. Invalid color strings are skipped. If there are not exactly ten valid colors specified, Streamlit uses a default set of colors. For light themes, the following colors are the default: [ "#e4f5ff", #blue10 "#c7ebff", #blue20 "#a6dcff", #blue30 "#83c9ff", #blue40 "#60b4ff", #blue50 "#3d9df3", #blue60 "#1c83e1", #blue70 "#0068c9", #blue80 "#0054a3", #blue90 "#004280", #blue100 ] For dark themes, the following colors are the default: [ "#004280", #blue100 "#0054a3", #blue90 "#0068c9", #blue80 "#1c83e1", #blue70 "#3d9df3", #blue60 "#60b4ff", #blue50 "#83c9ff", #blue40 "#a6dcff", #blue30 "#c7ebff", #blue20 "#e4f5ff", #blue10 ] rzSecrets configuration.z secrets.files)rpctdS)aList of locations where secrets are searched. An entry can be a path to a TOML file or directory path where Kubernetes style secrets are saved. Order is important, import is first to last, so secrets in later files will take precedence over earlier ones. z secrets.toml)get_config_filesr(r-r+_secrets_filesrs N ++r-ct5t}||vrd|d}t|||jcdddS#1swYyxYw)zIndicate where (e.g. in which file) this option was defined. Parameters ---------- key : str The config option key of the form "section.optionName" rVrWN)rHrIrXrM)rKrYmsgs r+get_where_definedrsS 1+- n $ ^4Cs# #c"00 111s .?Ac:t|tjk(S)zCheck if a given option has not been set by the user. Parameters ---------- option_name : str The option to check Returns ------- bool True if the option has not been set by the user. )rrDEFAULT_DEFINITION option_names r+ _is_unsetrs [ )\-L-L LLr-cXt|tjtjfvS)zCheck if a given option was actually defined by the user. Parameters ---------- option_name : str The option to check Returns ------- bool True if the option has been set by the user. )rrrSTREAMLIT_DEFINITIONrs r+is_manually_setr s- [ )''))2 r-ct5t tdtjt tdddy#1swYyxYw)z)Print all config options to the terminal.Nr|)rHrrXr show_configrr(r-r+rr sG H  "\   5G HHHs 0AA ct td|tvr%ddlm}|t}|j d|yt|j ||y)aSet a config option by key / value pair. This function assumes that the _config_options dictionary has already been populated and thus should only be used within this file and by tests. Parameters ---------- key : str The key of the option, like "logger.level". value The value of the option. where_defined : str Tells the config system where this was set. Nz0_config_options should always be populated here.r get_loggerzj"%s" is not a valid config option. If you previously had this config option set, it may have been removed.)rrXrrr4warning set_value)rKrLrMrrs r+rJrJ) sV MNN /!/"8, 4   &&umrBrLrCrD) section_pathpartss r+_is_valid_theme_sectionr \ s   s #E 5zQQx ! ) ) / / ! ' ' - - ! & & , ,    5zQ 8 ! ' ' - - ! & & , ,  84<<BBB B r-c ddl}|j|}dfd |j D]\}}||y#t$rtj dYywxYw)a)Update the config system by parsing this string. This should only be called from get_config_options. Parameters ---------- raw_toml : str The TOML file to parse to update the config values. where_defined : str Tells the config system where this was set. rNzzError parsing config toml. This is most likely due to a syntax error in the config.toml file. Please fix it and try again.cr|jD]\}}|d|}|jdrp|tjjtj jtj jfvr!t|s t|||t|t|y)aRecursively process nested sections of the config file. Parameters ---------- section_path : str The dot-separated path to the current section (e.g., "server" or "theme") section_data : dict[str, Any] The dictionary containing configuration values for this section Notes ----- TOML's hierarchical structure gets parsed into nested dictionaries. For example: [main] option = "value" [main.subsection] another = "value2" Will be loaded by the TOML parser as: { "main": { "option": "value", "subsection": { "another": "value2" } } } This function traverses these nested dictionaries and converts them to dot-notation config options. rqrvrN) r startswithr>rBrLrCrDr rrJ_maybe_read_env_variable)r  section_datar^rLrprocess_sectionrMs r+rz1_update_config_with_toml..process_section sD(--/ YKD%)N!D62K&&w/D%--33%++11%**00=5 /{;;$/ U3K)A%)H-X! Yr-)r strrdict[str, Any]r2None)tomlloadsr}r exceptionr)raw_tomlrMrparsed_config_filer]optionsrs ` @r+_update_config_with_tomlr sw !ZZ12Yh/446*)*{   D  sAA#"A#ct|trq|jdr`|tdd}tj j |}|&ddlm}|t}|jd||St|S|S)aUIf value is "env:foo", return value of environment variable "foo". If value is not in the shape above, returns the value right back. Parameters ---------- value : any The value to check Returns ------- any Either returns value right back, or the value of the environment variable. zenv:Nrrz!No environment variable called %s) isinstancerrr rrrrrr4error_maybe_convert_to_number)rLvar_namerrrs r+rr sw"%%"2"26":V'**..* ? 3&x0F LLH77>>(+h1 ,T $  , %]H = > .o>!3!9!9!; = Hg '+; < = -- 5{  ;<<   4&x0F NNQ   [-- , ,--s*E9AE9 E-C E9-E6 2E99Fcddlm}|t}tdr,t ds t dt ds t dtdr)td r tdr|j d yyy) Nrrrrz>server.port does not work when global.developmentMode is true.rzEbrowser.serverPort does not work when global.developmentMode is true.rra Warning: the config option 'server.enableCORS=false' is not compatible with 'server.enableXsrfProtection=true'. As a result, 'server.enableCORS' is being overridden to 'true'. More information: In order to protect against CSRF attacks, we send a cookie with each request. To do so, we must specify allowable origins, which places a restriction on cross-origin resource sharing. If cross origin resource sharing is required, please disable server.enableXsrfProtection. )rrr4rZrrXr)rrs r+_check_conflictsrBw s,x(F*+'P -.W  /0 * +z:R/S  0T1r-c,tdt_y)Nr)rZr is_development_moder(r-r+_set_development_moderE s&01I&JK#r-ct}|d}t|jtr t j |j}t|t s td|jD]&\}}t|trtd|d|td||j|dj}t}g}|jD](} | |vr|j| |j!| *|rtd|y#tj$r}td|jd}~wwxYw) aConvert string-valued server.trustedUserHeaders to a dict. If server.trustedUserHeaders is configured from an environment variable or from the CLI, it will be a JSON string. Parse this and set the value to the resulting dict, after validation. rz0server.trustedUserHeaders JSON must be an objectzTserver.trustedUserHeaders JSON must only have string values. got bad value for key "z": )rMz.bad JSON value for server.trustedUserHeaders: Nz@server.trustedUserHeaders had multiple mappings for user key(s) )rIrrLrjsonrdictrXrrNrMJSONDecodeErrorrsetr\r+add) rtrusted_user_headers parsed_valuejson_key json_valuejdefinal_config_valuer\bad_keysuser_keys r+_parse_trusted_user_headersrT sj!"G"#>?&,,c2 ::&:&@&@ALlD1##UVV(4(:(:(< $*!*c2&22:3zlL  +2@@ !!<=CC UFH&--/ v  OOH % 8 Nxj Y  ## @ J  sA D *DE 0EE cdfd dfd }dfd |ststjd|S|S)aSWait for the config file to be parsed then call func. If the config file has already been parsed, just calls func immediately unless force_connect is set. Parameters ---------- func : Callable[[], None] A function to run on config parse. force_connect : bool Wait until the next config file parse to run func, even if config files have already been parsed. lock : bool If set, grab _config_lock before running func. Returns ------- Callable[[], None] A function that the caller can use to deregister func. cyNr()_func_with_locks r+receiverz"on_config_parsed..receiver s r-c0tjyrW)r9 disconnect)rZsr+r\z$on_config_parsed..disconnect s$$X.r-c^rt5dddyy#1swYyxYwrW)rH)funclocksr+rYz(on_config_parsed..func_with_lock s/     F  s#,F)weak)rXrr2rr2r)rr9connect)r^ force_connectr_r\rYrZs` ` @@r+on_config_parsedrd sD>/O !!(!7   r-)r_)rKrrLrrMrr2r)rKrrLrr2r)rKrr2r)r]rr2r)r]rrdrr2r)rKrrdrrh Any | NonerQr3rirrjr3rkrrlrrmrrnr#ror3rpr3r2r)r^rrxz.list[Literal['theme'] | CustomThemeCategories]rdrrhrerirrnr#r2r)rKrr2r)r2r3)r2r)r2r)r2r)r2 list[str])rKrr2r)rrr2r3ra)rYrr2r)r rr2r3)rrrMrr2r)rLrr2r)r%rr2r)r,rr2rf)FN)r;r3r<zdict[str, Any] | Noner2r)FF)r^Callable[[], None]rcr3r_r3r2rg)ar7 __future__rr1rGloggingrr threading collectionsrenumrtypingrrrr blinkerr streamlitr r r rrstreamlit.config_optionrstreamlit.errorsrrcollections.abcrr__annotations__RLockrHrrrrrr getLoggerr4rrr r>rNrTrZrarertrzr~r3memoizerr$rrrrr8rLrrrr_SSL_PRODUCTION_WARNINGlistryrBrCrDrErFrrrrrrJrr rrr!r9rrIrBrErTrdr(r-r+rys$"  #55II0U(0; :0, y 5@M1A37/6!%:$( u'J%I4U3"""8,,0C0,"C";H/4.b)6#41#"#'"&"F FFF F  F  F!F FF FFFFX#"    >             F (NO1  ) (XTJ K g  (  `  (A  !     IJc*+&c2 %3 %     4DE2.2288 ;@  %*"   KL     ,    #,=>  !     $%SDAB!. /        ! "  %   '       "!      "   '  "  $  #    +4 EF     $C0*1*$U   !!"     !!"   NO   NO !(OP    (   TU % & C #+++SYYK *399+5R S  %++ +SYYK j  %** *SYYK i %33 3SYYK  + %22 2SYYK  + 3 > y(%%##""++**  %%##""++**  %%##""++**  %%##""++**  %%##""++**  ,%%##""++**  ,%%##""++**  ,%%##""++**  ,%%##""++**  ,%%##""++** *%%##""++**  ,%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** *%%##""++** "%%##""++**   %%##""++** "%%##""++**   %%##""++** :y>y  y  %%##""++** 6%%##""++** %N%%##""++** #J%%##""++**  2%%##""++** (%%##""++**  ',%%##""++**  4%%##""++** 8%%##""++**  %%##""++** "$%%##""++** *%%##""++**   y y%)Vy#'V 34$/,0,1$M$*H =F B+ B  B "JO*dD  "HI4NRRR5JRRj) XK/ fIN3 3-13AE33r!-&',48r-