streamlit 1.45.1__py3-none-any.whl → 1.46.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/__init__.py +5 -1
- streamlit/auth_util.py +12 -12
- streamlit/cli_util.py +4 -3
- streamlit/column_config.py +11 -9
- streamlit/commands/echo.py +6 -4
- streamlit/commands/execution_control.py +33 -32
- streamlit/commands/experimental_query_params.py +2 -2
- streamlit/commands/logo.py +9 -4
- streamlit/commands/navigation.py +61 -18
- streamlit/commands/page_config.py +57 -47
- streamlit/components/types/base_custom_component.py +7 -7
- streamlit/components/v1/component_registry.py +7 -3
- streamlit/components/v1/components.py +1 -1
- streamlit/components/v1/custom_component.py +8 -8
- streamlit/config.py +289 -144
- streamlit/config_option.py +19 -15
- streamlit/config_util.py +29 -23
- streamlit/connections/__init__.py +2 -2
- streamlit/connections/base_connection.py +5 -5
- streamlit/connections/snowflake_connection.py +13 -11
- streamlit/connections/snowpark_connection.py +3 -3
- streamlit/connections/sql_connection.py +20 -18
- streamlit/connections/util.py +2 -2
- streamlit/cursor.py +6 -6
- streamlit/dataframe_util.py +52 -52
- streamlit/delta_generator.py +46 -48
- streamlit/delta_generator_singletons.py +3 -3
- streamlit/deprecation_util.py +6 -6
- streamlit/elements/alert.py +37 -29
- streamlit/elements/arrow.py +40 -22
- streamlit/elements/code.py +46 -13
- streamlit/elements/deck_gl_json_chart.py +38 -27
- streamlit/elements/dialog_decorator.py +3 -4
- streamlit/elements/doc_string.py +64 -58
- streamlit/elements/exception.py +23 -27
- streamlit/elements/form.py +41 -0
- streamlit/elements/graphviz_chart.py +1 -1
- streamlit/elements/heading.py +60 -9
- streamlit/elements/html.py +3 -4
- streamlit/elements/image.py +8 -9
- streamlit/elements/json.py +21 -2
- streamlit/elements/layouts.py +120 -31
- streamlit/elements/lib/built_in_chart_utils.py +96 -73
- streamlit/elements/lib/color_util.py +3 -3
- streamlit/elements/lib/column_config_utils.py +2 -4
- streamlit/elements/lib/column_types.py +14 -8
- streamlit/elements/lib/dialog.py +9 -5
- streamlit/elements/lib/image_utils.py +39 -40
- streamlit/elements/lib/js_number.py +4 -4
- streamlit/elements/lib/layout_utils.py +65 -1
- streamlit/elements/lib/mutable_status_container.py +14 -3
- streamlit/elements/lib/options_selector_utils.py +22 -12
- streamlit/elements/lib/pandas_styler_utils.py +25 -21
- streamlit/elements/lib/policies.py +6 -5
- streamlit/elements/lib/streamlit_plotly_theme.py +54 -53
- streamlit/elements/lib/subtitle_utils.py +6 -9
- streamlit/elements/lib/utils.py +20 -5
- streamlit/elements/map.py +32 -56
- streamlit/elements/markdown.py +101 -12
- streamlit/elements/media.py +78 -21
- streamlit/elements/metric.py +32 -16
- streamlit/elements/plotly_chart.py +15 -15
- streamlit/elements/progress.py +33 -15
- streamlit/elements/spinner.py +31 -6
- streamlit/elements/text.py +21 -1
- streamlit/elements/toast.py +1 -2
- streamlit/elements/vega_charts.py +54 -23
- streamlit/elements/widgets/audio_input.py +24 -7
- streamlit/elements/widgets/button.py +26 -19
- streamlit/elements/widgets/button_group.py +10 -15
- streamlit/elements/widgets/camera_input.py +27 -7
- streamlit/elements/widgets/chat.py +91 -38
- streamlit/elements/widgets/checkbox.py +45 -4
- streamlit/elements/widgets/color_picker.py +40 -17
- streamlit/elements/widgets/data_editor.py +76 -37
- streamlit/elements/widgets/file_uploader.py +42 -13
- streamlit/elements/widgets/multiselect.py +7 -10
- streamlit/elements/widgets/number_input.py +123 -47
- streamlit/elements/widgets/radio.py +59 -13
- streamlit/elements/widgets/select_slider.py +35 -30
- streamlit/elements/widgets/selectbox.py +56 -9
- streamlit/elements/widgets/slider.py +190 -99
- streamlit/elements/widgets/text_widgets.py +54 -8
- streamlit/elements/widgets/time_widgets.py +53 -14
- streamlit/elements/write.py +5 -8
- streamlit/env_util.py +2 -7
- streamlit/error_util.py +16 -9
- streamlit/errors.py +69 -48
- streamlit/external/langchain/streamlit_callback_handler.py +10 -5
- streamlit/file_util.py +27 -10
- streamlit/git_util.py +29 -24
- streamlit/hello/animation_demo.py +9 -9
- streamlit/hello/dataframe_demo.py +5 -5
- streamlit/hello/hello.py +1 -0
- streamlit/hello/mapping_demo.py +7 -8
- streamlit/hello/plotting_demo.py +3 -3
- streamlit/hello/streamlit_app.py +28 -26
- streamlit/hello/utils.py +2 -1
- streamlit/logger.py +10 -11
- streamlit/navigation/page.py +11 -8
- streamlit/proto/Audio_pb2.py +4 -3
- streamlit/proto/Audio_pb2.pyi +8 -1
- streamlit/proto/Block_pb2.py +38 -29
- streamlit/proto/Block_pb2.pyi +72 -4
- streamlit/proto/ClientState_pb2.py +4 -4
- streamlit/proto/ClientState_pb2.pyi +7 -2
- streamlit/proto/Code_pb2.py +4 -2
- streamlit/proto/Code_pb2.pyi +1 -0
- streamlit/proto/DataFrame_pb2.pyi +1 -1
- streamlit/proto/DeckGlJsonChart_pb2.pyi +1 -1
- streamlit/proto/Element_pb2.py +5 -3
- streamlit/proto/Element_pb2.pyi +20 -3
- streamlit/proto/GapSize_pb2.py +29 -0
- streamlit/proto/GapSize_pb2.pyi +70 -0
- streamlit/proto/HeightConfig_pb2.py +27 -0
- streamlit/proto/HeightConfig_pb2.pyi +48 -0
- streamlit/proto/NamedDataSet_pb2.pyi +1 -1
- streamlit/proto/Navigation_pb2.py +3 -3
- streamlit/proto/Navigation_pb2.pyi +4 -0
- streamlit/proto/NewSession_pb2.py +18 -16
- streamlit/proto/NewSession_pb2.pyi +29 -3
- streamlit/proto/PageConfig_pb2.py +7 -7
- streamlit/proto/PageConfig_pb2.pyi +21 -1
- streamlit/proto/Video_pb2.py +8 -7
- streamlit/proto/Video_pb2.pyi +8 -1
- streamlit/proto/WidthConfig_pb2.py +2 -2
- streamlit/proto/WidthConfig_pb2.pyi +15 -1
- streamlit/runtime/__init__.py +1 -1
- streamlit/runtime/app_session.py +53 -40
- streamlit/runtime/caching/__init__.py +9 -9
- streamlit/runtime/caching/cache_data_api.py +36 -30
- streamlit/runtime/caching/cache_errors.py +4 -4
- streamlit/runtime/caching/cache_resource_api.py +8 -8
- streamlit/runtime/caching/cache_utils.py +15 -14
- streamlit/runtime/caching/cached_message_replay.py +14 -8
- streamlit/runtime/caching/hashing.py +91 -97
- streamlit/runtime/caching/legacy_cache_api.py +2 -2
- streamlit/runtime/caching/storage/cache_storage_protocol.py +1 -1
- streamlit/runtime/caching/storage/dummy_cache_storage.py +1 -1
- streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py +12 -14
- streamlit/runtime/caching/storage/local_disk_cache_storage.py +6 -6
- streamlit/runtime/connection_factory.py +36 -36
- streamlit/runtime/context.py +58 -9
- streamlit/runtime/credentials.py +29 -40
- streamlit/runtime/forward_msg_queue.py +11 -11
- streamlit/runtime/fragment.py +7 -7
- streamlit/runtime/media_file_manager.py +3 -4
- streamlit/runtime/memory_media_file_storage.py +6 -5
- streamlit/runtime/memory_uploaded_file_manager.py +2 -2
- streamlit/runtime/metrics_util.py +11 -12
- streamlit/runtime/pages_manager.py +4 -6
- streamlit/runtime/runtime.py +8 -6
- streamlit/runtime/runtime_util.py +7 -6
- streamlit/runtime/scriptrunner/__init__.py +4 -4
- streamlit/runtime/scriptrunner/exec_code.py +12 -5
- streamlit/runtime/scriptrunner/magic.py +16 -12
- streamlit/runtime/scriptrunner/script_cache.py +1 -1
- streamlit/runtime/scriptrunner/script_runner.py +53 -29
- streamlit/runtime/scriptrunner_utils/exceptions.py +1 -1
- streamlit/runtime/scriptrunner_utils/script_requests.py +7 -4
- streamlit/runtime/scriptrunner_utils/script_run_context.py +10 -23
- streamlit/runtime/secrets.py +40 -35
- streamlit/runtime/session_manager.py +2 -1
- streamlit/runtime/state/__init__.py +5 -5
- streamlit/runtime/state/common.py +2 -2
- streamlit/runtime/state/query_params.py +13 -15
- streamlit/runtime/state/query_params_proxy.py +17 -13
- streamlit/runtime/state/safe_session_state.py +2 -2
- streamlit/runtime/state/session_state.py +52 -34
- streamlit/runtime/stats.py +2 -2
- streamlit/runtime/uploaded_file_manager.py +1 -1
- streamlit/runtime/websocket_session_manager.py +10 -6
- streamlit/source_util.py +8 -6
- streamlit/static/index.html +3 -17
- streamlit/static/manifest.json +1180 -0
- streamlit/static/static/css/{index.DqDwtg6_.css → index.CJVRHjQZ.css} +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.DU9IrB3M.js → ErrorOutline.esm.6PVAQvlT.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.P9rKwKo8.js → FileDownload.esm.BZQHC61b.js} +1 -1
- streamlit/static/static/js/{FileHelper.D7RMkx0e.js → FileHelper.Bn1VShMJ.js} +5 -5
- streamlit/static/static/js/{FormClearHelper.B67tgll0.js → FormClearHelper.CsFEiTNN.js} +1 -1
- streamlit/static/static/js/{Hooks.ncTJktu9.js → Hooks.DguOHQL1.js} +1 -1
- streamlit/static/static/js/{InputInstructions.D-Y8geDN.js → InputInstructions.CTYn2BJQ.js} +1 -1
- streamlit/static/static/js/{ProgressBar.B-kexwwD.js → ProgressBar.CPOGBKCi.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.BgaoZgep.js → RenderInPortalIfExists.BYu_CZaF.js} +1 -1
- streamlit/static/static/js/Toolbar.gXKw7ANv.js +1 -0
- streamlit/static/static/js/UploadFileInfo.0DCkpDDf.js +6 -0
- streamlit/static/static/js/{base-input.BoAa1U94.js → base-input.DBYPj91R.js} +4 -4
- streamlit/static/static/js/{checkbox.Z6iSfe5F.js → checkbox.BUm2vnNv.js} +2 -2
- streamlit/static/static/js/{createSuper.B4oGDYRm.js → createSuper.KD4RuZ-W.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.msYws2Ou.js → data-grid-overlay-editor.CUwpDfvI.js} +1 -1
- streamlit/static/static/js/{downloader.kc14n2Hv.js → downloader.CkDtclup.js} +1 -1
- streamlit/static/static/js/{es6.CxQz807-.js → es6.Dlcvh_r0.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.B19u0ONI.js → iframeResizer.contentWindow.DOXlFfve.js} +1 -1
- streamlit/static/static/js/{index.BGga-hcS.js → index.B0cuGMAB.js} +25 -25
- streamlit/static/static/js/index.BCWTclSV.js +73 -0
- streamlit/static/static/js/index.BJY_fap7.js +1 -0
- streamlit/static/static/js/index.BL3l6dnk.js +1 -0
- streamlit/static/static/js/{index.BFz9U2y0.js → index.BMZzRZjB.js} +1 -1
- streamlit/static/static/js/{index.-5ruC9At.js → index.BOzUTGDe.js} +1 -1
- streamlit/static/static/js/index.BYI5iO-o.js +1 -0
- streamlit/static/static/js/index.BYo0ywlm.js +783 -0
- streamlit/static/static/js/{index.CmTAF0dM.js → index.BYz9btsY.js} +1 -1
- streamlit/static/static/js/{index.BHGGDa8K.js → index.CCVzQz0Z.js} +2 -2
- streamlit/static/static/js/index.CD6FydK9.js +1 -0
- streamlit/static/static/js/index.CDYEqgC8.js +2 -0
- streamlit/static/static/js/{index.BRXmLIsC.js → index.CMP9c4xA.js} +1 -1
- streamlit/static/static/js/index.CN30QAPD.js +1 -0
- streamlit/static/static/js/{index.LaIasviC.js → index.CNqWQkTe.js} +1 -1
- streamlit/static/static/js/index.CaxS67Xz.js +1 -0
- streamlit/static/static/js/{index.xNQq3Ei5.js → index.CbsT4sGW.js} +1 -1
- streamlit/static/static/js/index.ChAVlxpQ.js +1 -0
- streamlit/static/static/js/{index.BqfdT8-Q.js → index.ClLMMmDd.js} +1 -1
- streamlit/static/static/js/{index.BHXxWdde.js → index.D-O9rQmV.js} +1 -1
- streamlit/static/static/js/{index.9V1KdxfP.js → index.D4k7VZZL.js} +1 -1
- streamlit/static/static/js/index.DLBi0Ar1.js +1 -0
- streamlit/static/static/js/index.DVq5XmJo.js +197 -0
- streamlit/static/static/js/{index.BoigZiu7.js → index.DZKmKXWw.js} +1 -1
- streamlit/static/static/js/index.DkaVx80F.js +1 -0
- streamlit/static/static/js/index.Dr968Klx.js +1 -0
- streamlit/static/static/js/{index.BpILzHf_.js → index.DtUYLn9j.js} +20 -20
- streamlit/static/static/js/index.DwjYSyhs.js +1 -0
- streamlit/static/static/js/index.DzrImxu4.js +1 -0
- streamlit/static/static/js/index.HyGsn4VM.js +1 -0
- streamlit/static/static/js/index.OwxC65od.js +12 -0
- streamlit/static/static/js/index.PZs7VZkC.js +1 -0
- streamlit/static/static/js/index.Voiqpj4q.js +1 -0
- streamlit/static/static/js/index.bSROvR-J.js +3 -0
- streamlit/static/static/js/index.oT9GD3l4.js +1 -0
- streamlit/static/static/js/{index.DeB9iKFW.js → index.qb-yAPH6.js} +255 -255
- streamlit/static/static/js/index.rJFy_Ygy.js +2 -0
- streamlit/static/static/js/{input.DsCfafm0.js → input.CwQtEnFN.js} +2 -2
- streamlit/static/static/js/{memory.nY_lMTtu.js → memory.C5XaFIjR.js} +1 -1
- streamlit/static/static/js/{mergeWith.B_7zmsM4.js → mergeWith.DzwwH6AG.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CSeVhHRU.js → number-overlay-editor.Dx0XqCkD.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.nNhsvgRd.js → possibleConstructorReturn.CVfSu9Ws.js} +1 -1
- streamlit/static/static/js/{sandbox.Cgm3iuL6.js → sandbox.BT0gdMXk.js} +1 -1
- streamlit/static/static/js/{textarea.BR8rlyih.js → textarea.DNCbrtbM.js} +2 -2
- streamlit/static/static/js/{timepicker.w4XhAenH.js → timepicker.4UYJD9Ts.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.CgkEPBwD.js → toConsumableArray.DUmnaVWV.js} +1 -1
- streamlit/static/static/js/{uniqueId.j-1rlNNH.js → uniqueId.DUvh-GL8.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.zXY9CjFS.js → useBasicWidgetState.Cwd7-jJa.js} +1 -1
- streamlit/static/static/js/useOnInputChange.DvemQrOM.js +1 -0
- streamlit/static/static/js/{withFullScreenWrapper.Ov13692o.js → withFullScreenWrapper.CiQ10ByU.js} +1 -1
- streamlit/static/static/media/SourceCodeVF-Italic.ttf.Ba1oaZG1.woff2 +0 -0
- streamlit/static/static/media/SourceCodeVF-Upright.ttf.BjWn63N-.woff2 +0 -0
- streamlit/static/static/media/SourceSansVF-Italic.ttf.Bt9VkdQ3.woff2 +0 -0
- streamlit/static/static/media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2 +0 -0
- streamlit/static/static/media/SourceSerifVariable-Italic.ttf.CVdzAtxO.woff2 +0 -0
- streamlit/static/static/media/SourceSerifVariable-Roman.ttf.mdpVL9bi.woff2 +0 -0
- streamlit/string_util.py +14 -19
- streamlit/temporary_directory.py +13 -4
- streamlit/testing/v1/app_test.py +15 -10
- streamlit/testing/v1/element_tree.py +157 -178
- streamlit/testing/v1/local_script_runner.py +11 -15
- streamlit/testing/v1/util.py +11 -4
- streamlit/type_util.py +8 -12
- streamlit/url_util.py +1 -1
- streamlit/user_info.py +6 -5
- streamlit/util.py +25 -1
- streamlit/vendor/pympler/asizeof.py +3 -2
- streamlit/watcher/event_based_path_watcher.py +15 -1
- streamlit/watcher/folder_black_list.py +2 -2
- streamlit/watcher/local_sources_watcher.py +64 -18
- streamlit/watcher/path_watcher.py +6 -10
- streamlit/watcher/polling_path_watcher.py +8 -7
- streamlit/watcher/util.py +7 -6
- streamlit/web/bootstrap.py +16 -14
- streamlit/web/cli.py +52 -45
- streamlit/web/server/__init__.py +7 -3
- streamlit/web/server/app_static_file_handler.py +1 -1
- streamlit/web/server/authlib_tornado_integration.py +9 -4
- streamlit/web/server/browser_websocket_handler.py +8 -2
- streamlit/web/server/component_request_handler.py +14 -10
- streamlit/web/server/media_file_handler.py +14 -7
- streamlit/web/server/oauth_authlib_routes.py +41 -9
- streamlit/web/server/oidc_mixin.py +35 -17
- streamlit/web/server/routes.py +32 -22
- streamlit/web/server/server.py +6 -18
- streamlit/web/server/server_util.py +19 -9
- streamlit/web/server/stats_request_handler.py +7 -5
- streamlit/web/server/upload_file_request_handler.py +22 -19
- streamlit/web/server/websocket_headers.py +1 -1
- {streamlit-1.45.1.dist-info → streamlit-1.46.0.dist-info}/METADATA +4 -4
- streamlit-1.46.0.dist-info/RECORD +559 -0
- {streamlit-1.45.1.dist-info → streamlit-1.46.0.dist-info}/WHEEL +1 -1
- streamlit/elements/lib/event_utils.py +0 -39
- streamlit/static/static/js/Toolbar.D9RUZv9G.js +0 -1
- streamlit/static/static/js/UploadFileInfo.C-jY39rj.js +0 -1
- streamlit/static/static/js/index.8jhZBWF2.js +0 -3
- streamlit/static/static/js/index.BCx3C6e_.js +0 -1
- streamlit/static/static/js/index.BRuTz_S4.js +0 -1
- streamlit/static/static/js/index.Bcru_ti-.js +0 -1
- streamlit/static/static/js/index.Bl1FMJRd.js +0 -1
- streamlit/static/static/js/index.C1z8KpLA.js +0 -779
- streamlit/static/static/js/index.C32I2PUe.js +0 -2
- streamlit/static/static/js/index.C5GnDRB7.js +0 -1
- streamlit/static/static/js/index.CG4qPaaW.js +0 -2
- streamlit/static/static/js/index.C_msmT1u.js +0 -1
- streamlit/static/static/js/index.CbeNTdd6.js +0 -1
- streamlit/static/static/js/index.CnGQVJcw.js +0 -12
- streamlit/static/static/js/index.CopVVq4l.js +0 -1
- streamlit/static/static/js/index.CtXupx4d.js +0 -197
- streamlit/static/static/js/index.DGmCchO7.js +0 -1
- streamlit/static/static/js/index.DH6zBk0e.js +0 -1
- streamlit/static/static/js/index.DHVlVWsm.js +0 -1
- streamlit/static/static/js/index.DRKIVBoi.js +0 -1
- streamlit/static/static/js/index.DUd-lFXx.js +0 -73
- streamlit/static/static/js/index.D_uRBA4B.js +0 -1
- streamlit/static/static/js/index.QHNfgPJd.js +0 -1
- streamlit/static/static/js/index.a-RJocYL.js +0 -1
- streamlit/static/static/js/index.cvz4B1gy.js +0 -1
- streamlit/static/static/js/index.t--hEgTQ.js +0 -6
- streamlit/static/static/js/useOnInputChange.z04u96A8.js +0 -1
- streamlit/static/static/media/SourceCodePro-Bold.CFEfr7-q.woff2 +0 -0
- streamlit/static/static/media/SourceCodePro-BoldItalic.C-LkFXxa.woff2 +0 -0
- streamlit/static/static/media/SourceCodePro-Italic.CxFOx7N-.woff2 +0 -0
- streamlit/static/static/media/SourceCodePro-Regular.CBOlD63d.woff2 +0 -0
- streamlit/static/static/media/SourceCodePro-SemiBold.CFHwW3Wd.woff2 +0 -0
- streamlit/static/static/media/SourceCodePro-SemiBoldItalic.Cg2yRu82.woff2 +0 -0
- streamlit/static/static/media/SourceSansPro-Bold.-6c9oR8J.woff2 +0 -0
- streamlit/static/static/media/SourceSansPro-BoldItalic.DmM_grLY.woff2 +0 -0
- streamlit/static/static/media/SourceSansPro-Italic.I1ipWe7Q.woff2 +0 -0
- streamlit/static/static/media/SourceSansPro-Regular.DZLUzqI4.woff2 +0 -0
- streamlit/static/static/media/SourceSansPro-SemiBold.sKQIyTMz.woff2 +0 -0
- streamlit/static/static/media/SourceSansPro-SemiBoldItalic.C0wP0icr.woff2 +0 -0
- streamlit/static/static/media/SourceSerifPro-Bold.8TUnKj4x.woff2 +0 -0
- streamlit/static/static/media/SourceSerifPro-BoldItalic.CBVO7Ve7.woff2 +0 -0
- streamlit/static/static/media/SourceSerifPro-Italic.DkFgL2HZ.woff2 +0 -0
- streamlit/static/static/media/SourceSerifPro-Regular.CNJNET2S.woff2 +0 -0
- streamlit/static/static/media/SourceSerifPro-SemiBold.CHyh9GC5.woff2 +0 -0
- streamlit/static/static/media/SourceSerifPro-SemiBoldItalic.CBtz8sWN.woff2 +0 -0
- streamlit-1.45.1.dist-info/RECORD +0 -568
- {streamlit-1.45.1.data → streamlit-1.46.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.45.1.dist-info → streamlit-1.46.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.45.1.dist-info → streamlit-1.46.0.dist-info}/top_level.txt +0 -0
|
@@ -52,34 +52,10 @@ _About: TypeAlias = Literal["About", "about"]
|
|
|
52
52
|
MenuKey: TypeAlias = Literal[_GetHelp, _ReportABug, _About]
|
|
53
53
|
MenuItems: TypeAlias = Mapping[MenuKey, Union[str, None]]
|
|
54
54
|
|
|
55
|
-
# Emojis recommended by https://share.streamlit.io/rensdimmendaal/emoji-recommender/main/app/streamlit.py
|
|
56
|
-
# for the term "streamlit". Watch out for zero-width joiners,
|
|
57
|
-
# as they won't parse correctly in the list() call!
|
|
58
55
|
RANDOM_EMOJIS: Final = list(
|
|
59
56
|
"🔥™🎉🚀🌌💣✨🌙🎆🎇💥🤩🤙🌛🤘⬆💡🤪🥂⚡💨🌠🎊🍿😛🔮🤟🌃🍃🍾💫▪🌴🎈🎬🌀🎄😝☔⛽🍂💃😎🍸🎨🥳☀😍🅱🌞😻🌟😜💦💅🦄😋😉👻🍁🤤👯🌻‼🌈👌🎃💛😚🔫🙌👽🍬🌅☁🍷👭☕🌚💁👅🥰🍜😌🎥🕺❕🧡☄💕🍻✅🌸🚬🤓🍹®☺💪😙☘🤠✊🤗🍵🤞😂💯😏📻🎂💗💜🌊❣🌝😘💆🤑🌿🦋😈⛄🚿😊🌹🥴😽💋😭🖤🙆👐⚪💟☃🙈🍭💻🥀🚗🤧🍝💎💓🤝💄💖🔞⁉⏰🕊🎧☠♥🌳🏾🙉⭐💊🍳🌎🙊💸❤🔪😆🌾✈📚💀🏠✌🏃🌵🚨💂🤫🤭😗😄🍒👏🙃🖖💞😅🎅🍄🆓👉💩🔊🤷⌚👸😇🚮💏👳🏽💘💿💉👠🎼🎶🎤👗❄🔐🎵🤒🍰👓🏄🌲🎮🙂📈🚙📍😵🗣❗🌺🙄👄🚘🥺🌍🏡♦💍🌱👑👙☑👾🍩🥶📣🏼🤣☯👵🍫➡🎀😃✋🍞🙇😹🙏👼🐝⚫🎁🍪🔨🌼👆👀😳🌏📖👃🎸👧💇🔒💙😞⛅🏻🍴😼🗿🍗♠🦁✔🤖☮🐢🐎💤😀🍺😁😴📺☹😲👍🎭💚🍆🍋🔵🏁🔴🔔🧐👰☎🏆🤡🐠📲🙋📌🐬✍🔑📱💰🐱💧🎓🍕👟🐣👫🍑😸🍦👁🆗🎯📢🚶🦅🐧💢🏀🚫💑🐟🌽🏊🍟💝💲🐍🍥🐸☝♣👊⚓❌🐯🏈📰🌧👿🐳💷🐺📞🆒🍀🤐🚲🍔👹🙍🌷🙎🐥💵🔝📸⚠❓🎩✂🍼😑⬇⚾🍎💔🐔⚽💭🏌🐷🍍✖🍇📝🍊🐙👋🤔🥊🗽🐑🐘🐰💐🐴♀🐦🍓✏👂🏴👇🆘😡🏉👩💌😺✝🐼🐒🐶👺🖕👬🍉🐻🐾⬅⏬▶👮🍌♂🔸👶🐮👪⛳🐐🎾🐕👴🐨🐊🔹©🎣👦👣👨👈💬⭕📹📷"
|
|
60
57
|
)
|
|
61
58
|
|
|
62
|
-
# Also pick out some vanity emojis.
|
|
63
|
-
ENG_EMOJIS: Final = [
|
|
64
|
-
"🎈", # st.balloons 🎈🎈
|
|
65
|
-
"🤓", # Abhi
|
|
66
|
-
"🏈", # Amey
|
|
67
|
-
"🚲", # Thiago
|
|
68
|
-
"🐧", # Matteo
|
|
69
|
-
"🦒", # Ken
|
|
70
|
-
"🐳", # Karrie
|
|
71
|
-
"🕹️", # Jonathan
|
|
72
|
-
"🇦🇲", # Henrikh
|
|
73
|
-
"🎸", # Guido
|
|
74
|
-
"🦈", # Austin
|
|
75
|
-
"💎", # Emiliano
|
|
76
|
-
"👩🎤", # Naomi
|
|
77
|
-
"🧙♂️", # Jon
|
|
78
|
-
"🐻", # Brandon
|
|
79
|
-
"🎎", # James
|
|
80
|
-
# TODO: Solicit emojis from the rest of Streamlit
|
|
81
|
-
]
|
|
82
|
-
|
|
83
59
|
|
|
84
60
|
def _lower_clean_dict_keys(dict: MenuItems) -> dict[str, Any]:
|
|
85
61
|
return {str(k).lower().strip(): v for k, v in dict.items()}
|
|
@@ -134,26 +110,34 @@ def _get_favicon_string(page_icon: PageIcon) -> str:
|
|
|
134
110
|
def set_page_config(
|
|
135
111
|
page_title: str | None = None,
|
|
136
112
|
page_icon: PageIcon | None = None,
|
|
137
|
-
layout: Layout =
|
|
138
|
-
initial_sidebar_state: InitialSideBarState =
|
|
113
|
+
layout: Layout | None = None,
|
|
114
|
+
initial_sidebar_state: InitialSideBarState | None = None,
|
|
139
115
|
menu_items: MenuItems | None = None,
|
|
140
116
|
) -> None:
|
|
141
117
|
"""
|
|
142
|
-
|
|
118
|
+
Configure the default settings of the page.
|
|
143
119
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
120
|
+
This command can be called multiple times in a script run to dynamically
|
|
121
|
+
change the page configuration. The calls are additive, with each successive
|
|
122
|
+
call overriding only the parameters that are specified.
|
|
147
123
|
|
|
148
124
|
Parameters
|
|
149
125
|
----------
|
|
150
126
|
page_title: str or None
|
|
151
|
-
The page title, shown in the browser tab. If
|
|
152
|
-
|
|
127
|
+
The page title, shown in the browser tab. If this is ``None``
|
|
128
|
+
(default), the page title is inherited from the previous call of
|
|
129
|
+
``st.set_page_config``. If this is ``None`` and no previous call
|
|
130
|
+
exists, the page title is inferred from the page source.
|
|
131
|
+
|
|
132
|
+
If a page source is a Python file, its inferred title is derived from
|
|
133
|
+
the filename. If a page source is a callable object, its inferred title
|
|
134
|
+
is derived from the callable's name.
|
|
153
135
|
|
|
154
136
|
page_icon : Anything supported by st.image (except list), str, or None
|
|
155
|
-
The page favicon. If ``page_icon`` is ``None`` (default), the
|
|
156
|
-
|
|
137
|
+
The page favicon. If ``page_icon`` is ``None`` (default), the page icon
|
|
138
|
+
is inherited from the previous call of ``st.set_page_config``. If this
|
|
139
|
+
is ``None`` and no previous call exists, the favicon is a monochrome
|
|
140
|
+
Streamlit logo.
|
|
157
141
|
|
|
158
142
|
In addition to the types supported by |st.image|_ (except list), the
|
|
159
143
|
following strings are valid:
|
|
@@ -184,17 +168,29 @@ def set_page_config(
|
|
|
184
168
|
.. |st.image| replace:: ``st.image``
|
|
185
169
|
.. _st.image: https://docs.streamlit.io/develop/api-reference/media/st.image
|
|
186
170
|
|
|
187
|
-
layout: "centered"
|
|
188
|
-
How the page content should be laid out.
|
|
189
|
-
|
|
190
|
-
|
|
171
|
+
layout: "centered", "wide", or None
|
|
172
|
+
How the page content should be laid out. If this is ``None`` (default),
|
|
173
|
+
the page layout is inherited from the previous call of
|
|
174
|
+
``st.set_page_config``. If this is ``None`` and no previous call
|
|
175
|
+
exists, the page layout is ``"centered"``.
|
|
176
|
+
|
|
177
|
+
``"centered"`` constrains the elements into a centered column of fixed
|
|
178
|
+
width. ``"wide"`` uses the entire screen.
|
|
179
|
+
|
|
180
|
+
initial_sidebar_state: "auto", "expanded", "collapsed", or None
|
|
181
|
+
How the sidebar should start out. If this is ``None`` (default), the
|
|
182
|
+
sidebar state is inherited from the previous call of
|
|
183
|
+
``st.set_page_config``. If no previous call exists, the sidebar state
|
|
184
|
+
is ``"auto"``.
|
|
191
185
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
"expanded"
|
|
196
|
-
|
|
197
|
-
|
|
186
|
+
The folowing states are supported:
|
|
187
|
+
|
|
188
|
+
- ``"auto"``: The sidebar is hidden on small devices and shown otherwise.
|
|
189
|
+
- ``"expanded"``: The sidebar is shown initially.
|
|
190
|
+
- ``"collapsed"``: The sidebar is hidden initially.
|
|
191
|
+
|
|
192
|
+
In most cases, ``"auto"`` provides the best user experience across
|
|
193
|
+
devices of different sizes.
|
|
198
194
|
|
|
199
195
|
menu_items: dict
|
|
200
196
|
Configure the menu that appears on the top-right side of this app.
|
|
@@ -211,6 +207,8 @@ def set_page_config(
|
|
|
211
207
|
If None, only shows Streamlit's default About text.
|
|
212
208
|
|
|
213
209
|
The URL may also refer to an email address e.g. ``mailto:john@example.com``.
|
|
210
|
+
To remove an item that was specified in a previous call to
|
|
211
|
+
``st.set_page_config``, set its value to ``None`` in the dictionary.
|
|
214
212
|
|
|
215
213
|
Example
|
|
216
214
|
-------
|
|
@@ -242,7 +240,11 @@ def set_page_config(
|
|
|
242
240
|
pb_layout = PageConfigProto.CENTERED
|
|
243
241
|
elif layout == "wide":
|
|
244
242
|
pb_layout = PageConfigProto.WIDE
|
|
243
|
+
elif layout is None:
|
|
244
|
+
# Allows for multiple (additive) calls to set_page_config
|
|
245
|
+
pb_layout = PageConfigProto.LAYOUT_UNSET
|
|
245
246
|
else:
|
|
247
|
+
# Note: Pylance incorrectly notes this error as unreachable
|
|
246
248
|
raise StreamlitInvalidPageLayoutError(layout=layout)
|
|
247
249
|
|
|
248
250
|
msg.page_config_changed.layout = pb_layout
|
|
@@ -254,7 +256,11 @@ def set_page_config(
|
|
|
254
256
|
pb_sidebar_state = PageConfigProto.EXPANDED
|
|
255
257
|
elif initial_sidebar_state == "collapsed":
|
|
256
258
|
pb_sidebar_state = PageConfigProto.COLLAPSED
|
|
259
|
+
elif initial_sidebar_state is None:
|
|
260
|
+
# Allows for multiple (additive) calls to set_page_config
|
|
261
|
+
pb_sidebar_state = PageConfigProto.SIDEBAR_UNSET
|
|
257
262
|
else:
|
|
263
|
+
# Note: Pylance incorrectly notes this error as unreachable
|
|
258
264
|
raise StreamlitInvalidSidebarStateError(
|
|
259
265
|
initial_sidebar_state=initial_sidebar_state
|
|
260
266
|
)
|
|
@@ -274,12 +280,13 @@ def set_page_config(
|
|
|
274
280
|
|
|
275
281
|
|
|
276
282
|
def get_random_emoji() -> str:
|
|
277
|
-
# Weigh our emojis 10x, cuz we're awesome!
|
|
278
283
|
# TODO: fix the random seed with a hash of the user's app code, for stability?
|
|
279
|
-
return random.choice(RANDOM_EMOJIS
|
|
284
|
+
return random.choice(RANDOM_EMOJIS) # noqa: S311
|
|
280
285
|
|
|
281
286
|
|
|
282
|
-
def set_menu_items_proto(
|
|
287
|
+
def set_menu_items_proto(
|
|
288
|
+
lowercase_menu_items: MenuItems, menu_items_proto: PageConfigProto.MenuItems
|
|
289
|
+
) -> None:
|
|
283
290
|
if GET_HELP_KEY in lowercase_menu_items:
|
|
284
291
|
if lowercase_menu_items[GET_HELP_KEY] is not None:
|
|
285
292
|
menu_items_proto.get_help_url = lowercase_menu_items[GET_HELP_KEY]
|
|
@@ -295,6 +302,9 @@ def set_menu_items_proto(lowercase_menu_items, menu_items_proto) -> None:
|
|
|
295
302
|
if ABOUT_KEY in lowercase_menu_items:
|
|
296
303
|
if lowercase_menu_items[ABOUT_KEY] is not None:
|
|
297
304
|
menu_items_proto.about_section_md = dedent(lowercase_menu_items[ABOUT_KEY])
|
|
305
|
+
else:
|
|
306
|
+
# For multiple calls to set_page_config, clears previously set about markdown
|
|
307
|
+
menu_items_proto.clear_about_md = True
|
|
298
308
|
|
|
299
309
|
|
|
300
310
|
def validate_menu_items(menu_items: MenuItems) -> None:
|
|
@@ -40,7 +40,7 @@ class BaseCustomComponent(ABC):
|
|
|
40
40
|
path: str | None = None,
|
|
41
41
|
url: str | None = None,
|
|
42
42
|
module_name: str | None = None,
|
|
43
|
-
):
|
|
43
|
+
) -> None:
|
|
44
44
|
if (path is None and url is None) or (path is not None and url is not None):
|
|
45
45
|
raise StreamlitAPIException(
|
|
46
46
|
"Either 'path' or 'url' must be set, but not both."
|
|
@@ -56,12 +56,12 @@ class BaseCustomComponent(ABC):
|
|
|
56
56
|
|
|
57
57
|
def __call__(
|
|
58
58
|
self,
|
|
59
|
-
*args,
|
|
59
|
+
*args: Any,
|
|
60
60
|
default: Any = None,
|
|
61
61
|
key: str | None = None,
|
|
62
62
|
on_change: WidgetCallback | None = None,
|
|
63
63
|
tab_index: int | None = None,
|
|
64
|
-
**kwargs,
|
|
64
|
+
**kwargs: Any,
|
|
65
65
|
) -> Any:
|
|
66
66
|
"""An alias for create_instance."""
|
|
67
67
|
return self.create_instance(
|
|
@@ -99,24 +99,24 @@ class BaseCustomComponent(ABC):
|
|
|
99
99
|
return f"'{self.name}': {self.path if self.path is not None else self.url}"
|
|
100
100
|
|
|
101
101
|
@abstractmethod
|
|
102
|
-
def __eq__(self, other) -> bool:
|
|
102
|
+
def __eq__(self, other: object) -> bool:
|
|
103
103
|
"""Equality operator."""
|
|
104
104
|
return NotImplemented
|
|
105
105
|
|
|
106
106
|
@abstractmethod
|
|
107
|
-
def __ne__(self, other) -> bool:
|
|
107
|
+
def __ne__(self, other: object) -> bool:
|
|
108
108
|
"""Inequality operator."""
|
|
109
109
|
return NotImplemented
|
|
110
110
|
|
|
111
111
|
@abstractmethod
|
|
112
112
|
def create_instance(
|
|
113
113
|
self,
|
|
114
|
-
*args,
|
|
114
|
+
*args: Any,
|
|
115
115
|
default: Any = None,
|
|
116
116
|
key: str | None = None,
|
|
117
117
|
on_change: WidgetCallback | None = None,
|
|
118
118
|
tab_index: int | None = None,
|
|
119
|
-
**kwargs,
|
|
119
|
+
**kwargs: Any,
|
|
120
120
|
) -> Any:
|
|
121
121
|
"""Create a new instance of the component.
|
|
122
122
|
|
|
@@ -33,7 +33,8 @@ def _get_module_name(caller_frame: FrameType) -> str:
|
|
|
33
33
|
# Get the caller's module name. `__name__` gives us the module's
|
|
34
34
|
# fully-qualified name, which includes its package.
|
|
35
35
|
module = inspect.getmodule(caller_frame)
|
|
36
|
-
|
|
36
|
+
if module is None:
|
|
37
|
+
raise RuntimeError("module is None. This should never happen.")
|
|
37
38
|
module_name = module.__name__
|
|
38
39
|
|
|
39
40
|
# If the caller was the main module that was executed (that is, if the
|
|
@@ -96,10 +97,13 @@ def declare_component(
|
|
|
96
97
|
|
|
97
98
|
# Get our stack frame.
|
|
98
99
|
current_frame: FrameType | None = inspect.currentframe()
|
|
99
|
-
|
|
100
|
+
if current_frame is None:
|
|
101
|
+
raise RuntimeError("current_frame is None. This should never happen.")
|
|
100
102
|
# Get the stack frame of our calling function.
|
|
101
103
|
caller_frame = current_frame.f_back
|
|
102
|
-
|
|
104
|
+
if caller_frame is None:
|
|
105
|
+
raise RuntimeError("caller_frame is None. This should never happen.")
|
|
106
|
+
|
|
103
107
|
module_name = _get_module_name(caller_frame)
|
|
104
108
|
|
|
105
109
|
# Build the component name.
|
|
@@ -48,12 +48,12 @@ class CustomComponent(BaseCustomComponent):
|
|
|
48
48
|
|
|
49
49
|
def __call__(
|
|
50
50
|
self,
|
|
51
|
-
*args,
|
|
51
|
+
*args: Any,
|
|
52
52
|
default: Any = None,
|
|
53
53
|
key: str | None = None,
|
|
54
54
|
on_change: WidgetCallback | None = None,
|
|
55
55
|
tab_index: int | None = None,
|
|
56
|
-
**kwargs,
|
|
56
|
+
**kwargs: Any,
|
|
57
57
|
) -> Any:
|
|
58
58
|
"""An alias for create_instance."""
|
|
59
59
|
return self.create_instance(
|
|
@@ -68,12 +68,12 @@ class CustomComponent(BaseCustomComponent):
|
|
|
68
68
|
@gather_metrics("create_instance")
|
|
69
69
|
def create_instance(
|
|
70
70
|
self,
|
|
71
|
-
*args,
|
|
71
|
+
*args: Any,
|
|
72
72
|
default: Any = None,
|
|
73
73
|
key: str | None = None,
|
|
74
74
|
on_change: WidgetCallback | None = None,
|
|
75
75
|
tab_index: int | None = None,
|
|
76
|
-
**kwargs,
|
|
76
|
+
**kwargs: Any,
|
|
77
77
|
) -> Any:
|
|
78
78
|
"""Create a new instance of the component.
|
|
79
79
|
|
|
@@ -183,7 +183,7 @@ And if you're using Streamlit Cloud, add "pyarrow" to your requirements.txt."""
|
|
|
183
183
|
# other arguments change, and the component's iframe won't be
|
|
184
184
|
# remounted on the frontend.
|
|
185
185
|
|
|
186
|
-
def marshall_element_args():
|
|
186
|
+
def marshall_element_args() -> None:
|
|
187
187
|
element.component_instance.json_args = serialized_json_args
|
|
188
188
|
element.component_instance.special_args.extend(special_args)
|
|
189
189
|
|
|
@@ -210,7 +210,7 @@ And if you're using Streamlit Cloud, add "pyarrow" to your requirements.txt."""
|
|
|
210
210
|
)
|
|
211
211
|
element.component_instance.id = computed_id
|
|
212
212
|
|
|
213
|
-
def deserialize_component(ui_value
|
|
213
|
+
def deserialize_component(ui_value: Any) -> Any:
|
|
214
214
|
# ui_value is an object from json, an ArrowTable proto, or a bytearray
|
|
215
215
|
return ui_value
|
|
216
216
|
|
|
@@ -243,7 +243,7 @@ And if you're using Streamlit Cloud, add "pyarrow" to your requirements.txt."""
|
|
|
243
243
|
dg._enqueue("component_instance", element.component_instance)
|
|
244
244
|
return return_value
|
|
245
245
|
|
|
246
|
-
def __eq__(self, other) -> bool:
|
|
246
|
+
def __eq__(self, other: object) -> bool:
|
|
247
247
|
"""Equality operator."""
|
|
248
248
|
return (
|
|
249
249
|
isinstance(other, CustomComponent)
|
|
@@ -253,7 +253,7 @@ And if you're using Streamlit Cloud, add "pyarrow" to your requirements.txt."""
|
|
|
253
253
|
and self.module_name == other.module_name
|
|
254
254
|
)
|
|
255
255
|
|
|
256
|
-
def __ne__(self, other) -> bool:
|
|
256
|
+
def __ne__(self, other: object) -> bool:
|
|
257
257
|
"""Inequality operator."""
|
|
258
258
|
|
|
259
259
|
# we have to use "not X == Y"" here because if we use "X != Y"
|