streamlit-nightly 1.43.2.dev20250307__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 +306 -0
- streamlit/__main__.py +20 -0
- streamlit/auth_util.py +218 -0
- streamlit/cli_util.py +105 -0
- streamlit/column_config.py +56 -0
- streamlit/commands/__init__.py +13 -0
- streamlit/commands/echo.py +126 -0
- streamlit/commands/execution_control.py +238 -0
- streamlit/commands/experimental_query_params.py +169 -0
- streamlit/commands/logo.py +189 -0
- streamlit/commands/navigation.py +385 -0
- streamlit/commands/page_config.py +311 -0
- streamlit/components/__init__.py +13 -0
- streamlit/components/lib/__init__.py +13 -0
- streamlit/components/lib/local_component_registry.py +84 -0
- streamlit/components/types/__init__.py +13 -0
- streamlit/components/types/base_component_registry.py +99 -0
- streamlit/components/types/base_custom_component.py +150 -0
- streamlit/components/v1/__init__.py +31 -0
- streamlit/components/v1/component_arrow.py +141 -0
- streamlit/components/v1/component_registry.py +130 -0
- streamlit/components/v1/components.py +38 -0
- streamlit/components/v1/custom_component.py +243 -0
- streamlit/config.py +1513 -0
- streamlit/config_option.py +311 -0
- streamlit/config_util.py +177 -0
- streamlit/connections/__init__.py +28 -0
- streamlit/connections/base_connection.py +174 -0
- streamlit/connections/snowflake_connection.py +562 -0
- streamlit/connections/snowpark_connection.py +213 -0
- streamlit/connections/sql_connection.py +425 -0
- streamlit/connections/util.py +97 -0
- streamlit/cursor.py +210 -0
- streamlit/dataframe_util.py +1416 -0
- streamlit/delta_generator.py +602 -0
- streamlit/delta_generator_singletons.py +204 -0
- streamlit/deprecation_util.py +209 -0
- streamlit/development.py +21 -0
- streamlit/elements/__init__.py +13 -0
- streamlit/elements/alert.py +234 -0
- streamlit/elements/arrow.py +962 -0
- streamlit/elements/balloons.py +47 -0
- streamlit/elements/bokeh_chart.py +133 -0
- streamlit/elements/code.py +114 -0
- streamlit/elements/deck_gl_json_chart.py +546 -0
- streamlit/elements/dialog_decorator.py +267 -0
- streamlit/elements/doc_string.py +558 -0
- streamlit/elements/empty.py +130 -0
- streamlit/elements/exception.py +331 -0
- streamlit/elements/form.py +354 -0
- streamlit/elements/graphviz_chart.py +150 -0
- streamlit/elements/heading.py +302 -0
- streamlit/elements/html.py +105 -0
- streamlit/elements/iframe.py +191 -0
- streamlit/elements/image.py +196 -0
- streamlit/elements/json.py +139 -0
- streamlit/elements/layouts.py +879 -0
- streamlit/elements/lib/__init__.py +13 -0
- streamlit/elements/lib/built_in_chart_utils.py +1157 -0
- streamlit/elements/lib/color_util.py +263 -0
- streamlit/elements/lib/column_config_utils.py +542 -0
- streamlit/elements/lib/column_types.py +2188 -0
- streamlit/elements/lib/dialog.py +147 -0
- streamlit/elements/lib/dicttools.py +154 -0
- streamlit/elements/lib/event_utils.py +37 -0
- streamlit/elements/lib/file_uploader_utils.py +66 -0
- streamlit/elements/lib/form_utils.py +77 -0
- streamlit/elements/lib/image_utils.py +441 -0
- streamlit/elements/lib/js_number.py +105 -0
- streamlit/elements/lib/mutable_status_container.py +183 -0
- streamlit/elements/lib/options_selector_utils.py +250 -0
- streamlit/elements/lib/pandas_styler_utils.py +274 -0
- streamlit/elements/lib/policies.py +194 -0
- streamlit/elements/lib/streamlit_plotly_theme.py +207 -0
- streamlit/elements/lib/subtitle_utils.py +176 -0
- streamlit/elements/lib/utils.py +250 -0
- streamlit/elements/map.py +508 -0
- streamlit/elements/markdown.py +277 -0
- streamlit/elements/media.py +793 -0
- streamlit/elements/metric.py +301 -0
- streamlit/elements/plotly_chart.py +546 -0
- streamlit/elements/progress.py +156 -0
- streamlit/elements/pyplot.py +194 -0
- streamlit/elements/snow.py +47 -0
- streamlit/elements/spinner.py +113 -0
- streamlit/elements/text.py +76 -0
- streamlit/elements/toast.py +98 -0
- streamlit/elements/vega_charts.py +1984 -0
- streamlit/elements/widgets/__init__.py +13 -0
- streamlit/elements/widgets/audio_input.py +310 -0
- streamlit/elements/widgets/button.py +1123 -0
- streamlit/elements/widgets/button_group.py +1008 -0
- streamlit/elements/widgets/camera_input.py +263 -0
- streamlit/elements/widgets/chat.py +647 -0
- streamlit/elements/widgets/checkbox.py +352 -0
- streamlit/elements/widgets/color_picker.py +265 -0
- streamlit/elements/widgets/data_editor.py +983 -0
- streamlit/elements/widgets/file_uploader.py +486 -0
- streamlit/elements/widgets/multiselect.py +338 -0
- streamlit/elements/widgets/number_input.py +545 -0
- streamlit/elements/widgets/radio.py +407 -0
- streamlit/elements/widgets/select_slider.py +437 -0
- streamlit/elements/widgets/selectbox.py +366 -0
- streamlit/elements/widgets/slider.py +880 -0
- streamlit/elements/widgets/text_widgets.py +628 -0
- streamlit/elements/widgets/time_widgets.py +970 -0
- streamlit/elements/write.py +574 -0
- streamlit/emojis.py +34 -0
- streamlit/env_util.py +61 -0
- streamlit/error_util.py +105 -0
- streamlit/errors.py +452 -0
- streamlit/external/__init__.py +13 -0
- streamlit/external/langchain/__init__.py +23 -0
- streamlit/external/langchain/streamlit_callback_handler.py +406 -0
- streamlit/file_util.py +247 -0
- streamlit/git_util.py +173 -0
- streamlit/hello/__init__.py +13 -0
- streamlit/hello/animation_demo.py +82 -0
- streamlit/hello/dataframe_demo.py +71 -0
- streamlit/hello/hello.py +37 -0
- streamlit/hello/mapping_demo.py +114 -0
- streamlit/hello/plotting_demo.py +55 -0
- streamlit/hello/streamlit_app.py +55 -0
- streamlit/hello/utils.py +28 -0
- streamlit/logger.py +130 -0
- streamlit/material_icon_names.py +25 -0
- streamlit/navigation/__init__.py +13 -0
- streamlit/navigation/page.py +302 -0
- streamlit/net_util.py +125 -0
- streamlit/platform.py +33 -0
- streamlit/proto/Alert_pb2.py +29 -0
- streamlit/proto/Alert_pb2.pyi +90 -0
- streamlit/proto/AppPage_pb2.py +27 -0
- streamlit/proto/AppPage_pb2.pyi +64 -0
- streamlit/proto/ArrowNamedDataSet_pb2.py +28 -0
- streamlit/proto/ArrowNamedDataSet_pb2.pyi +57 -0
- streamlit/proto/ArrowVegaLiteChart_pb2.py +29 -0
- streamlit/proto/ArrowVegaLiteChart_pb2.pyi +84 -0
- streamlit/proto/Arrow_pb2.py +33 -0
- streamlit/proto/Arrow_pb2.pyi +188 -0
- streamlit/proto/AudioInput_pb2.py +28 -0
- streamlit/proto/AudioInput_pb2.pyi +58 -0
- streamlit/proto/Audio_pb2.py +27 -0
- streamlit/proto/Audio_pb2.pyi +58 -0
- streamlit/proto/AuthRedirect_pb2.py +27 -0
- streamlit/proto/AuthRedirect_pb2.pyi +41 -0
- streamlit/proto/AutoRerun_pb2.py +27 -0
- streamlit/proto/AutoRerun_pb2.pyi +45 -0
- streamlit/proto/BackMsg_pb2.py +29 -0
- streamlit/proto/BackMsg_pb2.pyi +105 -0
- streamlit/proto/Balloons_pb2.py +27 -0
- streamlit/proto/Balloons_pb2.pyi +43 -0
- streamlit/proto/Block_pb2.py +53 -0
- streamlit/proto/Block_pb2.pyi +322 -0
- streamlit/proto/BokehChart_pb2.py +27 -0
- streamlit/proto/BokehChart_pb2.pyi +49 -0
- streamlit/proto/ButtonGroup_pb2.py +36 -0
- streamlit/proto/ButtonGroup_pb2.pyi +169 -0
- streamlit/proto/Button_pb2.py +27 -0
- streamlit/proto/Button_pb2.pyi +71 -0
- streamlit/proto/CameraInput_pb2.py +28 -0
- streamlit/proto/CameraInput_pb2.pyi +58 -0
- streamlit/proto/ChatInput_pb2.py +31 -0
- streamlit/proto/ChatInput_pb2.pyi +111 -0
- streamlit/proto/Checkbox_pb2.py +30 -0
- streamlit/proto/Checkbox_pb2.pyi +90 -0
- streamlit/proto/ClientState_pb2.py +30 -0
- streamlit/proto/ClientState_pb2.pyi +90 -0
- streamlit/proto/Code_pb2.py +27 -0
- streamlit/proto/Code_pb2.pyi +55 -0
- streamlit/proto/ColorPicker_pb2.py +28 -0
- streamlit/proto/ColorPicker_pb2.pyi +67 -0
- streamlit/proto/Common_pb2.py +51 -0
- streamlit/proto/Common_pb2.pyi +293 -0
- streamlit/proto/Components_pb2.py +35 -0
- streamlit/proto/Components_pb2.pyi +172 -0
- streamlit/proto/DataFrame_pb2.py +56 -0
- streamlit/proto/DataFrame_pb2.pyi +397 -0
- streamlit/proto/DateInput_pb2.py +28 -0
- streamlit/proto/DateInput_pb2.pyi +83 -0
- streamlit/proto/DeckGlJsonChart_pb2.py +29 -0
- streamlit/proto/DeckGlJsonChart_pb2.pyi +102 -0
- streamlit/proto/Delta_pb2.py +31 -0
- streamlit/proto/Delta_pb2.pyi +74 -0
- streamlit/proto/DocString_pb2.py +29 -0
- streamlit/proto/DocString_pb2.pyi +93 -0
- streamlit/proto/DownloadButton_pb2.py +27 -0
- streamlit/proto/DownloadButton_pb2.pyi +70 -0
- streamlit/proto/Element_pb2.py +78 -0
- streamlit/proto/Element_pb2.pyi +312 -0
- streamlit/proto/Empty_pb2.py +27 -0
- streamlit/proto/Empty_pb2.pyi +36 -0
- streamlit/proto/Exception_pb2.py +27 -0
- streamlit/proto/Exception_pb2.pyi +72 -0
- streamlit/proto/Favicon_pb2.py +27 -0
- streamlit/proto/Favicon_pb2.pyi +40 -0
- streamlit/proto/FileUploader_pb2.py +28 -0
- streamlit/proto/FileUploader_pb2.pyi +78 -0
- streamlit/proto/ForwardMsg_pb2.py +53 -0
- streamlit/proto/ForwardMsg_pb2.pyi +293 -0
- streamlit/proto/GitInfo_pb2.py +29 -0
- streamlit/proto/GitInfo_pb2.pyi +83 -0
- streamlit/proto/GraphVizChart_pb2.py +27 -0
- streamlit/proto/GraphVizChart_pb2.pyi +53 -0
- streamlit/proto/Heading_pb2.py +27 -0
- streamlit/proto/Heading_pb2.pyi +56 -0
- streamlit/proto/Html_pb2.py +27 -0
- streamlit/proto/Html_pb2.pyi +42 -0
- streamlit/proto/IFrame_pb2.py +27 -0
- streamlit/proto/IFrame_pb2.pyi +59 -0
- streamlit/proto/Image_pb2.py +29 -0
- streamlit/proto/Image_pb2.pyi +84 -0
- streamlit/proto/Json_pb2.py +27 -0
- streamlit/proto/Json_pb2.pyi +53 -0
- streamlit/proto/LabelVisibilityMessage_pb2.py +29 -0
- streamlit/proto/LabelVisibilityMessage_pb2.pyi +68 -0
- streamlit/proto/LinkButton_pb2.py +27 -0
- streamlit/proto/LinkButton_pb2.pyi +58 -0
- streamlit/proto/Logo_pb2.py +27 -0
- streamlit/proto/Logo_pb2.pyi +51 -0
- streamlit/proto/Markdown_pb2.py +29 -0
- streamlit/proto/Markdown_pb2.pyi +86 -0
- streamlit/proto/Metric_pb2.py +32 -0
- streamlit/proto/Metric_pb2.pyi +101 -0
- streamlit/proto/MetricsEvent_pb2.py +30 -0
- streamlit/proto/MetricsEvent_pb2.pyi +200 -0
- streamlit/proto/MultiSelect_pb2.py +28 -0
- streamlit/proto/MultiSelect_pb2.pyi +81 -0
- streamlit/proto/NamedDataSet_pb2.py +28 -0
- streamlit/proto/NamedDataSet_pb2.pyi +59 -0
- streamlit/proto/Navigation_pb2.py +30 -0
- streamlit/proto/Navigation_pb2.pyi +84 -0
- streamlit/proto/NewSession_pb2.py +51 -0
- streamlit/proto/NewSession_pb2.pyi +481 -0
- streamlit/proto/NumberInput_pb2.py +30 -0
- streamlit/proto/NumberInput_pb2.pyi +121 -0
- streamlit/proto/PageConfig_pb2.py +33 -0
- streamlit/proto/PageConfig_pb2.pyi +126 -0
- streamlit/proto/PageInfo_pb2.py +27 -0
- streamlit/proto/PageInfo_pb2.pyi +43 -0
- streamlit/proto/PageLink_pb2.py +27 -0
- streamlit/proto/PageLink_pb2.pyi +63 -0
- streamlit/proto/PageNotFound_pb2.py +27 -0
- streamlit/proto/PageNotFound_pb2.pyi +42 -0
- streamlit/proto/PageProfile_pb2.py +31 -0
- streamlit/proto/PageProfile_pb2.pyi +127 -0
- streamlit/proto/PagesChanged_pb2.py +28 -0
- streamlit/proto/PagesChanged_pb2.pyi +48 -0
- streamlit/proto/ParentMessage_pb2.py +27 -0
- streamlit/proto/ParentMessage_pb2.pyi +46 -0
- streamlit/proto/PlotlyChart_pb2.py +31 -0
- streamlit/proto/PlotlyChart_pb2.pyi +131 -0
- streamlit/proto/Progress_pb2.py +27 -0
- streamlit/proto/Progress_pb2.pyi +43 -0
- streamlit/proto/Radio_pb2.py +28 -0
- streamlit/proto/Radio_pb2.pyi +84 -0
- streamlit/proto/RootContainer_pb2.py +27 -0
- streamlit/proto/RootContainer_pb2.pyi +56 -0
- streamlit/proto/Selectbox_pb2.py +28 -0
- streamlit/proto/Selectbox_pb2.pyi +80 -0
- streamlit/proto/SessionEvent_pb2.py +28 -0
- streamlit/proto/SessionEvent_pb2.pyi +62 -0
- streamlit/proto/SessionStatus_pb2.py +27 -0
- streamlit/proto/SessionStatus_pb2.pyi +57 -0
- streamlit/proto/Skeleton_pb2.py +29 -0
- streamlit/proto/Skeleton_pb2.pyi +71 -0
- streamlit/proto/Slider_pb2.py +32 -0
- streamlit/proto/Slider_pb2.pyi +142 -0
- streamlit/proto/Snow_pb2.py +27 -0
- streamlit/proto/Snow_pb2.pyi +43 -0
- streamlit/proto/Spinner_pb2.py +27 -0
- streamlit/proto/Spinner_pb2.pyi +49 -0
- streamlit/proto/TextArea_pb2.py +28 -0
- streamlit/proto/TextArea_pb2.pyi +80 -0
- streamlit/proto/TextInput_pb2.py +30 -0
- streamlit/proto/TextInput_pb2.pyi +107 -0
- streamlit/proto/Text_pb2.py +27 -0
- streamlit/proto/Text_pb2.pyi +46 -0
- streamlit/proto/TimeInput_pb2.py +28 -0
- streamlit/proto/TimeInput_pb2.pyi +74 -0
- streamlit/proto/Toast_pb2.py +27 -0
- streamlit/proto/Toast_pb2.pyi +45 -0
- streamlit/proto/VegaLiteChart_pb2.py +29 -0
- streamlit/proto/VegaLiteChart_pb2.pyi +71 -0
- streamlit/proto/Video_pb2.py +31 -0
- streamlit/proto/Video_pb2.pyi +117 -0
- streamlit/proto/WidgetStates_pb2.py +31 -0
- streamlit/proto/WidgetStates_pb2.pyi +126 -0
- streamlit/proto/__init__.py +15 -0
- streamlit/proto/openmetrics_data_model_pb2.py +60 -0
- streamlit/proto/openmetrics_data_model_pb2.pyi +522 -0
- streamlit/py.typed +0 -0
- streamlit/runtime/__init__.py +50 -0
- streamlit/runtime/app_session.py +982 -0
- streamlit/runtime/caching/__init__.py +98 -0
- streamlit/runtime/caching/cache_data_api.py +665 -0
- streamlit/runtime/caching/cache_errors.py +142 -0
- streamlit/runtime/caching/cache_resource_api.py +527 -0
- streamlit/runtime/caching/cache_type.py +33 -0
- streamlit/runtime/caching/cache_utils.py +523 -0
- streamlit/runtime/caching/cached_message_replay.py +290 -0
- streamlit/runtime/caching/hashing.py +637 -0
- streamlit/runtime/caching/legacy_cache_api.py +169 -0
- streamlit/runtime/caching/storage/__init__.py +29 -0
- streamlit/runtime/caching/storage/cache_storage_protocol.py +239 -0
- streamlit/runtime/caching/storage/dummy_cache_storage.py +60 -0
- streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py +145 -0
- streamlit/runtime/caching/storage/local_disk_cache_storage.py +223 -0
- streamlit/runtime/connection_factory.py +436 -0
- streamlit/runtime/context.py +280 -0
- streamlit/runtime/credentials.py +364 -0
- streamlit/runtime/forward_msg_cache.py +296 -0
- streamlit/runtime/forward_msg_queue.py +240 -0
- streamlit/runtime/fragment.py +477 -0
- streamlit/runtime/media_file_manager.py +234 -0
- streamlit/runtime/media_file_storage.py +143 -0
- streamlit/runtime/memory_media_file_storage.py +181 -0
- streamlit/runtime/memory_session_storage.py +77 -0
- streamlit/runtime/memory_uploaded_file_manager.py +138 -0
- streamlit/runtime/metrics_util.py +486 -0
- streamlit/runtime/pages_manager.py +165 -0
- streamlit/runtime/runtime.py +792 -0
- streamlit/runtime/runtime_util.py +106 -0
- streamlit/runtime/script_data.py +46 -0
- streamlit/runtime/scriptrunner/__init__.py +38 -0
- streamlit/runtime/scriptrunner/exec_code.py +159 -0
- streamlit/runtime/scriptrunner/magic.py +273 -0
- streamlit/runtime/scriptrunner/magic_funcs.py +32 -0
- streamlit/runtime/scriptrunner/script_cache.py +89 -0
- streamlit/runtime/scriptrunner/script_runner.py +756 -0
- streamlit/runtime/scriptrunner_utils/__init__.py +19 -0
- streamlit/runtime/scriptrunner_utils/exceptions.py +48 -0
- streamlit/runtime/scriptrunner_utils/script_requests.py +307 -0
- streamlit/runtime/scriptrunner_utils/script_run_context.py +287 -0
- streamlit/runtime/secrets.py +534 -0
- streamlit/runtime/session_manager.py +394 -0
- streamlit/runtime/state/__init__.py +41 -0
- streamlit/runtime/state/common.py +191 -0
- streamlit/runtime/state/query_params.py +205 -0
- streamlit/runtime/state/query_params_proxy.py +218 -0
- streamlit/runtime/state/safe_session_state.py +138 -0
- streamlit/runtime/state/session_state.py +772 -0
- streamlit/runtime/state/session_state_proxy.py +153 -0
- streamlit/runtime/state/widgets.py +135 -0
- streamlit/runtime/stats.py +109 -0
- streamlit/runtime/uploaded_file_manager.py +148 -0
- streamlit/runtime/websocket_session_manager.py +167 -0
- streamlit/source_util.py +98 -0
- streamlit/static/favicon.png +0 -0
- streamlit/static/index.html +61 -0
- streamlit/static/static/css/index.Bmkmz40k.css +1 -0
- streamlit/static/static/css/index.DpJG_94W.css +1 -0
- streamlit/static/static/css/index.DzuxGC_t.css +1 -0
- streamlit/static/static/js/FileDownload.esm.Bp9m5jrx.js +1 -0
- streamlit/static/static/js/FileHelper.D_3pbilj.js +5 -0
- streamlit/static/static/js/FormClearHelper.Ct2rwLXo.js +1 -0
- streamlit/static/static/js/Hooks.BKdzj5MJ.js +1 -0
- streamlit/static/static/js/InputInstructions.DB3QGNJP.js +1 -0
- streamlit/static/static/js/ProgressBar.D40A5xc2.js +2 -0
- streamlit/static/static/js/RenderInPortalIfExists.DLUCooTN.js +1 -0
- streamlit/static/static/js/Toolbar.BiGGIQun.js +1 -0
- streamlit/static/static/js/UploadFileInfo.C-jY39rj.js +1 -0
- streamlit/static/static/js/base-input.CQBQT24M.js +4 -0
- streamlit/static/static/js/checkbox.Buj8gd_M.js +9 -0
- streamlit/static/static/js/createDownloadLinkElement.DZMwyjvU.js +1 -0
- streamlit/static/static/js/createSuper.CesK3I23.js +1 -0
- streamlit/static/static/js/data-grid-overlay-editor.B69OOFM4.js +1 -0
- streamlit/static/static/js/downloader.BZQhlBNT.js +1 -0
- streamlit/static/static/js/es6.D9Zhqujy.js +2 -0
- streamlit/static/static/js/iframeResizer.contentWindow.CAzcBpCC.js +1 -0
- streamlit/static/static/js/index.08vcOOvb.js +1 -0
- streamlit/static/static/js/index.0uqKfJUS.js +1 -0
- streamlit/static/static/js/index.B02M5u69.js +203 -0
- streamlit/static/static/js/index.B7mcZKMx.js +1 -0
- streamlit/static/static/js/index.BAQDHFA_.js +1 -0
- streamlit/static/static/js/index.BI60cMVr.js +2 -0
- streamlit/static/static/js/index.BLug2inK.js +1 -0
- streamlit/static/static/js/index.BM6TMY8g.js +2 -0
- streamlit/static/static/js/index.BZ9p1t7G.js +1 -0
- streamlit/static/static/js/index.BZqa87a1.js +2 -0
- streamlit/static/static/js/index.BcsRUzZZ.js +1 -0
- streamlit/static/static/js/index.BgVMiY_P.js +197 -0
- streamlit/static/static/js/index.BtuGy7By.js +6 -0
- streamlit/static/static/js/index.BuDuBmrs.js +1 -0
- streamlit/static/static/js/index.BvXU2oKV.js +1 -0
- streamlit/static/static/js/index.BxcwPacT.js +73 -0
- streamlit/static/static/js/index.CWX8KB81.js +1 -0
- streamlit/static/static/js/index.CXzZTo_q.js +1 -0
- streamlit/static/static/js/index.CcRWp_KL.js +1 -0
- streamlit/static/static/js/index.Cd-_xe55.js +3 -0
- streamlit/static/static/js/index.CdG2PXln.js +4537 -0
- streamlit/static/static/js/index.CjXvXmcP.js +1 -0
- streamlit/static/static/js/index.D1HZENZx.js +776 -0
- streamlit/static/static/js/index.D21Efo64.js +1617 -0
- streamlit/static/static/js/index.D9WgGVBx.js +7 -0
- streamlit/static/static/js/index.DEcsHtvb.js +12 -0
- streamlit/static/static/js/index.DFeMfr_K.js +1 -0
- streamlit/static/static/js/index.DHFBoItz.js +1 -0
- streamlit/static/static/js/index.D_PrBKnJ.js +3 -0
- streamlit/static/static/js/index.DmuRkekN.js +3855 -0
- streamlit/static/static/js/index.Do6eY8sf.js +1 -0
- streamlit/static/static/js/index.Dz3lP2P-.js +1 -0
- streamlit/static/static/js/index.Dz_UqF-s.js +1 -0
- streamlit/static/static/js/index.GkSUsPhJ.js +1 -0
- streamlit/static/static/js/index.H1U1IC_d.js +3 -0
- streamlit/static/static/js/index.g6p_4DPr.js +1 -0
- streamlit/static/static/js/index.g9x_GKss.js +1 -0
- streamlit/static/static/js/index.zo9jm08y.js +1 -0
- streamlit/static/static/js/input.DnaFglHq.js +2 -0
- streamlit/static/static/js/inputUtils.CQWz5UKz.js +1 -0
- streamlit/static/static/js/memory.Crb9x4-F.js +1 -0
- streamlit/static/static/js/mergeWith.ouAz0sK3.js +1 -0
- streamlit/static/static/js/number-overlay-editor._UaN-O48.js +9 -0
- streamlit/static/static/js/possibleConstructorReturn.CtGjGFHz.js +1 -0
- streamlit/static/static/js/sandbox.CBybYOhV.js +1 -0
- streamlit/static/static/js/sprintf.D7DtBTRn.js +1 -0
- streamlit/static/static/js/textarea.Cb_uJt5U.js +2 -0
- streamlit/static/static/js/threshold.DjX0wlsa.js +1 -0
- streamlit/static/static/js/timepicker.DKT7pfoF.js +4 -0
- streamlit/static/static/js/timer.CAwTRJ_g.js +1 -0
- streamlit/static/static/js/toConsumableArray.05Ikp13-.js +3 -0
- streamlit/static/static/js/uniqueId.D2FMWUEI.js +1 -0
- streamlit/static/static/js/useBasicWidgetState.urnZLANY.js +1 -0
- streamlit/static/static/js/useOnInputChange.BOKIIdJ1.js +1 -0
- streamlit/static/static/js/value.CgPGBV_l.js +1 -0
- streamlit/static/static/js/withFullScreenWrapper.C_N8J0Xx.js +1 -0
- streamlit/static/static/media/KaTeX_AMS-Regular.BQhdFMY1.woff2 +0 -0
- streamlit/static/static/media/KaTeX_AMS-Regular.DMm9YOAa.woff +0 -0
- streamlit/static/static/media/KaTeX_AMS-Regular.DRggAlZN.ttf +0 -0
- streamlit/static/static/media/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf +0 -0
- streamlit/static/static/media/KaTeX_Caligraphic-Bold.BEiXGLvX.woff +0 -0
- streamlit/static/static/media/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Caligraphic-Regular.CTRA-rTL.woff +0 -0
- streamlit/static/static/media/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Caligraphic-Regular.wX97UBjC.ttf +0 -0
- streamlit/static/static/media/KaTeX_Fraktur-Bold.BdnERNNW.ttf +0 -0
- streamlit/static/static/media/KaTeX_Fraktur-Bold.BsDP51OF.woff +0 -0
- streamlit/static/static/media/KaTeX_Fraktur-Bold.CL6g_b3V.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Fraktur-Regular.CB_wures.ttf +0 -0
- streamlit/static/static/media/KaTeX_Fraktur-Regular.CTYiF6lA.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Fraktur-Regular.Dxdc4cR9.woff +0 -0
- streamlit/static/static/media/KaTeX_Main-Bold.Cx986IdX.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Main-Bold.Jm3AIy58.woff +0 -0
- streamlit/static/static/media/KaTeX_Main-Bold.waoOVXN0.ttf +0 -0
- streamlit/static/static/media/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Main-BoldItalic.DzxPMmG6.ttf +0 -0
- streamlit/static/static/media/KaTeX_Main-BoldItalic.SpSLRI95.woff +0 -0
- streamlit/static/static/media/KaTeX_Main-Italic.3WenGoN9.ttf +0 -0
- streamlit/static/static/media/KaTeX_Main-Italic.BMLOBm91.woff +0 -0
- streamlit/static/static/media/KaTeX_Main-Italic.NWA7e6Wa.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Main-Regular.B22Nviop.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Main-Regular.Dr94JaBh.woff +0 -0
- streamlit/static/static/media/KaTeX_Main-Regular.ypZvNtVU.ttf +0 -0
- streamlit/static/static/media/KaTeX_Math-BoldItalic.B3XSjfu4.ttf +0 -0
- streamlit/static/static/media/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Math-BoldItalic.iY-2wyZ7.woff +0 -0
- streamlit/static/static/media/KaTeX_Math-Italic.DA0__PXp.woff +0 -0
- streamlit/static/static/media/KaTeX_Math-Italic.flOr_0UB.ttf +0 -0
- streamlit/static/static/media/KaTeX_Math-Italic.t53AETM-.woff2 +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Bold.CFMepnvq.ttf +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Bold.D1sUS0GD.woff2 +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Bold.DbIhKOiC.woff +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Italic.C3H0VqGB.woff2 +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Italic.DN2j7dab.woff +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Regular.BNo7hRIc.ttf +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Regular.CS6fqUqJ.woff +0 -0
- streamlit/static/static/media/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Script-Regular.C5JkGWo-.ttf +0 -0
- streamlit/static/static/media/KaTeX_Script-Regular.D3wIWfF6.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Script-Regular.D5yQViql.woff +0 -0
- streamlit/static/static/media/KaTeX_Size1-Regular.C195tn64.woff +0 -0
- streamlit/static/static/media/KaTeX_Size1-Regular.Dbsnue_I.ttf +0 -0
- streamlit/static/static/media/KaTeX_Size1-Regular.mCD8mA8B.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Size2-Regular.B7gKUWhC.ttf +0 -0
- streamlit/static/static/media/KaTeX_Size2-Regular.Dy4dx90m.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Size2-Regular.oD1tc_U0.woff +0 -0
- streamlit/static/static/media/KaTeX_Size3-Regular.CTq5MqoE.woff +0 -0
- streamlit/static/static/media/KaTeX_Size3-Regular.DgpXs0kz.ttf +0 -0
- streamlit/static/static/media/KaTeX_Size4-Regular.BF-4gkZK.woff +0 -0
- streamlit/static/static/media/KaTeX_Size4-Regular.DWFBv043.ttf +0 -0
- streamlit/static/static/media/KaTeX_Size4-Regular.Dl5lxZxV.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Typewriter-Regular.C0xS9mPB.woff +0 -0
- streamlit/static/static/media/KaTeX_Typewriter-Regular.CO6r4hn1.woff2 +0 -0
- streamlit/static/static/media/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf +0 -0
- streamlit/static/static/media/MaterialSymbols-Rounded.DcZbplWk.woff2 +0 -0
- 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/static/static/media/balloon-0.Czj7AKwE.png +0 -0
- streamlit/static/static/media/balloon-1.CNvFFrND.png +0 -0
- streamlit/static/static/media/balloon-2.DTvC6B1t.png +0 -0
- streamlit/static/static/media/balloon-3.CgSk4tbL.png +0 -0
- streamlit/static/static/media/balloon-4.mbtFrzxf.png +0 -0
- streamlit/static/static/media/balloon-5.CSwkUfRA.png +0 -0
- streamlit/static/static/media/fireworks.B4d-_KUe.gif +0 -0
- streamlit/static/static/media/flake-0.DgWaVvm5.png +0 -0
- streamlit/static/static/media/flake-1.B2r5AHMK.png +0 -0
- streamlit/static/static/media/flake-2.BnWSExPC.png +0 -0
- streamlit/static/static/media/snowflake.JU2jBHL8.svg +11 -0
- streamlit/string_util.py +203 -0
- streamlit/temporary_directory.py +56 -0
- streamlit/testing/__init__.py +13 -0
- streamlit/testing/v1/__init__.py +17 -0
- streamlit/testing/v1/app_test.py +1050 -0
- streamlit/testing/v1/element_tree.py +2083 -0
- streamlit/testing/v1/local_script_runner.py +180 -0
- streamlit/testing/v1/util.py +53 -0
- streamlit/time_util.py +75 -0
- streamlit/type_util.py +460 -0
- streamlit/url_util.py +122 -0
- streamlit/user_info.py +519 -0
- streamlit/util.py +72 -0
- streamlit/vendor/__init__.py +0 -0
- streamlit/vendor/pympler/__init__.py +0 -0
- streamlit/vendor/pympler/asizeof.py +2869 -0
- streamlit/version.py +18 -0
- streamlit/watcher/__init__.py +28 -0
- streamlit/watcher/event_based_path_watcher.py +406 -0
- streamlit/watcher/folder_black_list.py +82 -0
- streamlit/watcher/local_sources_watcher.py +233 -0
- streamlit/watcher/path_watcher.py +185 -0
- streamlit/watcher/polling_path_watcher.py +124 -0
- streamlit/watcher/util.py +207 -0
- streamlit/web/__init__.py +13 -0
- streamlit/web/bootstrap.py +353 -0
- streamlit/web/cache_storage_manager_config.py +38 -0
- streamlit/web/cli.py +369 -0
- streamlit/web/server/__init__.py +26 -0
- streamlit/web/server/app_static_file_handler.py +93 -0
- streamlit/web/server/authlib_tornado_integration.py +60 -0
- streamlit/web/server/browser_websocket_handler.py +246 -0
- streamlit/web/server/component_request_handler.py +116 -0
- streamlit/web/server/media_file_handler.py +141 -0
- streamlit/web/server/oauth_authlib_routes.py +176 -0
- streamlit/web/server/oidc_mixin.py +108 -0
- streamlit/web/server/routes.py +295 -0
- streamlit/web/server/server.py +479 -0
- streamlit/web/server/server_util.py +161 -0
- streamlit/web/server/stats_request_handler.py +95 -0
- streamlit/web/server/upload_file_request_handler.py +137 -0
- streamlit/web/server/websocket_headers.py +56 -0
- streamlit_nightly-1.43.2.dev20250307.data/scripts/streamlit.cmd +16 -0
- streamlit_nightly-1.43.2.dev20250307.dist-info/METADATA +207 -0
- streamlit_nightly-1.43.2.dev20250307.dist-info/RECORD +563 -0
- streamlit_nightly-1.43.2.dev20250307.dist-info/WHEEL +5 -0
- streamlit_nightly-1.43.2.dev20250307.dist-info/entry_points.txt +2 -0
- streamlit_nightly-1.43.2.dev20250307.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2188 @@
|
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
|
17
|
+
import datetime
|
18
|
+
from typing import TYPE_CHECKING, Literal, TypedDict
|
19
|
+
|
20
|
+
from typing_extensions import NotRequired, TypeAlias
|
21
|
+
|
22
|
+
from streamlit.runtime.metrics_util import gather_metrics
|
23
|
+
|
24
|
+
if TYPE_CHECKING:
|
25
|
+
from collections.abc import Iterable
|
26
|
+
|
27
|
+
NumberFormat: TypeAlias = Literal[
|
28
|
+
"plain",
|
29
|
+
"localized",
|
30
|
+
"dollar",
|
31
|
+
"euro",
|
32
|
+
"percent",
|
33
|
+
"compact",
|
34
|
+
"scientific",
|
35
|
+
"engineering",
|
36
|
+
"accounting",
|
37
|
+
]
|
38
|
+
|
39
|
+
ColumnWidth: TypeAlias = Literal["small", "medium", "large"]
|
40
|
+
|
41
|
+
# Type alias that represents all available column types
|
42
|
+
# which are configurable by the user.
|
43
|
+
ColumnType: TypeAlias = Literal[
|
44
|
+
"object",
|
45
|
+
"text",
|
46
|
+
"number",
|
47
|
+
"checkbox",
|
48
|
+
"selectbox",
|
49
|
+
"list",
|
50
|
+
"datetime",
|
51
|
+
"date",
|
52
|
+
"time",
|
53
|
+
"link",
|
54
|
+
"line_chart",
|
55
|
+
"bar_chart",
|
56
|
+
"area_chart",
|
57
|
+
"image",
|
58
|
+
"progress",
|
59
|
+
"json",
|
60
|
+
]
|
61
|
+
|
62
|
+
|
63
|
+
class NumberColumnConfig(TypedDict):
|
64
|
+
type: Literal["number"]
|
65
|
+
format: NotRequired[str | NumberFormat | None]
|
66
|
+
min_value: NotRequired[int | float | None]
|
67
|
+
max_value: NotRequired[int | float | None]
|
68
|
+
step: NotRequired[int | float | None]
|
69
|
+
|
70
|
+
|
71
|
+
class TextColumnConfig(TypedDict):
|
72
|
+
type: Literal["text"]
|
73
|
+
max_chars: NotRequired[int | None]
|
74
|
+
validate: NotRequired[str | None]
|
75
|
+
|
76
|
+
|
77
|
+
class CheckboxColumnConfig(TypedDict):
|
78
|
+
type: Literal["checkbox"]
|
79
|
+
|
80
|
+
|
81
|
+
class SelectboxColumnConfig(TypedDict):
|
82
|
+
type: Literal["selectbox"]
|
83
|
+
options: NotRequired[list[str | int | float] | None]
|
84
|
+
|
85
|
+
|
86
|
+
class LinkColumnConfig(TypedDict):
|
87
|
+
type: Literal["link"]
|
88
|
+
max_chars: NotRequired[int | None]
|
89
|
+
validate: NotRequired[str | None]
|
90
|
+
display_text: NotRequired[str | None]
|
91
|
+
|
92
|
+
|
93
|
+
class BarChartColumnConfig(TypedDict):
|
94
|
+
type: Literal["bar_chart"]
|
95
|
+
y_min: NotRequired[int | float | None]
|
96
|
+
y_max: NotRequired[int | float | None]
|
97
|
+
|
98
|
+
|
99
|
+
class LineChartColumnConfig(TypedDict):
|
100
|
+
type: Literal["line_chart"]
|
101
|
+
y_min: NotRequired[int | float | None]
|
102
|
+
y_max: NotRequired[int | float | None]
|
103
|
+
|
104
|
+
|
105
|
+
class AreaChartColumnConfig(TypedDict):
|
106
|
+
type: Literal["area_chart"]
|
107
|
+
y_min: NotRequired[int | float | None]
|
108
|
+
y_max: NotRequired[int | float | None]
|
109
|
+
|
110
|
+
|
111
|
+
class ImageColumnConfig(TypedDict):
|
112
|
+
type: Literal["image"]
|
113
|
+
|
114
|
+
|
115
|
+
class ListColumnConfig(TypedDict):
|
116
|
+
type: Literal["list"]
|
117
|
+
|
118
|
+
|
119
|
+
class DatetimeColumnConfig(TypedDict):
|
120
|
+
type: Literal["datetime"]
|
121
|
+
format: NotRequired[
|
122
|
+
str | Literal["localized", "distance", "calendar", "iso8601"] | None
|
123
|
+
]
|
124
|
+
min_value: NotRequired[str | None]
|
125
|
+
max_value: NotRequired[str | None]
|
126
|
+
step: NotRequired[int | float | None]
|
127
|
+
timezone: NotRequired[str | None]
|
128
|
+
|
129
|
+
|
130
|
+
class TimeColumnConfig(TypedDict):
|
131
|
+
type: Literal["time"]
|
132
|
+
format: NotRequired[str | Literal["localized", "iso8601"] | None]
|
133
|
+
min_value: NotRequired[str | None]
|
134
|
+
max_value: NotRequired[str | None]
|
135
|
+
step: NotRequired[int | float | None]
|
136
|
+
|
137
|
+
|
138
|
+
class DateColumnConfig(TypedDict):
|
139
|
+
type: Literal["date"]
|
140
|
+
format: NotRequired[str | Literal["localized", "distance", "iso8601"] | None]
|
141
|
+
min_value: NotRequired[str | None]
|
142
|
+
max_value: NotRequired[str | None]
|
143
|
+
step: NotRequired[int | None]
|
144
|
+
|
145
|
+
|
146
|
+
class ProgressColumnConfig(TypedDict):
|
147
|
+
type: Literal["progress"]
|
148
|
+
format: NotRequired[str | NumberFormat | None]
|
149
|
+
min_value: NotRequired[int | float | None]
|
150
|
+
max_value: NotRequired[int | float | None]
|
151
|
+
|
152
|
+
|
153
|
+
class JsonColumnConfig(TypedDict):
|
154
|
+
type: Literal["json"]
|
155
|
+
|
156
|
+
|
157
|
+
class ColumnConfig(TypedDict, total=False):
|
158
|
+
"""Configuration options for columns in ``st.dataframe`` and ``st.data_editor``.
|
159
|
+
|
160
|
+
Parameters
|
161
|
+
----------
|
162
|
+
|
163
|
+
label: str or None
|
164
|
+
The label shown at the top of the column. If this is ``None``
|
165
|
+
(default), the column name is used.
|
166
|
+
|
167
|
+
width: "small", "medium", "large", or None
|
168
|
+
The display width of the column. If this is ``None`` (default), the
|
169
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
170
|
+
one of the following:
|
171
|
+
|
172
|
+
- ``"small"``: 75px wide
|
173
|
+
- ``"medium"``: 200px wide
|
174
|
+
- ``"large"``: 400px wide
|
175
|
+
|
176
|
+
help: str or None
|
177
|
+
A tooltip that gets displayed when hovering over the column label. If
|
178
|
+
this is ``None`` (default), no tooltip is displayed.
|
179
|
+
|
180
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
181
|
+
the Markdown directives described in the ``body`` parameter of
|
182
|
+
``st.markdown``.
|
183
|
+
|
184
|
+
disabled: bool or None
|
185
|
+
Whether editing should be disabled for this column. If this is ``None``
|
186
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
187
|
+
are not.
|
188
|
+
|
189
|
+
If a column has mixed types, it may become uneditable regardless of
|
190
|
+
``disabled``.
|
191
|
+
|
192
|
+
required: bool or None
|
193
|
+
Whether edited cells in the column need to have a value. If this is
|
194
|
+
``False`` (default), the user can submit empty values for this column.
|
195
|
+
If this is ``True``, an edited cell in this column can only be
|
196
|
+
submitted if its value is not ``None``, and a new row will only be
|
197
|
+
submitted after the user fills in this column.
|
198
|
+
|
199
|
+
pinned: bool or None
|
200
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
201
|
+
left side no matter where the user scrolls. If this is ``None``
|
202
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
203
|
+
columns are not pinned.
|
204
|
+
|
205
|
+
default: str, bool, int, float, or None
|
206
|
+
Specifies the default value in this column when a new row is added by
|
207
|
+
the user. This defaults to ``None``.
|
208
|
+
|
209
|
+
hidden: bool or None
|
210
|
+
Whether to hide the column. This defaults to ``False``.
|
211
|
+
|
212
|
+
type_config: dict or str or None
|
213
|
+
Configure a column type and type specific options.
|
214
|
+
"""
|
215
|
+
|
216
|
+
label: str | None
|
217
|
+
width: ColumnWidth | None
|
218
|
+
help: str | None
|
219
|
+
hidden: bool | None
|
220
|
+
disabled: bool | None
|
221
|
+
required: bool | None
|
222
|
+
pinned: bool | None
|
223
|
+
default: str | bool | int | float | None
|
224
|
+
alignment: Literal["left", "center", "right"] | None
|
225
|
+
type_config: (
|
226
|
+
NumberColumnConfig
|
227
|
+
| TextColumnConfig
|
228
|
+
| CheckboxColumnConfig
|
229
|
+
| SelectboxColumnConfig
|
230
|
+
| LinkColumnConfig
|
231
|
+
| ListColumnConfig
|
232
|
+
| DatetimeColumnConfig
|
233
|
+
| DateColumnConfig
|
234
|
+
| TimeColumnConfig
|
235
|
+
| ProgressColumnConfig
|
236
|
+
| LineChartColumnConfig
|
237
|
+
| BarChartColumnConfig
|
238
|
+
| AreaChartColumnConfig
|
239
|
+
| ImageColumnConfig
|
240
|
+
| JsonColumnConfig
|
241
|
+
| None
|
242
|
+
)
|
243
|
+
|
244
|
+
|
245
|
+
@gather_metrics("column_config.Column")
|
246
|
+
def Column(
|
247
|
+
label: str | None = None,
|
248
|
+
*,
|
249
|
+
width: ColumnWidth | None = None,
|
250
|
+
help: str | None = None,
|
251
|
+
disabled: bool | None = None,
|
252
|
+
required: bool | None = None,
|
253
|
+
pinned: bool | None = None,
|
254
|
+
) -> ColumnConfig:
|
255
|
+
"""Configure a generic column in ``st.dataframe`` or ``st.data_editor``.
|
256
|
+
|
257
|
+
The type of the column will be automatically inferred from the data type.
|
258
|
+
This command needs to be used in the ``column_config`` parameter of ``st.dataframe``
|
259
|
+
or ``st.data_editor``.
|
260
|
+
|
261
|
+
To change the type of the column and enable type-specific configuration options,
|
262
|
+
use one of the column types in the ``st.column_config`` namespace,
|
263
|
+
e.g. ``st.column_config.NumberColumn``.
|
264
|
+
|
265
|
+
Parameters
|
266
|
+
----------
|
267
|
+
|
268
|
+
label: str or None
|
269
|
+
The label shown at the top of the column. If this is ``None``
|
270
|
+
(default), the column name is used.
|
271
|
+
|
272
|
+
width: "small", "medium", "large", or None
|
273
|
+
The display width of the column. If this is ``None`` (default), the
|
274
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
275
|
+
one of the following:
|
276
|
+
|
277
|
+
- ``"small"``: 75px wide
|
278
|
+
- ``"medium"``: 200px wide
|
279
|
+
- ``"large"``: 400px wide
|
280
|
+
|
281
|
+
help: str or None
|
282
|
+
A tooltip that gets displayed when hovering over the column label. If
|
283
|
+
this is ``None`` (default), no tooltip is displayed.
|
284
|
+
|
285
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
286
|
+
the Markdown directives described in the ``body`` parameter of
|
287
|
+
``st.markdown``.
|
288
|
+
|
289
|
+
disabled: bool or None
|
290
|
+
Whether editing should be disabled for this column. If this is ``None``
|
291
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
292
|
+
are not.
|
293
|
+
|
294
|
+
If a column has mixed types, it may become uneditable regardless of
|
295
|
+
``disabled``.
|
296
|
+
|
297
|
+
required: bool or None
|
298
|
+
Whether edited cells in the column need to have a value. If this is
|
299
|
+
``False`` (default), the user can submit empty values for this column.
|
300
|
+
If this is ``True``, an edited cell in this column can only be
|
301
|
+
submitted if its value is not ``None``, and a new row will only be
|
302
|
+
submitted after the user fills in this column.
|
303
|
+
|
304
|
+
pinned: bool or None
|
305
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
306
|
+
left side no matter where the user scrolls. If this is ``None``
|
307
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
308
|
+
columns are not pinned.
|
309
|
+
|
310
|
+
Examples
|
311
|
+
--------
|
312
|
+
|
313
|
+
>>> import pandas as pd
|
314
|
+
>>> import streamlit as st
|
315
|
+
>>>
|
316
|
+
>>> data_df = pd.DataFrame(
|
317
|
+
>>> {
|
318
|
+
>>> "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],
|
319
|
+
>>> }
|
320
|
+
>>> )
|
321
|
+
>>>
|
322
|
+
>>> st.data_editor(
|
323
|
+
>>> data_df,
|
324
|
+
>>> column_config={
|
325
|
+
>>> "widgets": st.column_config.Column(
|
326
|
+
>>> "Streamlit Widgets",
|
327
|
+
>>> help="Streamlit **widget** commands 🎈",
|
328
|
+
>>> width="medium",
|
329
|
+
>>> required=True,
|
330
|
+
>>> )
|
331
|
+
>>> },
|
332
|
+
>>> hide_index=True,
|
333
|
+
>>> num_rows="dynamic",
|
334
|
+
>>> )
|
335
|
+
|
336
|
+
.. output::
|
337
|
+
https://doc-column.streamlit.app/
|
338
|
+
height: 300px
|
339
|
+
"""
|
340
|
+
return ColumnConfig(
|
341
|
+
label=label,
|
342
|
+
width=width,
|
343
|
+
help=help,
|
344
|
+
disabled=disabled,
|
345
|
+
required=required,
|
346
|
+
pinned=pinned,
|
347
|
+
)
|
348
|
+
|
349
|
+
|
350
|
+
@gather_metrics("column_config.NumberColumn")
|
351
|
+
def NumberColumn(
|
352
|
+
label: str | None = None,
|
353
|
+
*,
|
354
|
+
width: ColumnWidth | None = None,
|
355
|
+
help: str | None = None,
|
356
|
+
disabled: bool | None = None,
|
357
|
+
required: bool | None = None,
|
358
|
+
pinned: bool | None = None,
|
359
|
+
default: int | float | None = None,
|
360
|
+
format: str | NumberFormat | None = None,
|
361
|
+
min_value: int | float | None = None,
|
362
|
+
max_value: int | float | None = None,
|
363
|
+
step: int | float | None = None,
|
364
|
+
) -> ColumnConfig:
|
365
|
+
"""Configure a number column in ``st.dataframe`` or ``st.data_editor``.
|
366
|
+
|
367
|
+
This is the default column type for integer and float values. This command needs to
|
368
|
+
be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``.
|
369
|
+
When used with ``st.data_editor``, editing will be enabled with a numeric input widget.
|
370
|
+
|
371
|
+
Parameters
|
372
|
+
----------
|
373
|
+
|
374
|
+
label: str or None
|
375
|
+
The label shown at the top of the column. If this is ``None``
|
376
|
+
(default), the column name is used.
|
377
|
+
|
378
|
+
width: "small", "medium", "large", or None
|
379
|
+
The display width of the column. If this is ``None`` (default), the
|
380
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
381
|
+
one of the following:
|
382
|
+
|
383
|
+
- ``"small"``: 75px wide
|
384
|
+
- ``"medium"``: 200px wide
|
385
|
+
- ``"large"``: 400px wide
|
386
|
+
|
387
|
+
help: str or None
|
388
|
+
A tooltip that gets displayed when hovering over the column label. If
|
389
|
+
this is ``None`` (default), no tooltip is displayed.
|
390
|
+
|
391
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
392
|
+
the Markdown directives described in the ``body`` parameter of
|
393
|
+
``st.markdown``.
|
394
|
+
|
395
|
+
disabled: bool or None
|
396
|
+
Whether editing should be disabled for this column. If this is ``None``
|
397
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
398
|
+
are not.
|
399
|
+
|
400
|
+
If a column has mixed types, it may become uneditable regardless of
|
401
|
+
``disabled``.
|
402
|
+
|
403
|
+
required: bool or None
|
404
|
+
Whether edited cells in the column need to have a value. If this is
|
405
|
+
``False`` (default), the user can submit empty values for this column.
|
406
|
+
If this is ``True``, an edited cell in this column can only be
|
407
|
+
submitted if its value is not ``None``, and a new row will only be
|
408
|
+
submitted after the user fills in this column.
|
409
|
+
|
410
|
+
pinned: bool or None
|
411
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
412
|
+
left side no matter where the user scrolls. If this is ``None``
|
413
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
414
|
+
columns are not pinned.
|
415
|
+
|
416
|
+
default: int, float, or None
|
417
|
+
Specifies the default value in this column when a new row is added by
|
418
|
+
the user. This defaults to ``None``.
|
419
|
+
|
420
|
+
format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
|
421
|
+
A format string controlling how numbers are displayed.
|
422
|
+
This can be one of the following values:
|
423
|
+
|
424
|
+
- ``None`` (default): Streamlit infers the formatting from the data.
|
425
|
+
- ``"plain"``: Show the full number without any formatting (e.g. "1234.567").
|
426
|
+
- ``"localized"``: Show the number in the default locale format (e.g. "1,234.567").
|
427
|
+
- ``"percent"``: Show the number as a percentage (e.g. "123456.70%").
|
428
|
+
- ``"dollar"``: Show the number as a dollar amount (e.g. "$1,234.57").
|
429
|
+
- ``"euro"``: Show the number as a euro amount (e.g. "€1,234.57").
|
430
|
+
- ``"accounting"``: Show the number in an accounting format (e.g. "1,234.00").
|
431
|
+
- ``"compact"``: Show the number in a compact format (e.g. "1.2K").
|
432
|
+
- ``"scientific"``: Show the number in scientific notation (e.g. "1.235E3").
|
433
|
+
- ``"engineering"``: Show the number in engineering notation (e.g. "1.235E3").
|
434
|
+
- printf-style format string: Format the number with a printf
|
435
|
+
specifier, like ``"%d"`` to show a signed integer (e.g. "1234") or
|
436
|
+
``"%X"`` to show an unsigned hexidecimal integer (e.g. "4D2"). You
|
437
|
+
can also add prefixes and suffixes. To show British pounds, use
|
438
|
+
``"£ %.2f"`` (e.g. "£ 1234.57"). For more information, see `sprint-js
|
439
|
+
<https://github.com/alexei/sprintf.js?tab=readme-ov-file#format-specification>`_.
|
440
|
+
|
441
|
+
Formatting from ``column_config`` always takes precedence over
|
442
|
+
formatting from ``pandas.Styler``. The formatting does not impact the
|
443
|
+
return value when used in ``st.data_editor``.
|
444
|
+
|
445
|
+
min_value: int, float, or None
|
446
|
+
The minimum value that can be entered. If this is ``None`` (default),
|
447
|
+
there will be no minimum.
|
448
|
+
|
449
|
+
max_value: int, float, or None
|
450
|
+
The maximum value that can be entered. If this is ``None`` (default),
|
451
|
+
there will be no maximum.
|
452
|
+
|
453
|
+
step: int, float, or None
|
454
|
+
The precision of numbers that can be entered. If this ``None``
|
455
|
+
(default), integer columns will have a step of 1 and float columns will
|
456
|
+
have unrestricted precision. In this case, some floats may display like
|
457
|
+
integers. Setting ``step`` for float columns will ensure a consistent
|
458
|
+
number of digits after the decimal even without setting ``format``.
|
459
|
+
|
460
|
+
Examples
|
461
|
+
--------
|
462
|
+
|
463
|
+
>>> import pandas as pd
|
464
|
+
>>> import streamlit as st
|
465
|
+
>>>
|
466
|
+
>>> data_df = pd.DataFrame(
|
467
|
+
>>> {
|
468
|
+
>>> "price": [20, 950, 250, 500],
|
469
|
+
>>> }
|
470
|
+
>>> )
|
471
|
+
>>>
|
472
|
+
>>> st.data_editor(
|
473
|
+
>>> data_df,
|
474
|
+
>>> column_config={
|
475
|
+
>>> "price": st.column_config.NumberColumn(
|
476
|
+
>>> "Price (in USD)",
|
477
|
+
>>> help="The price of the product in USD",
|
478
|
+
>>> min_value=0,
|
479
|
+
>>> max_value=1000,
|
480
|
+
>>> step=1,
|
481
|
+
>>> format="$%d",
|
482
|
+
>>> )
|
483
|
+
>>> },
|
484
|
+
>>> hide_index=True,
|
485
|
+
>>> )
|
486
|
+
|
487
|
+
.. output::
|
488
|
+
https://doc-number-column.streamlit.app/
|
489
|
+
height: 300px
|
490
|
+
"""
|
491
|
+
|
492
|
+
return ColumnConfig(
|
493
|
+
label=label,
|
494
|
+
width=width,
|
495
|
+
help=help,
|
496
|
+
disabled=disabled,
|
497
|
+
required=required,
|
498
|
+
pinned=pinned,
|
499
|
+
default=default,
|
500
|
+
type_config=NumberColumnConfig(
|
501
|
+
type="number",
|
502
|
+
min_value=min_value,
|
503
|
+
max_value=max_value,
|
504
|
+
format=format,
|
505
|
+
step=step,
|
506
|
+
),
|
507
|
+
)
|
508
|
+
|
509
|
+
|
510
|
+
@gather_metrics("column_config.TextColumn")
|
511
|
+
def TextColumn(
|
512
|
+
label: str | None = None,
|
513
|
+
*,
|
514
|
+
width: ColumnWidth | None = None,
|
515
|
+
help: str | None = None,
|
516
|
+
disabled: bool | None = None,
|
517
|
+
required: bool | None = None,
|
518
|
+
pinned: bool | None = None,
|
519
|
+
default: str | None = None,
|
520
|
+
max_chars: int | None = None,
|
521
|
+
validate: str | None = None,
|
522
|
+
) -> ColumnConfig:
|
523
|
+
r"""Configure a text column in ``st.dataframe`` or ``st.data_editor``.
|
524
|
+
|
525
|
+
This is the default column type for string values. This command needs to be used in the
|
526
|
+
``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used with
|
527
|
+
``st.data_editor``, editing will be enabled with a text input widget.
|
528
|
+
|
529
|
+
Parameters
|
530
|
+
----------
|
531
|
+
|
532
|
+
label: str or None
|
533
|
+
The label shown at the top of the column. If this is ``None``
|
534
|
+
(default), the column name is used.
|
535
|
+
|
536
|
+
width: "small", "medium", "large", or None
|
537
|
+
The display width of the column. If this is ``None`` (default), the
|
538
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
539
|
+
one of the following:
|
540
|
+
|
541
|
+
- ``"small"``: 75px wide
|
542
|
+
- ``"medium"``: 200px wide
|
543
|
+
- ``"large"``: 400px wide
|
544
|
+
|
545
|
+
help: str or None
|
546
|
+
A tooltip that gets displayed when hovering over the column label. If
|
547
|
+
this is ``None`` (default), no tooltip is displayed.
|
548
|
+
|
549
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
550
|
+
the Markdown directives described in the ``body`` parameter of
|
551
|
+
``st.markdown``.
|
552
|
+
|
553
|
+
disabled: bool or None
|
554
|
+
Whether editing should be disabled for this column. If this is ``None``
|
555
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
556
|
+
are not.
|
557
|
+
|
558
|
+
If a column has mixed types, it may become uneditable regardless of
|
559
|
+
``disabled``.
|
560
|
+
|
561
|
+
required: bool or None
|
562
|
+
Whether edited cells in the column need to have a value. If this is
|
563
|
+
``False`` (default), the user can submit empty values for this column.
|
564
|
+
If this is ``True``, an edited cell in this column can only be
|
565
|
+
submitted if its value is not ``None``, and a new row will only be
|
566
|
+
submitted after the user fills in this column.
|
567
|
+
|
568
|
+
pinned: bool or None
|
569
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
570
|
+
left side no matter where the user scrolls. If this is ``None``
|
571
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
572
|
+
columns are not pinned.
|
573
|
+
|
574
|
+
default: str or None
|
575
|
+
Specifies the default value in this column when a new row is added by
|
576
|
+
the user. This defaults to ``None``.
|
577
|
+
|
578
|
+
max_chars: int or None
|
579
|
+
The maximum number of characters that can be entered. If this is
|
580
|
+
``None`` (default), there will be no maximum.
|
581
|
+
|
582
|
+
validate: str or None
|
583
|
+
A JS-flavored regular expression (e.g. ``"^[a-z]+$"``) that edited
|
584
|
+
values are validated against. If the user input is invalid, it will not
|
585
|
+
be submitted.
|
586
|
+
|
587
|
+
Examples
|
588
|
+
--------
|
589
|
+
|
590
|
+
>>> import pandas as pd
|
591
|
+
>>> import streamlit as st
|
592
|
+
>>>
|
593
|
+
>>> data_df = pd.DataFrame(
|
594
|
+
>>> {
|
595
|
+
>>> "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],
|
596
|
+
>>> }
|
597
|
+
>>> )
|
598
|
+
>>>
|
599
|
+
>>> st.data_editor(
|
600
|
+
>>> data_df,
|
601
|
+
>>> column_config={
|
602
|
+
>>> "widgets": st.column_config.TextColumn(
|
603
|
+
>>> "Widgets",
|
604
|
+
>>> help="Streamlit **widget** commands 🎈",
|
605
|
+
>>> default="st.",
|
606
|
+
>>> max_chars=50,
|
607
|
+
>>> validate=r"^st\.[a-z_]+$",
|
608
|
+
>>> )
|
609
|
+
>>> },
|
610
|
+
>>> hide_index=True,
|
611
|
+
>>> )
|
612
|
+
|
613
|
+
.. output::
|
614
|
+
https://doc-text-column.streamlit.app/
|
615
|
+
height: 300px
|
616
|
+
"""
|
617
|
+
|
618
|
+
return ColumnConfig(
|
619
|
+
label=label,
|
620
|
+
width=width,
|
621
|
+
help=help,
|
622
|
+
disabled=disabled,
|
623
|
+
required=required,
|
624
|
+
pinned=pinned,
|
625
|
+
default=default,
|
626
|
+
type_config=TextColumnConfig(
|
627
|
+
type="text", max_chars=max_chars, validate=validate
|
628
|
+
),
|
629
|
+
)
|
630
|
+
|
631
|
+
|
632
|
+
@gather_metrics("column_config.LinkColumn")
|
633
|
+
def LinkColumn(
|
634
|
+
label: str | None = None,
|
635
|
+
*,
|
636
|
+
width: ColumnWidth | None = None,
|
637
|
+
help: str | None = None,
|
638
|
+
disabled: bool | None = None,
|
639
|
+
required: bool | None = None,
|
640
|
+
pinned: bool | None = None,
|
641
|
+
default: str | None = None,
|
642
|
+
max_chars: int | None = None,
|
643
|
+
validate: str | None = None,
|
644
|
+
display_text: str | None = None,
|
645
|
+
) -> ColumnConfig:
|
646
|
+
"""Configure a link column in ``st.dataframe`` or ``st.data_editor``.
|
647
|
+
|
648
|
+
The cell values need to be string and will be shown as clickable links.
|
649
|
+
This command needs to be used in the column_config parameter of ``st.dataframe``
|
650
|
+
or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled
|
651
|
+
with a text input widget.
|
652
|
+
|
653
|
+
Parameters
|
654
|
+
----------
|
655
|
+
|
656
|
+
label: str or None
|
657
|
+
The label shown at the top of the column. If this is ``None``
|
658
|
+
(default), the column name is used.
|
659
|
+
|
660
|
+
width: "small", "medium", "large", or None
|
661
|
+
The display width of the column. If this is ``None`` (default), the
|
662
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
663
|
+
one of the following:
|
664
|
+
|
665
|
+
- ``"small"``: 75px wide
|
666
|
+
- ``"medium"``: 200px wide
|
667
|
+
- ``"large"``: 400px wide
|
668
|
+
|
669
|
+
help: str or None
|
670
|
+
A tooltip that gets displayed when hovering over the column label. If
|
671
|
+
this is ``None`` (default), no tooltip is displayed.
|
672
|
+
|
673
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
674
|
+
the Markdown directives described in the ``body`` parameter of
|
675
|
+
``st.markdown``.
|
676
|
+
|
677
|
+
disabled: bool or None
|
678
|
+
Whether editing should be disabled for this column. If this is ``None``
|
679
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
680
|
+
are not.
|
681
|
+
|
682
|
+
If a column has mixed types, it may become uneditable regardless of
|
683
|
+
``disabled``.
|
684
|
+
|
685
|
+
required: bool or None
|
686
|
+
Whether edited cells in the column need to have a value. If this is
|
687
|
+
``False`` (default), the user can submit empty values for this column.
|
688
|
+
If this is ``True``, an edited cell in this column can only be
|
689
|
+
submitted if its value is not ``None``, and a new row will only be
|
690
|
+
submitted after the user fills in this column.
|
691
|
+
|
692
|
+
pinned: bool or None
|
693
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
694
|
+
left side no matter where the user scrolls. If this is ``None``
|
695
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
696
|
+
columns are not pinned.
|
697
|
+
|
698
|
+
default: str or None
|
699
|
+
Specifies the default value in this column when a new row is added by
|
700
|
+
the user. This defaults to ``None``.
|
701
|
+
|
702
|
+
max_chars: int or None
|
703
|
+
The maximum number of characters that can be entered. If this is
|
704
|
+
``None`` (default), there will be no maximum.
|
705
|
+
|
706
|
+
validate: str or None
|
707
|
+
A JS-flavored regular expression (e.g. ``"^https://.+$"``) that edited
|
708
|
+
values are validated against. If the user input is invalid, it will not
|
709
|
+
be submitted.
|
710
|
+
|
711
|
+
display_text: str or None
|
712
|
+
The text that is displayed in the cell. This can be one of the
|
713
|
+
following:
|
714
|
+
|
715
|
+
- ``None`` (default) to display the URL itself.
|
716
|
+
- A string that is displayed in every cell, e.g. ``"Open link"``.
|
717
|
+
- A JS-flavored regular expression (detected by usage of parentheses)
|
718
|
+
to extract a part of the URL via a capture group. For example, use
|
719
|
+
``"https://(.*?)\\.example\\.com"`` to extract the display text
|
720
|
+
"foo" from the URL "\\https://foo.example.com".
|
721
|
+
|
722
|
+
.. Comment: The backslash in front of foo.example.com prevents a hyperlink in docs.
|
723
|
+
|
724
|
+
For more complex cases, you may use `Pandas Styler's format \
|
725
|
+
<https://pandas.pydata.org/docs/reference/api/pandas.io.formats.style.Styler.format.html>`_
|
726
|
+
function on the underlying dataframe. Note that this makes the app slow,
|
727
|
+
doesn't work with editable columns, and might be removed in the future.
|
728
|
+
Text formatting from ``column_config`` always takes precedence over
|
729
|
+
text formatting from ``pandas.Styler``.
|
730
|
+
|
731
|
+
Examples
|
732
|
+
--------
|
733
|
+
|
734
|
+
>>> import pandas as pd
|
735
|
+
>>> import streamlit as st
|
736
|
+
>>>
|
737
|
+
>>> data_df = pd.DataFrame(
|
738
|
+
>>> {
|
739
|
+
>>> "apps": [
|
740
|
+
>>> "https://roadmap.streamlit.app",
|
741
|
+
>>> "https://extras.streamlit.app",
|
742
|
+
>>> "https://issues.streamlit.app",
|
743
|
+
>>> "https://30days.streamlit.app",
|
744
|
+
>>> ],
|
745
|
+
>>> "creator": [
|
746
|
+
>>> "https://github.com/streamlit",
|
747
|
+
>>> "https://github.com/arnaudmiribel",
|
748
|
+
>>> "https://github.com/streamlit",
|
749
|
+
>>> "https://github.com/streamlit",
|
750
|
+
>>> ],
|
751
|
+
>>> }
|
752
|
+
>>> )
|
753
|
+
>>>
|
754
|
+
>>> st.data_editor(
|
755
|
+
>>> data_df,
|
756
|
+
>>> column_config={
|
757
|
+
>>> "apps": st.column_config.LinkColumn(
|
758
|
+
>>> "Trending apps",
|
759
|
+
>>> help="The top trending Streamlit apps",
|
760
|
+
>>> validate=r"^https://[a-z]+\\.streamlit\\.app$",
|
761
|
+
>>> max_chars=100,
|
762
|
+
>>> display_text=r"https://(.*?)\\.streamlit\\.app"
|
763
|
+
>>> ),
|
764
|
+
>>> "creator": st.column_config.LinkColumn(
|
765
|
+
>>> "App Creator", display_text="Open profile"
|
766
|
+
>>> ),
|
767
|
+
>>> },
|
768
|
+
>>> hide_index=True,
|
769
|
+
>>> )
|
770
|
+
|
771
|
+
.. output::
|
772
|
+
https://doc-link-column.streamlit.app/
|
773
|
+
height: 300px
|
774
|
+
"""
|
775
|
+
|
776
|
+
return ColumnConfig(
|
777
|
+
label=label,
|
778
|
+
width=width,
|
779
|
+
help=help,
|
780
|
+
disabled=disabled,
|
781
|
+
required=required,
|
782
|
+
pinned=pinned,
|
783
|
+
default=default,
|
784
|
+
type_config=LinkColumnConfig(
|
785
|
+
type="link",
|
786
|
+
max_chars=max_chars,
|
787
|
+
validate=validate,
|
788
|
+
display_text=display_text,
|
789
|
+
),
|
790
|
+
)
|
791
|
+
|
792
|
+
|
793
|
+
@gather_metrics("column_config.CheckboxColumn")
|
794
|
+
def CheckboxColumn(
|
795
|
+
label: str | None = None,
|
796
|
+
*,
|
797
|
+
width: ColumnWidth | None = None,
|
798
|
+
help: str | None = None,
|
799
|
+
disabled: bool | None = None,
|
800
|
+
required: bool | None = None,
|
801
|
+
pinned: bool | None = None,
|
802
|
+
default: bool | None = None,
|
803
|
+
) -> ColumnConfig:
|
804
|
+
"""Configure a checkbox column in ``st.dataframe`` or ``st.data_editor``.
|
805
|
+
|
806
|
+
This is the default column type for boolean values. This command needs to be used in
|
807
|
+
the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``.
|
808
|
+
When used with ``st.data_editor``, editing will be enabled with a checkbox widget.
|
809
|
+
|
810
|
+
Parameters
|
811
|
+
----------
|
812
|
+
|
813
|
+
label: str or None
|
814
|
+
The label shown at the top of the column. If this is ``None``
|
815
|
+
(default), the column name is used.
|
816
|
+
|
817
|
+
width: "small", "medium", "large", or None
|
818
|
+
The display width of the column. If this is ``None`` (default), the
|
819
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
820
|
+
one of the following:
|
821
|
+
|
822
|
+
- ``"small"``: 75px wide
|
823
|
+
- ``"medium"``: 200px wide
|
824
|
+
- ``"large"``: 400px wide
|
825
|
+
|
826
|
+
help: str or None
|
827
|
+
A tooltip that gets displayed when hovering over the column label. If
|
828
|
+
this is ``None`` (default), no tooltip is displayed.
|
829
|
+
|
830
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
831
|
+
the Markdown directives described in the ``body`` parameter of
|
832
|
+
``st.markdown``.
|
833
|
+
|
834
|
+
disabled: bool or None
|
835
|
+
Whether editing should be disabled for this column. If this is ``None``
|
836
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
837
|
+
are not.
|
838
|
+
|
839
|
+
If a column has mixed types, it may become uneditable regardless of
|
840
|
+
``disabled``.
|
841
|
+
|
842
|
+
required: bool or None
|
843
|
+
Whether edited cells in the column need to have a value. If this is
|
844
|
+
``False`` (default), the user can submit empty values for this column.
|
845
|
+
If this is ``True``, an edited cell in this column can only be
|
846
|
+
submitted if its value is not ``None``, and a new row will only be
|
847
|
+
submitted after the user fills in this column.
|
848
|
+
|
849
|
+
pinned: bool or None
|
850
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
851
|
+
left side no matter where the user scrolls. If this is ``None``
|
852
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
853
|
+
columns are not pinned.
|
854
|
+
|
855
|
+
default: bool or None
|
856
|
+
Specifies the default value in this column when a new row is added by
|
857
|
+
the user. This defaults to ``None``.
|
858
|
+
|
859
|
+
Examples
|
860
|
+
--------
|
861
|
+
|
862
|
+
>>> import pandas as pd
|
863
|
+
>>> import streamlit as st
|
864
|
+
>>>
|
865
|
+
>>> data_df = pd.DataFrame(
|
866
|
+
>>> {
|
867
|
+
>>> "widgets": ["st.selectbox", "st.number_input", "st.text_area", "st.button"],
|
868
|
+
>>> "favorite": [True, False, False, True],
|
869
|
+
>>> }
|
870
|
+
>>> )
|
871
|
+
>>>
|
872
|
+
>>> st.data_editor(
|
873
|
+
>>> data_df,
|
874
|
+
>>> column_config={
|
875
|
+
>>> "favorite": st.column_config.CheckboxColumn(
|
876
|
+
>>> "Your favorite?",
|
877
|
+
>>> help="Select your **favorite** widgets",
|
878
|
+
>>> default=False,
|
879
|
+
>>> )
|
880
|
+
>>> },
|
881
|
+
>>> disabled=["widgets"],
|
882
|
+
>>> hide_index=True,
|
883
|
+
>>> )
|
884
|
+
|
885
|
+
.. output::
|
886
|
+
https://doc-checkbox-column.streamlit.app/
|
887
|
+
height: 300px
|
888
|
+
"""
|
889
|
+
|
890
|
+
return ColumnConfig(
|
891
|
+
label=label,
|
892
|
+
width=width,
|
893
|
+
help=help,
|
894
|
+
disabled=disabled,
|
895
|
+
required=required,
|
896
|
+
pinned=pinned,
|
897
|
+
default=default,
|
898
|
+
type_config=CheckboxColumnConfig(type="checkbox"),
|
899
|
+
)
|
900
|
+
|
901
|
+
|
902
|
+
@gather_metrics("column_config.SelectboxColumn")
|
903
|
+
def SelectboxColumn(
|
904
|
+
label: str | None = None,
|
905
|
+
*,
|
906
|
+
width: ColumnWidth | None = None,
|
907
|
+
help: str | None = None,
|
908
|
+
disabled: bool | None = None,
|
909
|
+
required: bool | None = None,
|
910
|
+
pinned: bool | None = None,
|
911
|
+
default: str | int | float | None = None,
|
912
|
+
options: Iterable[str | int | float] | None = None,
|
913
|
+
) -> ColumnConfig:
|
914
|
+
"""Configure a selectbox column in ``st.dataframe`` or ``st.data_editor``.
|
915
|
+
|
916
|
+
This is the default column type for Pandas categorical values. This command needs to
|
917
|
+
be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``.
|
918
|
+
When used with ``st.data_editor``, editing will be enabled with a selectbox widget.
|
919
|
+
|
920
|
+
Parameters
|
921
|
+
----------
|
922
|
+
|
923
|
+
label: str or None
|
924
|
+
The label shown at the top of the column. If this is ``None``
|
925
|
+
(default), the column name is used.
|
926
|
+
|
927
|
+
width: "small", "medium", "large", or None
|
928
|
+
The display width of the column. If this is ``None`` (default), the
|
929
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
930
|
+
one of the following:
|
931
|
+
|
932
|
+
- ``"small"``: 75px wide
|
933
|
+
- ``"medium"``: 200px wide
|
934
|
+
- ``"large"``: 400px wide
|
935
|
+
|
936
|
+
help: str or None
|
937
|
+
A tooltip that gets displayed when hovering over the column label. If
|
938
|
+
this is ``None`` (default), no tooltip is displayed.
|
939
|
+
|
940
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
941
|
+
the Markdown directives described in the ``body`` parameter of
|
942
|
+
``st.markdown``.
|
943
|
+
|
944
|
+
disabled: bool or None
|
945
|
+
Whether editing should be disabled for this column. If this is ``None``
|
946
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
947
|
+
are not.
|
948
|
+
|
949
|
+
If a column has mixed types, it may become uneditable regardless of
|
950
|
+
``disabled``.
|
951
|
+
|
952
|
+
required: bool or None
|
953
|
+
Whether edited cells in the column need to have a value. If this is
|
954
|
+
``False`` (default), the user can submit empty values for this column.
|
955
|
+
If this is ``True``, an edited cell in this column can only be
|
956
|
+
submitted if its value is not ``None``, and a new row will only be
|
957
|
+
submitted after the user fills in this column.
|
958
|
+
|
959
|
+
pinned: bool or None
|
960
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
961
|
+
left side no matter where the user scrolls. If this is ``None``
|
962
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
963
|
+
columns are not pinned.
|
964
|
+
|
965
|
+
default: str, int, float, bool, or None
|
966
|
+
Specifies the default value in this column when a new row is added by
|
967
|
+
the user. This defaults to ``None``.
|
968
|
+
|
969
|
+
options: Iterable of str or None
|
970
|
+
The options that can be selected during editing. If this is ``None``
|
971
|
+
(default), the options will be inferred from the underlying dataframe
|
972
|
+
column if its dtype is "category". For more information, see `Pandas docs
|
973
|
+
<https://pandas.pydata.org/docs/user_guide/categorical.html>`_).
|
974
|
+
|
975
|
+
Examples
|
976
|
+
--------
|
977
|
+
|
978
|
+
>>> import pandas as pd
|
979
|
+
>>> import streamlit as st
|
980
|
+
>>>
|
981
|
+
>>> data_df = pd.DataFrame(
|
982
|
+
>>> {
|
983
|
+
>>> "category": [
|
984
|
+
>>> "📊 Data Exploration",
|
985
|
+
>>> "📈 Data Visualization",
|
986
|
+
>>> "🤖 LLM",
|
987
|
+
>>> "📊 Data Exploration",
|
988
|
+
>>> ],
|
989
|
+
>>> }
|
990
|
+
>>> )
|
991
|
+
>>>
|
992
|
+
>>> st.data_editor(
|
993
|
+
>>> data_df,
|
994
|
+
>>> column_config={
|
995
|
+
>>> "category": st.column_config.SelectboxColumn(
|
996
|
+
>>> "App Category",
|
997
|
+
>>> help="The category of the app",
|
998
|
+
>>> width="medium",
|
999
|
+
>>> options=[
|
1000
|
+
>>> "📊 Data Exploration",
|
1001
|
+
>>> "📈 Data Visualization",
|
1002
|
+
>>> "🤖 LLM",
|
1003
|
+
>>> ],
|
1004
|
+
>>> required=True,
|
1005
|
+
>>> )
|
1006
|
+
>>> },
|
1007
|
+
>>> hide_index=True,
|
1008
|
+
>>> )
|
1009
|
+
|
1010
|
+
.. output::
|
1011
|
+
https://doc-selectbox-column.streamlit.app/
|
1012
|
+
height: 300px
|
1013
|
+
"""
|
1014
|
+
|
1015
|
+
return ColumnConfig(
|
1016
|
+
label=label,
|
1017
|
+
width=width,
|
1018
|
+
help=help,
|
1019
|
+
disabled=disabled,
|
1020
|
+
required=required,
|
1021
|
+
pinned=pinned,
|
1022
|
+
default=default,
|
1023
|
+
type_config=SelectboxColumnConfig(
|
1024
|
+
type="selectbox", options=list(options) if options is not None else None
|
1025
|
+
),
|
1026
|
+
)
|
1027
|
+
|
1028
|
+
|
1029
|
+
@gather_metrics("column_config.BarChartColumn")
|
1030
|
+
def BarChartColumn(
|
1031
|
+
label: str | None = None,
|
1032
|
+
*,
|
1033
|
+
width: ColumnWidth | None = None,
|
1034
|
+
help: str | None = None,
|
1035
|
+
pinned: bool | None = None,
|
1036
|
+
y_min: int | float | None = None,
|
1037
|
+
y_max: int | float | None = None,
|
1038
|
+
) -> ColumnConfig:
|
1039
|
+
"""Configure a bar chart column in ``st.dataframe`` or ``st.data_editor``.
|
1040
|
+
|
1041
|
+
Cells need to contain a list of numbers. Chart columns are not editable
|
1042
|
+
at the moment. This command needs to be used in the ``column_config`` parameter
|
1043
|
+
of ``st.dataframe`` or ``st.data_editor``.
|
1044
|
+
|
1045
|
+
Parameters
|
1046
|
+
----------
|
1047
|
+
|
1048
|
+
label: str or None
|
1049
|
+
The label shown at the top of the column. If this is ``None``
|
1050
|
+
(default), the column name is used.
|
1051
|
+
|
1052
|
+
width: "small", "medium", "large", or None
|
1053
|
+
The display width of the column. If this is ``None`` (default), the
|
1054
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
1055
|
+
one of the following:
|
1056
|
+
|
1057
|
+
- ``"small"``: 75px wide
|
1058
|
+
- ``"medium"``: 200px wide
|
1059
|
+
- ``"large"``: 400px wide
|
1060
|
+
|
1061
|
+
help: str or None
|
1062
|
+
A tooltip that gets displayed when hovering over the column label. If
|
1063
|
+
this is ``None`` (default), no tooltip is displayed.
|
1064
|
+
|
1065
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
1066
|
+
the Markdown directives described in the ``body`` parameter of
|
1067
|
+
``st.markdown``.
|
1068
|
+
|
1069
|
+
pinned: bool or None
|
1070
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
1071
|
+
left side no matter where the user scrolls. If this is ``None``
|
1072
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
1073
|
+
columns are not pinned.
|
1074
|
+
|
1075
|
+
y_min: int, float, or None
|
1076
|
+
The minimum value on the y-axis for all cells in the column. If this is
|
1077
|
+
``None`` (default), every cell will use the minimum of its data.
|
1078
|
+
|
1079
|
+
y_max: int, float, or None
|
1080
|
+
The maximum value on the y-axis for all cells in the column. If this is
|
1081
|
+
``None`` (default), every cell will use the maximum of its data.
|
1082
|
+
|
1083
|
+
Examples
|
1084
|
+
--------
|
1085
|
+
|
1086
|
+
>>> import pandas as pd
|
1087
|
+
>>> import streamlit as st
|
1088
|
+
>>>
|
1089
|
+
>>> data_df = pd.DataFrame(
|
1090
|
+
>>> {
|
1091
|
+
>>> "sales": [
|
1092
|
+
>>> [0, 4, 26, 80, 100, 40],
|
1093
|
+
>>> [80, 20, 80, 35, 40, 100],
|
1094
|
+
>>> [10, 20, 80, 80, 70, 0],
|
1095
|
+
>>> [10, 100, 20, 100, 30, 100],
|
1096
|
+
>>> ],
|
1097
|
+
>>> }
|
1098
|
+
>>> )
|
1099
|
+
>>>
|
1100
|
+
>>> st.data_editor(
|
1101
|
+
>>> data_df,
|
1102
|
+
>>> column_config={
|
1103
|
+
>>> "sales": st.column_config.BarChartColumn(
|
1104
|
+
>>> "Sales (last 6 months)",
|
1105
|
+
>>> help="The sales volume in the last 6 months",
|
1106
|
+
>>> y_min=0,
|
1107
|
+
>>> y_max=100,
|
1108
|
+
>>> ),
|
1109
|
+
>>> },
|
1110
|
+
>>> hide_index=True,
|
1111
|
+
>>> )
|
1112
|
+
|
1113
|
+
.. output::
|
1114
|
+
https://doc-barchart-column.streamlit.app/
|
1115
|
+
height: 300px
|
1116
|
+
"""
|
1117
|
+
|
1118
|
+
return ColumnConfig(
|
1119
|
+
label=label,
|
1120
|
+
width=width,
|
1121
|
+
help=help,
|
1122
|
+
pinned=pinned,
|
1123
|
+
type_config=BarChartColumnConfig(type="bar_chart", y_min=y_min, y_max=y_max),
|
1124
|
+
)
|
1125
|
+
|
1126
|
+
|
1127
|
+
@gather_metrics("column_config.LineChartColumn")
|
1128
|
+
def LineChartColumn(
|
1129
|
+
label: str | None = None,
|
1130
|
+
*,
|
1131
|
+
width: ColumnWidth | None = None,
|
1132
|
+
help: str | None = None,
|
1133
|
+
pinned: bool | None = None,
|
1134
|
+
y_min: int | float | None = None,
|
1135
|
+
y_max: int | float | None = None,
|
1136
|
+
) -> ColumnConfig:
|
1137
|
+
"""Configure a line chart column in ``st.dataframe`` or ``st.data_editor``.
|
1138
|
+
|
1139
|
+
Cells need to contain a list of numbers. Chart columns are not editable
|
1140
|
+
at the moment. This command needs to be used in the ``column_config`` parameter
|
1141
|
+
of ``st.dataframe`` or ``st.data_editor``.
|
1142
|
+
|
1143
|
+
Parameters
|
1144
|
+
----------
|
1145
|
+
|
1146
|
+
label: str or None
|
1147
|
+
The label shown at the top of the column. If this is ``None``
|
1148
|
+
(default), the column name is used.
|
1149
|
+
|
1150
|
+
width: "small", "medium", "large", or None
|
1151
|
+
The display width of the column. If this is ``None`` (default), the
|
1152
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
1153
|
+
one of the following:
|
1154
|
+
|
1155
|
+
- ``"small"``: 75px wide
|
1156
|
+
- ``"medium"``: 200px wide
|
1157
|
+
- ``"large"``: 400px wide
|
1158
|
+
|
1159
|
+
help: str or None
|
1160
|
+
A tooltip that gets displayed when hovering over the column label. If
|
1161
|
+
this is ``None`` (default), no tooltip is displayed.
|
1162
|
+
|
1163
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
1164
|
+
the Markdown directives described in the ``body`` parameter of
|
1165
|
+
``st.markdown``.
|
1166
|
+
|
1167
|
+
pinned: bool or None
|
1168
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
1169
|
+
left side no matter where the user scrolls. If this is ``None``
|
1170
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
1171
|
+
columns are not pinned.
|
1172
|
+
|
1173
|
+
y_min: int, float, or None
|
1174
|
+
The minimum value on the y-axis for all cells in the column. If this is
|
1175
|
+
``None`` (default), every cell will use the minimum of its data.
|
1176
|
+
|
1177
|
+
y_max: int, float, or None
|
1178
|
+
The maximum value on the y-axis for all cells in the column. If this is
|
1179
|
+
``None`` (default), every cell will use the maximum of its data.
|
1180
|
+
|
1181
|
+
Examples
|
1182
|
+
--------
|
1183
|
+
|
1184
|
+
>>> import pandas as pd
|
1185
|
+
>>> import streamlit as st
|
1186
|
+
>>>
|
1187
|
+
>>> data_df = pd.DataFrame(
|
1188
|
+
>>> {
|
1189
|
+
>>> "sales": [
|
1190
|
+
>>> [0, 4, 26, 80, 100, 40],
|
1191
|
+
>>> [80, 20, 80, 35, 40, 100],
|
1192
|
+
>>> [10, 20, 80, 80, 70, 0],
|
1193
|
+
>>> [10, 100, 20, 100, 30, 100],
|
1194
|
+
>>> ],
|
1195
|
+
>>> }
|
1196
|
+
>>> )
|
1197
|
+
>>>
|
1198
|
+
>>> st.data_editor(
|
1199
|
+
>>> data_df,
|
1200
|
+
>>> column_config={
|
1201
|
+
>>> "sales": st.column_config.LineChartColumn(
|
1202
|
+
>>> "Sales (last 6 months)",
|
1203
|
+
>>> width="medium",
|
1204
|
+
>>> help="The sales volume in the last 6 months",
|
1205
|
+
>>> y_min=0,
|
1206
|
+
>>> y_max=100,
|
1207
|
+
>>> ),
|
1208
|
+
>>> },
|
1209
|
+
>>> hide_index=True,
|
1210
|
+
>>> )
|
1211
|
+
|
1212
|
+
.. output::
|
1213
|
+
https://doc-linechart-column.streamlit.app/
|
1214
|
+
height: 300px
|
1215
|
+
"""
|
1216
|
+
|
1217
|
+
return ColumnConfig(
|
1218
|
+
label=label,
|
1219
|
+
width=width,
|
1220
|
+
help=help,
|
1221
|
+
pinned=pinned,
|
1222
|
+
type_config=LineChartColumnConfig(type="line_chart", y_min=y_min, y_max=y_max),
|
1223
|
+
)
|
1224
|
+
|
1225
|
+
|
1226
|
+
@gather_metrics("column_config.AreaChartColumn")
|
1227
|
+
def AreaChartColumn(
|
1228
|
+
label: str | None = None,
|
1229
|
+
*,
|
1230
|
+
width: ColumnWidth | None = None,
|
1231
|
+
help: str | None = None,
|
1232
|
+
pinned: bool | None = None,
|
1233
|
+
y_min: int | float | None = None,
|
1234
|
+
y_max: int | float | None = None,
|
1235
|
+
) -> ColumnConfig:
|
1236
|
+
"""Configure an area chart column in ``st.dataframe`` or ``st.data_editor``.
|
1237
|
+
|
1238
|
+
Cells need to contain a list of numbers. Chart columns are not editable
|
1239
|
+
at the moment. This command needs to be used in the ``column_config`` parameter
|
1240
|
+
of ``st.dataframe`` or ``st.data_editor``.
|
1241
|
+
|
1242
|
+
Parameters
|
1243
|
+
----------
|
1244
|
+
|
1245
|
+
label: str or None
|
1246
|
+
The label shown at the top of the column. If this is ``None``
|
1247
|
+
(default), the column name is used.
|
1248
|
+
|
1249
|
+
width: "small", "medium", "large", or None
|
1250
|
+
The display width of the column. If this is ``None`` (default), the
|
1251
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
1252
|
+
one of the following:
|
1253
|
+
|
1254
|
+
- ``"small"``: 75px wide
|
1255
|
+
- ``"medium"``: 200px wide
|
1256
|
+
- ``"large"``: 400px wide
|
1257
|
+
|
1258
|
+
help: str or None
|
1259
|
+
A tooltip that gets displayed when hovering over the column label. If
|
1260
|
+
this is ``None`` (default), no tooltip is displayed.
|
1261
|
+
|
1262
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
1263
|
+
the Markdown directives described in the ``body`` parameter of
|
1264
|
+
``st.markdown``.
|
1265
|
+
|
1266
|
+
pinned: bool or None
|
1267
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
1268
|
+
left side no matter where the user scrolls. If this is ``None``
|
1269
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
1270
|
+
columns are not pinned.
|
1271
|
+
|
1272
|
+
y_min: int, float, or None
|
1273
|
+
The minimum value on the y-axis for all cells in the column. If this is
|
1274
|
+
``None`` (default), every cell will use the minimum of its data.
|
1275
|
+
|
1276
|
+
y_max: int, float, or None
|
1277
|
+
The maximum value on the y-axis for all cells in the column. If this is
|
1278
|
+
``None`` (default), every cell will use the maximum of its data.
|
1279
|
+
|
1280
|
+
Examples
|
1281
|
+
--------
|
1282
|
+
|
1283
|
+
>>> import pandas as pd
|
1284
|
+
>>> import streamlit as st
|
1285
|
+
>>>
|
1286
|
+
>>> data_df = pd.DataFrame(
|
1287
|
+
>>> {
|
1288
|
+
>>> "sales": [
|
1289
|
+
>>> [0, 4, 26, 80, 100, 40],
|
1290
|
+
>>> [80, 20, 80, 35, 40, 100],
|
1291
|
+
>>> [10, 20, 80, 80, 70, 0],
|
1292
|
+
>>> [10, 100, 20, 100, 30, 100],
|
1293
|
+
>>> ],
|
1294
|
+
>>> }
|
1295
|
+
>>> )
|
1296
|
+
>>>
|
1297
|
+
>>> st.data_editor(
|
1298
|
+
>>> data_df,
|
1299
|
+
>>> column_config={
|
1300
|
+
>>> "sales": st.column_config.AreaChartColumn(
|
1301
|
+
>>> "Sales (last 6 months)",
|
1302
|
+
>>> width="medium",
|
1303
|
+
>>> help="The sales volume in the last 6 months",
|
1304
|
+
>>> y_min=0,
|
1305
|
+
>>> y_max=100,
|
1306
|
+
>>> ),
|
1307
|
+
>>> },
|
1308
|
+
>>> hide_index=True,
|
1309
|
+
>>> )
|
1310
|
+
|
1311
|
+
.. output::
|
1312
|
+
https://doc-areachart-column.streamlit.app/
|
1313
|
+
height: 300px
|
1314
|
+
"""
|
1315
|
+
|
1316
|
+
return ColumnConfig(
|
1317
|
+
label=label,
|
1318
|
+
width=width,
|
1319
|
+
help=help,
|
1320
|
+
pinned=pinned,
|
1321
|
+
type_config=AreaChartColumnConfig(type="area_chart", y_min=y_min, y_max=y_max),
|
1322
|
+
)
|
1323
|
+
|
1324
|
+
|
1325
|
+
@gather_metrics("column_config.ImageColumn")
|
1326
|
+
def ImageColumn(
|
1327
|
+
label: str | None = None,
|
1328
|
+
*,
|
1329
|
+
width: ColumnWidth | None = None,
|
1330
|
+
help: str | None = None,
|
1331
|
+
pinned: bool | None = None,
|
1332
|
+
):
|
1333
|
+
"""Configure an image column in ``st.dataframe`` or ``st.data_editor``.
|
1334
|
+
|
1335
|
+
The cell values need to be one of:
|
1336
|
+
|
1337
|
+
* A URL to fetch the image from. This can also be a relative URL of an image
|
1338
|
+
deployed via `static file serving <https://docs.streamlit.io/develop/concepts/configuration/serving-static-files>`_.
|
1339
|
+
Note that you can NOT use an arbitrary local image if it is not available through
|
1340
|
+
a public URL.
|
1341
|
+
* A data URL containing an SVG XML like ``data:image/svg+xml;utf8,<svg xmlns=...</svg>``.
|
1342
|
+
* A data URL containing a Base64 encoded image like ``data:image/png;base64,iVBO...``.
|
1343
|
+
|
1344
|
+
Image columns are not editable at the moment. This command needs to be used in the
|
1345
|
+
``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``.
|
1346
|
+
|
1347
|
+
Parameters
|
1348
|
+
----------
|
1349
|
+
|
1350
|
+
label: str or None
|
1351
|
+
The label shown at the top of the column. If this is ``None``
|
1352
|
+
(default), the column name is used.
|
1353
|
+
|
1354
|
+
width: "small", "medium", "large", or None
|
1355
|
+
The display width of the column. If this is ``None`` (default), the
|
1356
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
1357
|
+
one of the following:
|
1358
|
+
|
1359
|
+
- ``"small"``: 75px wide
|
1360
|
+
- ``"medium"``: 200px wide
|
1361
|
+
- ``"large"``: 400px wide
|
1362
|
+
|
1363
|
+
help: str or None
|
1364
|
+
A tooltip that gets displayed when hovering over the column label. If
|
1365
|
+
this is ``None`` (default), no tooltip is displayed.
|
1366
|
+
|
1367
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
1368
|
+
the Markdown directives described in the ``body`` parameter of
|
1369
|
+
``st.markdown``.
|
1370
|
+
|
1371
|
+
pinned: bool or None
|
1372
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
1373
|
+
left side no matter where the user scrolls. If this is ``None``
|
1374
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
1375
|
+
columns are not pinned.
|
1376
|
+
|
1377
|
+
Examples
|
1378
|
+
--------
|
1379
|
+
|
1380
|
+
>>> import pandas as pd
|
1381
|
+
>>> import streamlit as st
|
1382
|
+
>>>
|
1383
|
+
>>> data_df = pd.DataFrame(
|
1384
|
+
>>> {
|
1385
|
+
>>> "apps": [
|
1386
|
+
>>> "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/5435b8cb-6c6c-490b-9608-799b543655d3/Home_Page.png",
|
1387
|
+
>>> "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/ef9a7627-13f2-47e5-8f65-3f69bb38a5c2/Home_Page.png",
|
1388
|
+
>>> "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/31b99099-8eae-4ff8-aa89-042895ed3843/Home_Page.png",
|
1389
|
+
>>> "https://storage.googleapis.com/s4a-prod-share-preview/default/st_app_screenshot_image/6a399b09-241e-4ae7-a31f-7640dc1d181e/Home_Page.png",
|
1390
|
+
>>> ],
|
1391
|
+
>>> }
|
1392
|
+
>>> )
|
1393
|
+
>>>
|
1394
|
+
>>> st.data_editor(
|
1395
|
+
>>> data_df,
|
1396
|
+
>>> column_config={
|
1397
|
+
>>> "apps": st.column_config.ImageColumn(
|
1398
|
+
>>> "Preview Image", help="Streamlit app preview screenshots"
|
1399
|
+
>>> )
|
1400
|
+
>>> },
|
1401
|
+
>>> hide_index=True,
|
1402
|
+
>>> )
|
1403
|
+
|
1404
|
+
.. output::
|
1405
|
+
https://doc-image-column.streamlit.app/
|
1406
|
+
height: 300px
|
1407
|
+
"""
|
1408
|
+
return ColumnConfig(
|
1409
|
+
label=label,
|
1410
|
+
width=width,
|
1411
|
+
help=help,
|
1412
|
+
pinned=pinned,
|
1413
|
+
type_config=ImageColumnConfig(type="image"),
|
1414
|
+
)
|
1415
|
+
|
1416
|
+
|
1417
|
+
@gather_metrics("column_config.ListColumn")
|
1418
|
+
def ListColumn(
|
1419
|
+
label: str | None = None,
|
1420
|
+
*,
|
1421
|
+
width: ColumnWidth | None = None,
|
1422
|
+
help: str | None = None,
|
1423
|
+
pinned: bool | None = None,
|
1424
|
+
):
|
1425
|
+
"""Configure a list column in ``st.dataframe`` or ``st.data_editor``.
|
1426
|
+
|
1427
|
+
This is the default column type for list-like values. List columns are not editable
|
1428
|
+
at the moment. This command needs to be used in the ``column_config`` parameter of
|
1429
|
+
``st.dataframe`` or ``st.data_editor``.
|
1430
|
+
|
1431
|
+
Parameters
|
1432
|
+
----------
|
1433
|
+
|
1434
|
+
label: str or None
|
1435
|
+
The label shown at the top of the column. If this is ``None``
|
1436
|
+
(default), the column name is used.
|
1437
|
+
|
1438
|
+
width: "small", "medium", "large", or None
|
1439
|
+
The display width of the column. If this is ``None`` (default), the
|
1440
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
1441
|
+
one of the following:
|
1442
|
+
|
1443
|
+
- ``"small"``: 75px wide
|
1444
|
+
- ``"medium"``: 200px wide
|
1445
|
+
- ``"large"``: 400px wide
|
1446
|
+
|
1447
|
+
help: str or None
|
1448
|
+
A tooltip that gets displayed when hovering over the column label. If
|
1449
|
+
this is ``None`` (default), no tooltip is displayed.
|
1450
|
+
|
1451
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
1452
|
+
the Markdown directives described in the ``body`` parameter of
|
1453
|
+
``st.markdown``.
|
1454
|
+
|
1455
|
+
pinned: bool or None
|
1456
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
1457
|
+
left side no matter where the user scrolls. If this is ``None``
|
1458
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
1459
|
+
columns are not pinned.
|
1460
|
+
|
1461
|
+
Examples
|
1462
|
+
--------
|
1463
|
+
|
1464
|
+
>>> import pandas as pd
|
1465
|
+
>>> import streamlit as st
|
1466
|
+
>>>
|
1467
|
+
>>> data_df = pd.DataFrame(
|
1468
|
+
>>> {
|
1469
|
+
>>> "sales": [
|
1470
|
+
>>> [0, 4, 26, 80, 100, 40],
|
1471
|
+
>>> [80, 20, 80, 35, 40, 100],
|
1472
|
+
>>> [10, 20, 80, 80, 70, 0],
|
1473
|
+
>>> [10, 100, 20, 100, 30, 100],
|
1474
|
+
>>> ],
|
1475
|
+
>>> }
|
1476
|
+
>>> )
|
1477
|
+
>>>
|
1478
|
+
>>> st.data_editor(
|
1479
|
+
>>> data_df,
|
1480
|
+
>>> column_config={
|
1481
|
+
>>> "sales": st.column_config.ListColumn(
|
1482
|
+
>>> "Sales (last 6 months)",
|
1483
|
+
>>> help="The sales volume in the last 6 months",
|
1484
|
+
>>> width="medium",
|
1485
|
+
>>> ),
|
1486
|
+
>>> },
|
1487
|
+
>>> hide_index=True,
|
1488
|
+
>>> )
|
1489
|
+
|
1490
|
+
.. output::
|
1491
|
+
https://doc-list-column.streamlit.app/
|
1492
|
+
height: 300px
|
1493
|
+
"""
|
1494
|
+
return ColumnConfig(
|
1495
|
+
label=label,
|
1496
|
+
width=width,
|
1497
|
+
help=help,
|
1498
|
+
pinned=pinned,
|
1499
|
+
type_config=ListColumnConfig(type="list"),
|
1500
|
+
)
|
1501
|
+
|
1502
|
+
|
1503
|
+
@gather_metrics("column_config.DatetimeColumn")
|
1504
|
+
def DatetimeColumn(
|
1505
|
+
label: str | None = None,
|
1506
|
+
*,
|
1507
|
+
width: ColumnWidth | None = None,
|
1508
|
+
help: str | None = None,
|
1509
|
+
disabled: bool | None = None,
|
1510
|
+
required: bool | None = None,
|
1511
|
+
pinned: bool | None = None,
|
1512
|
+
default: datetime.datetime | None = None,
|
1513
|
+
format: str | Literal["localized", "distance", "calendar", "iso8601"] | None = None,
|
1514
|
+
min_value: datetime.datetime | None = None,
|
1515
|
+
max_value: datetime.datetime | None = None,
|
1516
|
+
step: int | float | datetime.timedelta | None = None,
|
1517
|
+
timezone: str | None = None,
|
1518
|
+
) -> ColumnConfig:
|
1519
|
+
"""Configure a datetime column in ``st.dataframe`` or ``st.data_editor``.
|
1520
|
+
|
1521
|
+
This is the default column type for datetime values. This command needs to be
|
1522
|
+
used in the ``column_config`` parameter of ``st.dataframe`` or
|
1523
|
+
``st.data_editor``. When used with ``st.data_editor``, editing will be enabled
|
1524
|
+
with a datetime picker widget.
|
1525
|
+
|
1526
|
+
Parameters
|
1527
|
+
----------
|
1528
|
+
|
1529
|
+
label: str or None
|
1530
|
+
The label shown at the top of the column. If this is ``None``
|
1531
|
+
(default), the column name is used.
|
1532
|
+
|
1533
|
+
width: "small", "medium", "large", or None
|
1534
|
+
The display width of the column. If this is ``None`` (default), the
|
1535
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
1536
|
+
one of the following:
|
1537
|
+
|
1538
|
+
- ``"small"``: 75px wide
|
1539
|
+
- ``"medium"``: 200px wide
|
1540
|
+
- ``"large"``: 400px wide
|
1541
|
+
|
1542
|
+
help: str or None
|
1543
|
+
A tooltip that gets displayed when hovering over the column label. If
|
1544
|
+
this is ``None`` (default), no tooltip is displayed.
|
1545
|
+
|
1546
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
1547
|
+
the Markdown directives described in the ``body`` parameter of
|
1548
|
+
``st.markdown``.
|
1549
|
+
|
1550
|
+
disabled: bool or None
|
1551
|
+
Whether editing should be disabled for this column. If this is ``None``
|
1552
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
1553
|
+
are not.
|
1554
|
+
|
1555
|
+
If a column has mixed types, it may become uneditable regardless of
|
1556
|
+
``disabled``.
|
1557
|
+
|
1558
|
+
required: bool or None
|
1559
|
+
Whether edited cells in the column need to have a value. If this is
|
1560
|
+
``False`` (default), the user can submit empty values for this column.
|
1561
|
+
If this is ``True``, an edited cell in this column can only be
|
1562
|
+
submitted if its value is not ``None``, and a new row will only be
|
1563
|
+
submitted after the user fills in this column.
|
1564
|
+
|
1565
|
+
pinned: bool or None
|
1566
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
1567
|
+
left side no matter where the user scrolls. If this is ``None``
|
1568
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
1569
|
+
columns are not pinned.
|
1570
|
+
|
1571
|
+
default: datetime.datetime or None
|
1572
|
+
Specifies the default value in this column when a new row is added by
|
1573
|
+
the user. This defaults to ``None``.
|
1574
|
+
|
1575
|
+
format: str, "localized", "distance", "calendar", "iso8601", or None
|
1576
|
+
A format string controlling how datetimes are displayed.
|
1577
|
+
This can be one of the following values:
|
1578
|
+
|
1579
|
+
- ``None`` (default): Show the datetime in ``"YYYY-MM-DD HH:mm:ss"``
|
1580
|
+
format (e.g. "2025-03-04 20:00:00").
|
1581
|
+
- ``"localized"``: Show the datetime in the default locale format (e.g.
|
1582
|
+
"Mar 4, 2025, 12:00:00 PM" in the America/Los_Angeles timezone).
|
1583
|
+
- ``"distance"``: Show the datetime in a relative format (e.g.
|
1584
|
+
"a few seconds ago").
|
1585
|
+
- ``"calendar"``: Show the datetime in a calendar format (e.g.
|
1586
|
+
"Today at 8:00 PM").
|
1587
|
+
- ``"iso8601"``: Show the datetime in ISO 8601 format (e.g.
|
1588
|
+
"2025-03-04T20:00:00.000Z").
|
1589
|
+
- A momentJS format string: Format the datetime with a string, like
|
1590
|
+
``"ddd ha"`` to show "Tue 8pm". For available formats, see
|
1591
|
+
`momentJS <https://momentjs.com/docs/#/displaying/format/>`_.
|
1592
|
+
|
1593
|
+
Formatting from ``column_config`` always takes precedence over
|
1594
|
+
formatting from ``pandas.Styler``. The formatting does not impact the
|
1595
|
+
return value when used in ``st.data_editor``.
|
1596
|
+
|
1597
|
+
min_value: datetime.datetime or None
|
1598
|
+
The minimum datetime that can be entered. If this is ``None``
|
1599
|
+
(default), there will be no minimum.
|
1600
|
+
|
1601
|
+
max_value: datetime.datetime or None
|
1602
|
+
The maximum datetime that can be entered. If this is ``None``
|
1603
|
+
(default), there will be no maximum.
|
1604
|
+
|
1605
|
+
step: int, float, datetime.timedelta, or None
|
1606
|
+
The stepping interval in seconds. If this is ``None`` (default), the
|
1607
|
+
step will be 1 second.
|
1608
|
+
|
1609
|
+
timezone: str or None
|
1610
|
+
The timezone of this column. If this is ``None`` (default), the
|
1611
|
+
timezone is inferred from the underlying data.
|
1612
|
+
|
1613
|
+
Examples
|
1614
|
+
--------
|
1615
|
+
|
1616
|
+
>>> from datetime import datetime
|
1617
|
+
>>> import pandas as pd
|
1618
|
+
>>> import streamlit as st
|
1619
|
+
>>>
|
1620
|
+
>>> data_df = pd.DataFrame(
|
1621
|
+
>>> {
|
1622
|
+
>>> "appointment": [
|
1623
|
+
>>> datetime(2024, 2, 5, 12, 30),
|
1624
|
+
>>> datetime(2023, 11, 10, 18, 0),
|
1625
|
+
>>> datetime(2024, 3, 11, 20, 10),
|
1626
|
+
>>> datetime(2023, 9, 12, 3, 0),
|
1627
|
+
>>> ]
|
1628
|
+
>>> }
|
1629
|
+
>>> )
|
1630
|
+
>>>
|
1631
|
+
>>> st.data_editor(
|
1632
|
+
>>> data_df,
|
1633
|
+
>>> column_config={
|
1634
|
+
>>> "appointment": st.column_config.DatetimeColumn(
|
1635
|
+
>>> "Appointment",
|
1636
|
+
>>> min_value=datetime(2023, 6, 1),
|
1637
|
+
>>> max_value=datetime(2025, 1, 1),
|
1638
|
+
>>> format="D MMM YYYY, h:mm a",
|
1639
|
+
>>> step=60,
|
1640
|
+
>>> ),
|
1641
|
+
>>> },
|
1642
|
+
>>> hide_index=True,
|
1643
|
+
>>> )
|
1644
|
+
|
1645
|
+
.. output::
|
1646
|
+
https://doc-datetime-column.streamlit.app/
|
1647
|
+
height: 300px
|
1648
|
+
"""
|
1649
|
+
|
1650
|
+
return ColumnConfig(
|
1651
|
+
label=label,
|
1652
|
+
width=width,
|
1653
|
+
help=help,
|
1654
|
+
disabled=disabled,
|
1655
|
+
required=required,
|
1656
|
+
pinned=pinned,
|
1657
|
+
default=None if default is None else default.isoformat(),
|
1658
|
+
type_config=DatetimeColumnConfig(
|
1659
|
+
type="datetime",
|
1660
|
+
format=format,
|
1661
|
+
min_value=None if min_value is None else min_value.isoformat(),
|
1662
|
+
max_value=None if max_value is None else max_value.isoformat(),
|
1663
|
+
step=step.total_seconds() if isinstance(step, datetime.timedelta) else step,
|
1664
|
+
timezone=timezone,
|
1665
|
+
),
|
1666
|
+
)
|
1667
|
+
|
1668
|
+
|
1669
|
+
@gather_metrics("column_config.TimeColumn")
|
1670
|
+
def TimeColumn(
|
1671
|
+
label: str | None = None,
|
1672
|
+
*,
|
1673
|
+
width: ColumnWidth | None = None,
|
1674
|
+
help: str | None = None,
|
1675
|
+
disabled: bool | None = None,
|
1676
|
+
required: bool | None = None,
|
1677
|
+
pinned: bool | None = None,
|
1678
|
+
default: datetime.time | None = None,
|
1679
|
+
format: str | Literal["localized", "iso8601"] | None = None,
|
1680
|
+
min_value: datetime.time | None = None,
|
1681
|
+
max_value: datetime.time | None = None,
|
1682
|
+
step: int | float | datetime.timedelta | None = None,
|
1683
|
+
) -> ColumnConfig:
|
1684
|
+
"""Configure a time column in ``st.dataframe`` or ``st.data_editor``.
|
1685
|
+
|
1686
|
+
This is the default column type for time values. This command needs to be used in
|
1687
|
+
the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When
|
1688
|
+
used with ``st.data_editor``, editing will be enabled with a time picker widget.
|
1689
|
+
|
1690
|
+
Parameters
|
1691
|
+
----------
|
1692
|
+
|
1693
|
+
label: str or None
|
1694
|
+
The label shown at the top of the column. If this is ``None``
|
1695
|
+
(default), the column name is used.
|
1696
|
+
|
1697
|
+
width: "small", "medium", "large", or None
|
1698
|
+
The display width of the column. If this is ``None`` (default), the
|
1699
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
1700
|
+
one of the following:
|
1701
|
+
|
1702
|
+
- ``"small"``: 75px wide
|
1703
|
+
- ``"medium"``: 200px wide
|
1704
|
+
- ``"large"``: 400px wide
|
1705
|
+
|
1706
|
+
help: str or None
|
1707
|
+
A tooltip that gets displayed when hovering over the column label. If
|
1708
|
+
this is ``None`` (default), no tooltip is displayed.
|
1709
|
+
|
1710
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
1711
|
+
the Markdown directives described in the ``body`` parameter of
|
1712
|
+
``st.markdown``.
|
1713
|
+
|
1714
|
+
disabled: bool or None
|
1715
|
+
Whether editing should be disabled for this column. If this is ``None``
|
1716
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
1717
|
+
are not.
|
1718
|
+
|
1719
|
+
If a column has mixed types, it may become uneditable regardless of
|
1720
|
+
``disabled``.
|
1721
|
+
|
1722
|
+
required: bool or None
|
1723
|
+
Whether edited cells in the column need to have a value. If this is
|
1724
|
+
``False`` (default), the user can submit empty values for this column.
|
1725
|
+
If this is ``True``, an edited cell in this column can only be
|
1726
|
+
submitted if its value is not ``None``, and a new row will only be
|
1727
|
+
submitted after the user fills in this column.
|
1728
|
+
|
1729
|
+
pinned: bool or None
|
1730
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
1731
|
+
left side no matter where the user scrolls. If this is ``None``
|
1732
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
1733
|
+
columns are not pinned.
|
1734
|
+
|
1735
|
+
default: datetime.time or None
|
1736
|
+
Specifies the default value in this column when a new row is added by
|
1737
|
+
the user. This defaults to ``None``.
|
1738
|
+
|
1739
|
+
format: str, "localized", "iso8601", or None
|
1740
|
+
A format string controlling how times are displayed.
|
1741
|
+
This can be one of the following values:
|
1742
|
+
|
1743
|
+
- ``None`` (default): Show the time in ``"HH:mm:ss"`` format (e.g.
|
1744
|
+
"20:00:00").
|
1745
|
+
- ``"localized"``: Show the time in the default locale format (e.g.
|
1746
|
+
"12:00:00 PM" in the America/Los_Angeles timezone).
|
1747
|
+
- ``"iso8601"``: Show the time in ISO 8601 format (e.g.
|
1748
|
+
"20:00:00.000Z").
|
1749
|
+
- A momentJS format string: Format the time with a string, like
|
1750
|
+
``"ha"`` to show "8pm". For available formats, see
|
1751
|
+
`momentJS <https://momentjs.com/docs/#/displaying/format/>`_.
|
1752
|
+
|
1753
|
+
Formatting from ``column_config`` always takes precedence over
|
1754
|
+
formatting from ``pandas.Styler``. The formatting does not impact the
|
1755
|
+
return value when used in ``st.data_editor``.
|
1756
|
+
|
1757
|
+
min_value: datetime.time or None
|
1758
|
+
The minimum time that can be entered. If this is ``None`` (default),
|
1759
|
+
there will be no minimum.
|
1760
|
+
|
1761
|
+
max_value: datetime.time or None
|
1762
|
+
The maximum time that can be entered. If this is ``None`` (default),
|
1763
|
+
there will be no maximum.
|
1764
|
+
|
1765
|
+
step: int, float, datetime.timedelta, or None
|
1766
|
+
The stepping interval in seconds. If this is ``None`` (default), the
|
1767
|
+
step will be 1 second.
|
1768
|
+
|
1769
|
+
Examples
|
1770
|
+
--------
|
1771
|
+
|
1772
|
+
>>> from datetime import time
|
1773
|
+
>>> import pandas as pd
|
1774
|
+
>>> import streamlit as st
|
1775
|
+
>>>
|
1776
|
+
>>> data_df = pd.DataFrame(
|
1777
|
+
>>> {
|
1778
|
+
>>> "appointment": [
|
1779
|
+
>>> time(12, 30),
|
1780
|
+
>>> time(18, 0),
|
1781
|
+
>>> time(9, 10),
|
1782
|
+
>>> time(16, 25),
|
1783
|
+
>>> ]
|
1784
|
+
>>> }
|
1785
|
+
>>> )
|
1786
|
+
>>>
|
1787
|
+
>>> st.data_editor(
|
1788
|
+
>>> data_df,
|
1789
|
+
>>> column_config={
|
1790
|
+
>>> "appointment": st.column_config.TimeColumn(
|
1791
|
+
>>> "Appointment",
|
1792
|
+
>>> min_value=time(8, 0, 0),
|
1793
|
+
>>> max_value=time(19, 0, 0),
|
1794
|
+
>>> format="hh:mm a",
|
1795
|
+
>>> step=60,
|
1796
|
+
>>> ),
|
1797
|
+
>>> },
|
1798
|
+
>>> hide_index=True,
|
1799
|
+
>>> )
|
1800
|
+
|
1801
|
+
.. output::
|
1802
|
+
https://doc-time-column.streamlit.app/
|
1803
|
+
height: 300px
|
1804
|
+
"""
|
1805
|
+
|
1806
|
+
return ColumnConfig(
|
1807
|
+
label=label,
|
1808
|
+
width=width,
|
1809
|
+
help=help,
|
1810
|
+
disabled=disabled,
|
1811
|
+
required=required,
|
1812
|
+
pinned=pinned,
|
1813
|
+
default=None if default is None else default.isoformat(),
|
1814
|
+
type_config=TimeColumnConfig(
|
1815
|
+
type="time",
|
1816
|
+
format=format,
|
1817
|
+
min_value=None if min_value is None else min_value.isoformat(),
|
1818
|
+
max_value=None if max_value is None else max_value.isoformat(),
|
1819
|
+
step=step.total_seconds() if isinstance(step, datetime.timedelta) else step,
|
1820
|
+
),
|
1821
|
+
)
|
1822
|
+
|
1823
|
+
|
1824
|
+
@gather_metrics("column_config.DateColumn")
|
1825
|
+
def DateColumn(
|
1826
|
+
label: str | None = None,
|
1827
|
+
*,
|
1828
|
+
width: ColumnWidth | None = None,
|
1829
|
+
help: str | None = None,
|
1830
|
+
disabled: bool | None = None,
|
1831
|
+
required: bool | None = None,
|
1832
|
+
pinned: bool | None = None,
|
1833
|
+
default: datetime.date | None = None,
|
1834
|
+
format: str | Literal["localized", "distance", "iso8601"] | None = None,
|
1835
|
+
min_value: datetime.date | None = None,
|
1836
|
+
max_value: datetime.date | None = None,
|
1837
|
+
step: int | None = None,
|
1838
|
+
) -> ColumnConfig:
|
1839
|
+
"""Configure a date column in ``st.dataframe`` or ``st.data_editor``.
|
1840
|
+
|
1841
|
+
This is the default column type for date values. This command needs to be used in
|
1842
|
+
the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used
|
1843
|
+
with ``st.data_editor``, editing will be enabled with a date picker widget.
|
1844
|
+
|
1845
|
+
Parameters
|
1846
|
+
----------
|
1847
|
+
|
1848
|
+
label: str or None
|
1849
|
+
The label shown at the top of the column. If this is ``None``
|
1850
|
+
(default), the column name is used.
|
1851
|
+
|
1852
|
+
width: "small", "medium", "large", or None
|
1853
|
+
The display width of the column. If this is ``None`` (default), the
|
1854
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
1855
|
+
one of the following:
|
1856
|
+
|
1857
|
+
- ``"small"``: 75px wide
|
1858
|
+
- ``"medium"``: 200px wide
|
1859
|
+
- ``"large"``: 400px wide
|
1860
|
+
|
1861
|
+
help: str or None
|
1862
|
+
A tooltip that gets displayed when hovering over the column label. If
|
1863
|
+
this is ``None`` (default), no tooltip is displayed.
|
1864
|
+
|
1865
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
1866
|
+
the Markdown directives described in the ``body`` parameter of
|
1867
|
+
``st.markdown``.
|
1868
|
+
|
1869
|
+
disabled: bool or None
|
1870
|
+
Whether editing should be disabled for this column. If this is ``None``
|
1871
|
+
(default), Streamlit will decide: indices are disabled and data columns
|
1872
|
+
are not.
|
1873
|
+
|
1874
|
+
If a column has mixed types, it may become uneditable regardless of
|
1875
|
+
``disabled``.
|
1876
|
+
|
1877
|
+
required: bool or None
|
1878
|
+
Whether edited cells in the column need to have a value. If this is
|
1879
|
+
``False`` (default), the user can submit empty values for this column.
|
1880
|
+
If this is ``True``, an edited cell in this column can only be
|
1881
|
+
submitted if its value is not ``None``, and a new row will only be
|
1882
|
+
submitted after the user fills in this column.
|
1883
|
+
|
1884
|
+
pinned: bool or None
|
1885
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
1886
|
+
left side no matter where the user scrolls. If this is ``None``
|
1887
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
1888
|
+
columns are not pinned.
|
1889
|
+
|
1890
|
+
default: datetime.date or None
|
1891
|
+
Specifies the default value in this column when a new row is added by
|
1892
|
+
the user. This defaults to ``None``.
|
1893
|
+
|
1894
|
+
format: str, "localized", "distance", "iso8601", or None
|
1895
|
+
A format string controlling how dates are displayed.
|
1896
|
+
This can be one of the following values:
|
1897
|
+
|
1898
|
+
- ``None`` (default): Show the date in ``"YYYY-MM-DD"`` format (e.g.
|
1899
|
+
"2025-03-04").
|
1900
|
+
- ``"localized"``: Show the date in the default locale format (e.g.
|
1901
|
+
"Mar 4, 2025" in the America/Los_Angeles timezone).
|
1902
|
+
- ``"distance"``: Show the date in a relative format (e.g.
|
1903
|
+
"a few seconds ago").
|
1904
|
+
- ``"iso8601"``: Show the date in ISO 8601 format (e.g.
|
1905
|
+
"2025-03-04").
|
1906
|
+
- A momentJS format string: Format the date with a string, like
|
1907
|
+
``"ddd, MMM Do"`` to show "Tue, Mar 4th". For available formats, see
|
1908
|
+
`momentJS <https://momentjs.com/docs/#/displaying/format/>`_.
|
1909
|
+
|
1910
|
+
Formatting from ``column_config`` always takes precedence over
|
1911
|
+
formatting from ``pandas.Styler``. The formatting does not impact the
|
1912
|
+
return value when used in ``st.data_editor``.
|
1913
|
+
|
1914
|
+
min_value: datetime.date or None
|
1915
|
+
The minimum date that can be entered. If this is ``None`` (default),
|
1916
|
+
there will be no minimum.
|
1917
|
+
|
1918
|
+
max_value: datetime.date or None
|
1919
|
+
The maximum date that can be entered. If this is ``None`` (default),
|
1920
|
+
there will be no maximum.
|
1921
|
+
|
1922
|
+
step: int or None
|
1923
|
+
The stepping interval in days. If this is ``None`` (default), the step
|
1924
|
+
will be 1 day.
|
1925
|
+
|
1926
|
+
Examples
|
1927
|
+
--------
|
1928
|
+
|
1929
|
+
>>> from datetime import date
|
1930
|
+
>>> import pandas as pd
|
1931
|
+
>>> import streamlit as st
|
1932
|
+
>>>
|
1933
|
+
>>> data_df = pd.DataFrame(
|
1934
|
+
>>> {
|
1935
|
+
>>> "birthday": [
|
1936
|
+
>>> date(1980, 1, 1),
|
1937
|
+
>>> date(1990, 5, 3),
|
1938
|
+
>>> date(1974, 5, 19),
|
1939
|
+
>>> date(2001, 8, 17),
|
1940
|
+
>>> ]
|
1941
|
+
>>> }
|
1942
|
+
>>> )
|
1943
|
+
>>>
|
1944
|
+
>>> st.data_editor(
|
1945
|
+
>>> data_df,
|
1946
|
+
>>> column_config={
|
1947
|
+
>>> "birthday": st.column_config.DateColumn(
|
1948
|
+
>>> "Birthday",
|
1949
|
+
>>> min_value=date(1900, 1, 1),
|
1950
|
+
>>> max_value=date(2005, 1, 1),
|
1951
|
+
>>> format="DD.MM.YYYY",
|
1952
|
+
>>> step=1,
|
1953
|
+
>>> ),
|
1954
|
+
>>> },
|
1955
|
+
>>> hide_index=True,
|
1956
|
+
>>> )
|
1957
|
+
|
1958
|
+
.. output::
|
1959
|
+
https://doc-date-column.streamlit.app/
|
1960
|
+
height: 300px
|
1961
|
+
"""
|
1962
|
+
return ColumnConfig(
|
1963
|
+
label=label,
|
1964
|
+
width=width,
|
1965
|
+
help=help,
|
1966
|
+
disabled=disabled,
|
1967
|
+
required=required,
|
1968
|
+
pinned=pinned,
|
1969
|
+
default=None if default is None else default.isoformat(),
|
1970
|
+
type_config=DateColumnConfig(
|
1971
|
+
type="date",
|
1972
|
+
format=format,
|
1973
|
+
min_value=None if min_value is None else min_value.isoformat(),
|
1974
|
+
max_value=None if max_value is None else max_value.isoformat(),
|
1975
|
+
step=step,
|
1976
|
+
),
|
1977
|
+
)
|
1978
|
+
|
1979
|
+
|
1980
|
+
@gather_metrics("column_config.ProgressColumn")
|
1981
|
+
def ProgressColumn(
|
1982
|
+
label: str | None = None,
|
1983
|
+
*,
|
1984
|
+
width: ColumnWidth | None = None,
|
1985
|
+
help: str | None = None,
|
1986
|
+
pinned: bool | None = None,
|
1987
|
+
format: str | NumberFormat | None = None,
|
1988
|
+
min_value: int | float | None = None,
|
1989
|
+
max_value: int | float | None = None,
|
1990
|
+
) -> ColumnConfig:
|
1991
|
+
"""Configure a progress column in ``st.dataframe`` or ``st.data_editor``.
|
1992
|
+
|
1993
|
+
Cells need to contain a number. Progress columns are not editable at the moment.
|
1994
|
+
This command needs to be used in the ``column_config`` parameter of ``st.dataframe``
|
1995
|
+
or ``st.data_editor``.
|
1996
|
+
|
1997
|
+
Parameters
|
1998
|
+
----------
|
1999
|
+
|
2000
|
+
label: str or None
|
2001
|
+
The label shown at the top of the column. If this is ``None``
|
2002
|
+
(default), the column name is used.
|
2003
|
+
|
2004
|
+
width: "small", "medium", "large", or None
|
2005
|
+
The display width of the column. If this is ``None`` (default), the
|
2006
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
2007
|
+
one of the following:
|
2008
|
+
|
2009
|
+
- ``"small"``: 75px wide
|
2010
|
+
- ``"medium"``: 200px wide
|
2011
|
+
- ``"large"``: 400px wide
|
2012
|
+
|
2013
|
+
help: str or None
|
2014
|
+
A tooltip that gets displayed when hovering over the column label. If
|
2015
|
+
this is ``None`` (default), no tooltip is displayed.
|
2016
|
+
|
2017
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
2018
|
+
the Markdown directives described in the ``body`` parameter of
|
2019
|
+
``st.markdown``.
|
2020
|
+
|
2021
|
+
format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
|
2022
|
+
A format string controlling how the numbers are displayed.
|
2023
|
+
This can be one of the following values:
|
2024
|
+
|
2025
|
+
- ``None`` (default): Streamlit infers the formatting from the data.
|
2026
|
+
- ``"plain"``: Show the full number without any formatting (e.g. "1234.567").
|
2027
|
+
- ``"localized"``: Show the number in the default locale format (e.g. "1,234.567").
|
2028
|
+
- ``"percent"``: Show the number as a percentage (e.g. "123456.70%").
|
2029
|
+
- ``"dollar"``: Show the number as a dollar amount (e.g. "$1,234.57").
|
2030
|
+
- ``"euro"``: Show the number as a euro amount (e.g. "€1,234.57").
|
2031
|
+
- ``"accounting"``: Show the number in an accounting format (e.g. "1,234.00").
|
2032
|
+
- ``"compact"``: Show the number in a compact format (e.g. "1.2K").
|
2033
|
+
- ``"scientific"``: Show the number in scientific notation (e.g. "1.235E3").
|
2034
|
+
- ``"engineering"``: Show the number in engineering notation (e.g. "1.235E3").
|
2035
|
+
- printf-style format string: Format the number with a printf
|
2036
|
+
specifier, like ``"%d"`` to show a signed integer (e.g. "1234") or
|
2037
|
+
``"%X"`` to show an unsigned hexidecimal integer (e.g. "4D2"). You
|
2038
|
+
can also add prefixes and suffixes. To show British pounds, use
|
2039
|
+
``"£ %.2f"`` (e.g. "£ 1234.57"). For more information, see `sprint-js
|
2040
|
+
<https://github.com/alexei/sprintf.js?tab=readme-ov-file#format-specification>`_.
|
2041
|
+
|
2042
|
+
Number formatting from ``column_config`` always takes precedence over
|
2043
|
+
number formatting from ``pandas.Styler``. The number formatting does
|
2044
|
+
not impact the return value when used in ``st.data_editor``.
|
2045
|
+
|
2046
|
+
pinned: bool or None
|
2047
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
2048
|
+
left side no matter where the user scrolls. If this is ``None``
|
2049
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
2050
|
+
columns are not pinned.
|
2051
|
+
|
2052
|
+
min_value: int, float, or None
|
2053
|
+
The minimum value of the progress bar. If this is ``None`` (default),
|
2054
|
+
the minimum will be 0.
|
2055
|
+
|
2056
|
+
max_value: int, float, or None
|
2057
|
+
The maximum value of the progress bar. If this is ``None`` (default),
|
2058
|
+
the maximum will be 100 for integer values and 1.0 for float values.
|
2059
|
+
|
2060
|
+
Examples
|
2061
|
+
--------
|
2062
|
+
|
2063
|
+
>>> import pandas as pd
|
2064
|
+
>>> import streamlit as st
|
2065
|
+
>>>
|
2066
|
+
>>> data_df = pd.DataFrame(
|
2067
|
+
>>> {
|
2068
|
+
>>> "sales": [200, 550, 1000, 80],
|
2069
|
+
>>> }
|
2070
|
+
>>> )
|
2071
|
+
>>>
|
2072
|
+
>>> st.data_editor(
|
2073
|
+
>>> data_df,
|
2074
|
+
>>> column_config={
|
2075
|
+
>>> "sales": st.column_config.ProgressColumn(
|
2076
|
+
>>> "Sales volume",
|
2077
|
+
>>> help="The sales volume in USD",
|
2078
|
+
>>> format="$%f",
|
2079
|
+
>>> min_value=0,
|
2080
|
+
>>> max_value=1000,
|
2081
|
+
>>> ),
|
2082
|
+
>>> },
|
2083
|
+
>>> hide_index=True,
|
2084
|
+
>>> )
|
2085
|
+
|
2086
|
+
.. output::
|
2087
|
+
https://doc-progress-column.streamlit.app/
|
2088
|
+
height: 300px
|
2089
|
+
"""
|
2090
|
+
|
2091
|
+
return ColumnConfig(
|
2092
|
+
label=label,
|
2093
|
+
width=width,
|
2094
|
+
help=help,
|
2095
|
+
pinned=pinned,
|
2096
|
+
type_config=ProgressColumnConfig(
|
2097
|
+
type="progress",
|
2098
|
+
format=format,
|
2099
|
+
min_value=min_value,
|
2100
|
+
max_value=max_value,
|
2101
|
+
),
|
2102
|
+
)
|
2103
|
+
|
2104
|
+
|
2105
|
+
@gather_metrics("column_config.JsonColumn")
|
2106
|
+
def JsonColumn(
|
2107
|
+
label: str | None = None,
|
2108
|
+
*,
|
2109
|
+
width: ColumnWidth | None = None,
|
2110
|
+
help: str | None = None,
|
2111
|
+
pinned: bool | None = None,
|
2112
|
+
) -> ColumnConfig:
|
2113
|
+
"""Configure a JSON column in ``st.dataframe`` or ``st.data_editor``.
|
2114
|
+
|
2115
|
+
Cells need to contain JSON strings or JSON-compatible objects. JSON columns
|
2116
|
+
are not editable at the moment. This command needs to be used in the
|
2117
|
+
``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``.
|
2118
|
+
|
2119
|
+
Parameters
|
2120
|
+
----------
|
2121
|
+
|
2122
|
+
label: str or None
|
2123
|
+
The label shown at the top of the column. If this is ``None``
|
2124
|
+
(default), the column name is used.
|
2125
|
+
|
2126
|
+
width: "small", "medium", "large", or None
|
2127
|
+
The display width of the column. If this is ``None`` (default), the
|
2128
|
+
column will be sized to fit the cell contents. Otherwise, this can be
|
2129
|
+
one of the following:
|
2130
|
+
|
2131
|
+
- ``"small"``: 75px wide
|
2132
|
+
- ``"medium"``: 200px wide
|
2133
|
+
- ``"large"``: 400px wide
|
2134
|
+
|
2135
|
+
help: str or None
|
2136
|
+
A tooltip that gets displayed when hovering over the column label. If
|
2137
|
+
this is ``None`` (default), no tooltip is displayed.
|
2138
|
+
|
2139
|
+
The tooltip can optionally contain GitHub-flavored Markdown, including
|
2140
|
+
the Markdown directives described in the ``body`` parameter of
|
2141
|
+
``st.markdown``.
|
2142
|
+
|
2143
|
+
pinned: bool or None
|
2144
|
+
Whether the column is pinned. A pinned column will stay visible on the
|
2145
|
+
left side no matter where the user scrolls. If this is ``None``
|
2146
|
+
(default), Streamlit will decide: index columns are pinned, and data
|
2147
|
+
columns are not pinned.
|
2148
|
+
|
2149
|
+
Examples
|
2150
|
+
--------
|
2151
|
+
|
2152
|
+
>>> import pandas as pd
|
2153
|
+
>>> import streamlit as st
|
2154
|
+
>>>
|
2155
|
+
>>> data_df = pd.DataFrame(
|
2156
|
+
>>> {
|
2157
|
+
>>> "json": [
|
2158
|
+
>>> {"foo": "bar", "bar": "baz"},
|
2159
|
+
>>> {"foo": "baz", "bar": "qux"},
|
2160
|
+
>>> {"foo": "qux", "bar": "foo"},
|
2161
|
+
>>> None,
|
2162
|
+
>>> ],
|
2163
|
+
>>> }
|
2164
|
+
>>> )
|
2165
|
+
>>>
|
2166
|
+
>>> st.dataframe(
|
2167
|
+
>>> data_df,
|
2168
|
+
>>> column_config={
|
2169
|
+
>>> "json": st.column_config.JsonColumn(
|
2170
|
+
>>> "JSON Data",
|
2171
|
+
>>> help="JSON strings or objects",
|
2172
|
+
>>> width="large",
|
2173
|
+
>>> ),
|
2174
|
+
>>> },
|
2175
|
+
>>> hide_index=True,
|
2176
|
+
>>> )
|
2177
|
+
|
2178
|
+
.. output::
|
2179
|
+
https://doc-json-column.streamlit.app/
|
2180
|
+
height: 300px
|
2181
|
+
"""
|
2182
|
+
return ColumnConfig(
|
2183
|
+
label=label,
|
2184
|
+
width=width,
|
2185
|
+
help=help,
|
2186
|
+
pinned=pinned,
|
2187
|
+
type_config=JsonColumnConfig(type="json"),
|
2188
|
+
)
|