streamlit-nightly 1.41.2.dev20250202__py2.py3-none-any.whl → 1.42.1.dev20250205__py2.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/auth_util.py +2 -1
- streamlit/commands/echo.py +4 -1
- streamlit/commands/execution_control.py +3 -1
- streamlit/commands/page_config.py +2 -1
- streamlit/config.py +56 -25
- streamlit/config_option.py +3 -3
- streamlit/connections/snowflake_connection.py +22 -10
- streamlit/connections/snowpark_connection.py +2 -1
- streamlit/connections/util.py +4 -1
- streamlit/dataframe_util.py +3 -8
- streamlit/delta_generator.py +1 -1
- streamlit/elements/alert.py +32 -4
- streamlit/elements/arrow.py +28 -15
- streamlit/elements/code.py +4 -3
- streamlit/elements/deck_gl_json_chart.py +3 -4
- streamlit/elements/form.py +22 -4
- streamlit/elements/heading.py +21 -6
- streamlit/elements/image.py +12 -3
- streamlit/elements/layouts.py +9 -4
- streamlit/elements/lib/built_in_chart_utils.py +1 -3
- streamlit/elements/lib/color_util.py +7 -6
- streamlit/elements/lib/column_config_utils.py +4 -3
- streamlit/elements/lib/column_types.py +100 -33
- streamlit/elements/lib/dicttools.py +4 -1
- streamlit/elements/lib/event_utils.py +2 -2
- streamlit/elements/lib/file_uploader_utils.py +4 -1
- streamlit/elements/lib/image_utils.py +5 -4
- streamlit/elements/lib/options_selector_utils.py +4 -1
- streamlit/elements/lib/pandas_styler_utils.py +2 -1
- streamlit/elements/lib/policies.py +3 -1
- streamlit/elements/lib/utils.py +1 -1
- streamlit/elements/map.py +3 -1
- streamlit/elements/markdown.py +21 -7
- streamlit/elements/media.py +2 -2
- streamlit/elements/metric.py +8 -4
- streamlit/elements/plotly_chart.py +4 -5
- streamlit/elements/spinner.py +25 -3
- streamlit/elements/text.py +7 -2
- streamlit/elements/vega_charts.py +26 -22
- streamlit/elements/widgets/audio_input.py +8 -4
- streamlit/elements/widgets/button.py +29 -12
- streamlit/elements/widgets/button_group.py +29 -13
- streamlit/elements/widgets/camera_input.py +8 -4
- streamlit/elements/widgets/chat.py +1 -3
- streamlit/elements/widgets/checkbox.py +16 -8
- streamlit/elements/widgets/color_picker.py +8 -4
- streamlit/elements/widgets/data_editor.py +10 -14
- streamlit/elements/widgets/file_uploader.py +12 -6
- streamlit/elements/widgets/multiselect.py +10 -5
- streamlit/elements/widgets/number_input.py +8 -4
- streamlit/elements/widgets/radio.py +11 -5
- streamlit/elements/widgets/select_slider.py +12 -8
- streamlit/elements/widgets/selectbox.py +11 -5
- streamlit/elements/widgets/slider.py +19 -17
- streamlit/elements/widgets/text_widgets.py +16 -8
- streamlit/elements/widgets/time_widgets.py +21 -15
- streamlit/elements/write.py +60 -43
- streamlit/errors.py +1 -2
- streamlit/external/langchain/streamlit_callback_handler.py +3 -3
- streamlit/hello/animation_demo.py +1 -1
- streamlit/material_icon_names.py +1 -1
- streamlit/proto/NewSession_pb2.py +16 -16
- streamlit/proto/NewSession_pb2.pyi +30 -3
- streamlit/runtime/app_session.py +15 -15
- streamlit/runtime/caching/cached_message_replay.py +2 -1
- streamlit/runtime/caching/hashing.py +3 -2
- streamlit/runtime/context.py +2 -1
- streamlit/runtime/forward_msg_cache.py +3 -1
- streamlit/runtime/memory_session_storage.py +4 -1
- streamlit/runtime/memory_uploaded_file_manager.py +4 -1
- streamlit/runtime/runtime.py +6 -4
- streamlit/runtime/scriptrunner/script_runner.py +4 -3
- streamlit/runtime/scriptrunner_utils/script_run_context.py +2 -3
- streamlit/runtime/secrets.py +1 -5
- streamlit/runtime/state/common.py +2 -4
- streamlit/runtime/state/query_params.py +2 -1
- streamlit/runtime/state/query_params_proxy.py +2 -1
- streamlit/runtime/state/safe_session_state.py +3 -1
- streamlit/runtime/state/session_state.py +2 -5
- streamlit/runtime/state/session_state_proxy.py +2 -1
- streamlit/runtime/uploaded_file_manager.py +3 -1
- streamlit/runtime/websocket_session_manager.py +8 -8
- streamlit/static/index.html +2 -2
- streamlit/static/static/css/{index.mUTQuMqR.css → index.DpJG_94W.css} +1 -1
- streamlit/static/static/js/{FileDownload.esm.Cf3bITtP.js → FileDownload.esm.ShSIWsKj.js} +1 -1
- streamlit/static/static/js/FileDropzone.BFkJKygp.js +5 -0
- streamlit/static/static/js/{FormClearHelper.BgwPD1tD.js → FormClearHelper.Bue0QSIn.js} +1 -1
- streamlit/static/static/js/{Hooks.BMaXaj11.js → Hooks.kV16_k1-.js} +1 -1
- streamlit/static/static/js/{InputInstructions.qlsk9gvt.js → InputInstructions.DpG38kbY.js} +1 -1
- streamlit/static/static/js/ProgressBar.B_WJAIyy.js +2 -0
- streamlit/static/static/js/{RenderInPortalIfExists.Blpdplqk.js → RenderInPortalIfExists.CGAGPcQq.js} +1 -1
- streamlit/static/static/js/{Toolbar.DMhyNpv2.js → Toolbar.DBtrI961.js} +1 -1
- streamlit/static/static/js/axios.upsvKRUO.js +6 -0
- streamlit/static/static/js/{base-input.DyTEaESI.js → base-input.P8VGAZdC.js} +4 -4
- streamlit/static/static/js/{createSuper.B3rIhdpQ.js → createSuper.GYQHnroV.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.C9Q9Gy4e.js → data-grid-overlay-editor.B1sLTR3f.js} +1 -1
- streamlit/static/static/js/{downloader.BAMiKd1n.js → downloader.y-Ssi2d3.js} +1 -1
- streamlit/static/static/js/{es6.D82pr6dy.js → es6.DpUKmjxe.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CJwxqR7x.js → iframeResizer.contentWindow.BBjdpeP0.js} +1 -1
- streamlit/static/static/js/{index.zlHOKWDA.js → index.2bJmI0Ih.js} +1 -1
- streamlit/static/static/js/{index.CjFbbEE0.js → index.3k422wEU.js} +1 -1
- streamlit/static/static/js/{index.P5kx9um8.js → index.B11A7C7I.js} +5 -5
- streamlit/static/static/js/{index.DiZyaYeV.js → index.B7AJyWjy.js} +3 -3
- streamlit/static/static/js/index.B7aeIxns.js +1 -0
- streamlit/static/static/js/index.BRsob9Jp.js +1 -0
- streamlit/static/static/js/{index.BLCqXxIG.js → index.BVkJfCWM.js} +1 -1
- streamlit/static/static/js/{index.B3Wxz7wG.js → index.BW_6EVtw.js} +1 -1
- streamlit/static/static/js/index.Bkk4sBLz.js +1 -0
- streamlit/static/static/js/{index.BcAjRRAZ.js → index.BqiT_qyM.js} +1 -1
- streamlit/static/static/js/index.C-BkiutF.js +1 -0
- streamlit/static/static/js/{index.C4kPuKr4.js → index.C73Hi-mL.js} +1 -1
- streamlit/static/static/js/{index.BM_J1KkD.js → index.C8vyFGOc.js} +1 -1
- streamlit/static/static/js/{index.CF4stbIZ.js → index.CAQGqUJ5.js} +1 -1
- streamlit/static/static/js/index.CC_i5fnL.js +3 -0
- streamlit/static/static/js/index.CIkzV9zP.js +2 -0
- streamlit/static/static/js/index.CIwUls4J.js +1 -0
- streamlit/static/static/js/{index.TPHsScPF.js → index.CUzW8sZB.js} +1 -1
- streamlit/static/static/js/index.CVIsVMt0.js +1 -0
- streamlit/static/static/js/{index.yp4f0OMe.js → index.CZFA90VV.js} +2 -2
- streamlit/static/static/js/{index.5JFTbX2J.js → index.Cd8_b4vi.js} +1 -1
- streamlit/static/static/js/{index.BdEYCAFh.js → index.CoJayF2l.js} +1 -1
- streamlit/static/static/js/index.Cp60C2LQ.js +1 -0
- streamlit/static/static/js/index.D-Qsohh0.js +1 -0
- streamlit/static/static/js/index.D2i6l9uv.js +1 -0
- streamlit/static/static/js/{index.BZvQkTCS.js → index.D3PlNa4T.js} +1 -1
- streamlit/static/static/js/{index.8Q56Jjmk.js → index.D7HtU_R4.js} +1 -1
- streamlit/static/static/js/{index.BdlaxG49.js → index.DHOnt3Rd.js} +1 -1
- streamlit/static/static/js/index.DNKGONSt.js +1 -0
- streamlit/static/static/js/{index.Y84nTPW2.js → index.D_CViY1G.js} +1 -1
- streamlit/static/static/js/{index.D9yF6cxC.js → index.DdJR-Re7.js} +1 -1
- streamlit/static/static/js/index.DdaoJ1WZ.js +73 -0
- streamlit/static/static/js/{index.CoE1gpPQ.js → index.DsOZJLyF.js} +1 -1
- streamlit/static/static/js/{index.B7J6suR-.js → index.DuqdUleB.js} +200 -200
- streamlit/static/static/js/{index.NbimJbgq.js → index.GZ99DH1Q.js} +6 -6
- streamlit/static/static/js/{index.CC5oiyoV.js → index.OWYUy0bC.js} +2 -2
- streamlit/static/static/js/index.USVf5VUT.js +1 -0
- streamlit/static/static/js/{input.DRyjjTTH.js → input.BANuQoGH.js} +2 -2
- streamlit/static/static/js/{memory.C98yjNkk.js → memory.DTxlMbK7.js} +1 -1
- streamlit/static/static/js/{mergeWith.CLihEflw.js → mergeWith.CfihrnQo.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DozQhDJj.js → number-overlay-editor.BHsEp8VL.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DJ7-JsJc.js → possibleConstructorReturn.BErM7qST.js} +1 -1
- streamlit/static/static/js/{sandbox.0Tj4C46D.js → sandbox.BMuVLu80.js} +1 -1
- streamlit/static/static/js/{textarea.CUrV8-V3.js → textarea.CmSZv6UE.js} +2 -2
- streamlit/static/static/js/{timepicker.DEu3fwJe.js → timepicker.DsaAj0da.js} +4 -4
- streamlit/static/static/js/{toConsumableArray.C71OtXzK.js → toConsumableArray.DJs7oxRq.js} +1 -1
- streamlit/static/static/js/{uniqueId.CndDhnid.js → uniqueId.CVe3uxKs.js} +1 -1
- streamlit/static/static/js/useBasicWidgetState.D572sX2t.js +1 -0
- streamlit/static/static/js/{useOnInputChange.CvHbHWmy.js → useOnInputChange.D9rTVyjn.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.BLLyDFUF.js → withFullScreenWrapper.4QDrgZxA.js} +1 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.DcZbplWk.woff2 +0 -0
- streamlit/testing/v1/app_test.py +3 -1
- streamlit/testing/v1/element_tree.py +3 -4
- streamlit/testing/v1/local_script_runner.py +3 -3
- streamlit/type_util.py +11 -8
- streamlit/user_info.py +2 -3
- streamlit/watcher/path_watcher.py +4 -4
- streamlit/web/server/authlib_tornado_integration.py +3 -1
- streamlit/web/server/browser_websocket_handler.py +3 -1
- streamlit/web/server/routes.py +4 -1
- streamlit/web/server/server.py +2 -1
- {streamlit_nightly-1.41.2.dev20250202.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/METADATA +1 -2
- {streamlit_nightly-1.41.2.dev20250202.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/RECORD +166 -165
- streamlit/static/static/js/FileDropzone.B8wCqKiM.js +0 -5
- streamlit/static/static/js/ProgressBar.Di2oT-20.js +0 -2
- streamlit/static/static/js/index.B79cf7gS.js +0 -1
- streamlit/static/static/js/index.BBPZ3wsr.js +0 -1
- streamlit/static/static/js/index.BKahTKEx.js +0 -3
- streamlit/static/static/js/index.CSGfgCnQ.js +0 -1
- streamlit/static/static/js/index.CYMgsYSm.js +0 -1
- streamlit/static/static/js/index.CZjnqbcd.js +0 -73
- streamlit/static/static/js/index.C_4BuzGH.js +0 -1
- streamlit/static/static/js/index.CjiPq39N.js +0 -1
- streamlit/static/static/js/index.CjuTYYFG.js +0 -1
- streamlit/static/static/js/index.CqGcWpm5.js +0 -2
- streamlit/static/static/js/index.CuH7mftz.js +0 -1
- streamlit/static/static/js/index.DFJg1zHB.js +0 -1
- streamlit/static/static/js/index.Dm3nmdhh.js +0 -1
- streamlit/static/static/js/index.rrDohWOh.js +0 -1
- streamlit/static/static/js/useBasicWidgetState.DXLMTaiS.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.DzyB5T7Y.woff2 +0 -0
- {streamlit_nightly-1.41.2.dev20250202.data → streamlit_nightly-1.42.1.dev20250205.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.41.2.dev20250202.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.41.2.dev20250202.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.41.2.dev20250202.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/top_level.txt +0 -0
@@ -21,8 +21,6 @@ from typing import (
|
|
21
21
|
Any,
|
22
22
|
Callable,
|
23
23
|
Generic,
|
24
|
-
Sequence,
|
25
|
-
Tuple,
|
26
24
|
cast,
|
27
25
|
overload,
|
28
26
|
)
|
@@ -64,6 +62,8 @@ from streamlit.runtime.state.common import (
|
|
64
62
|
from streamlit.type_util import T, check_python_comparable
|
65
63
|
|
66
64
|
if TYPE_CHECKING:
|
65
|
+
from collections.abc import Sequence
|
66
|
+
|
67
67
|
from streamlit.delta_generator import DeltaGenerator
|
68
68
|
|
69
69
|
|
@@ -91,7 +91,7 @@ class SelectSliderSerde(Generic[T]):
|
|
91
91
|
|
92
92
|
# The widget always returns floats, so convert to ints before indexing
|
93
93
|
return_value: tuple[T, T] = cast(
|
94
|
-
|
94
|
+
tuple[T, T],
|
95
95
|
tuple(self.options[int(x)] for x in ui_value),
|
96
96
|
)
|
97
97
|
|
@@ -230,10 +230,14 @@ class SelectSliderMixin:
|
|
230
230
|
If this is omitted, a key will be generated for the widget
|
231
231
|
based on its content. No two widgets may have the same key.
|
232
232
|
|
233
|
-
help : str
|
234
|
-
|
235
|
-
|
236
|
-
``
|
233
|
+
help : str or None
|
234
|
+
A tooltip that gets displayed next to the widget label. Streamlit
|
235
|
+
only displays the tooltip when ``label_visibility="visible"``. If
|
236
|
+
this is ``None`` (default), no tooltip is displayed.
|
237
|
+
|
238
|
+
The tooltip can optionally contain GitHub-flavored Markdown,
|
239
|
+
including the Markdown directives described in the ``body``
|
240
|
+
parameter of ``st.markdown``.
|
237
241
|
|
238
242
|
on_change : callable
|
239
243
|
An optional callback invoked when this select_slider's value changes.
|
@@ -412,7 +416,7 @@ class SelectSliderMixin:
|
|
412
416
|
)
|
413
417
|
if isinstance(widget_state.value, tuple):
|
414
418
|
widget_state = maybe_coerce_enum_sequence(
|
415
|
-
cast(RegisterWidgetResult[
|
419
|
+
cast(RegisterWidgetResult[tuple[T, T]], widget_state), options, opt
|
416
420
|
)
|
417
421
|
else:
|
418
422
|
widget_state = maybe_coerce_enum(widget_state, options, opt)
|
@@ -15,7 +15,7 @@ from __future__ import annotations
|
|
15
15
|
|
16
16
|
from dataclasses import dataclass
|
17
17
|
from textwrap import dedent
|
18
|
-
from typing import TYPE_CHECKING, Any, Callable, Generic,
|
18
|
+
from typing import TYPE_CHECKING, Any, Callable, Generic, cast, overload
|
19
19
|
|
20
20
|
from streamlit.dataframe_util import OptionSequence, convert_anything_to_list
|
21
21
|
from streamlit.elements.lib.form_utils import current_form_id
|
@@ -49,6 +49,8 @@ from streamlit.type_util import (
|
|
49
49
|
)
|
50
50
|
|
51
51
|
if TYPE_CHECKING:
|
52
|
+
from collections.abc import Sequence
|
53
|
+
|
52
54
|
from streamlit.delta_generator import DeltaGenerator
|
53
55
|
|
54
56
|
|
@@ -175,10 +177,14 @@ class SelectboxMixin:
|
|
175
177
|
If this is omitted, a key will be generated for the widget
|
176
178
|
based on its content. No two widgets may have the same key.
|
177
179
|
|
178
|
-
help : str
|
179
|
-
|
180
|
-
|
181
|
-
``
|
180
|
+
help : str or None
|
181
|
+
A tooltip that gets displayed next to the widget label. Streamlit
|
182
|
+
only displays the tooltip when ``label_visibility="visible"``. If
|
183
|
+
this is ``None`` (default), no tooltip is displayed.
|
184
|
+
|
185
|
+
The tooltip can optionally contain GitHub-flavored Markdown,
|
186
|
+
including the Markdown directives described in the ``body``
|
187
|
+
parameter of ``st.markdown``.
|
182
188
|
|
183
189
|
on_change : callable
|
184
190
|
An optional callback invoked when this selectbox's value changes.
|
@@ -14,6 +14,7 @@
|
|
14
14
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
|
+
from collections.abc import Sequence
|
17
18
|
from dataclasses import dataclass
|
18
19
|
from datetime import date, datetime, time, timedelta, timezone, tzinfo
|
19
20
|
from numbers import Integral, Real
|
@@ -22,9 +23,6 @@ from typing import (
|
|
22
23
|
TYPE_CHECKING,
|
23
24
|
Any,
|
24
25
|
Final,
|
25
|
-
List,
|
26
|
-
Sequence,
|
27
|
-
Tuple,
|
28
26
|
TypeVar,
|
29
27
|
Union,
|
30
28
|
cast,
|
@@ -65,16 +63,16 @@ SliderNumericT = TypeVar("SliderNumericT", int, float)
|
|
65
63
|
SliderDatelikeT = TypeVar("SliderDatelikeT", date, time, datetime)
|
66
64
|
|
67
65
|
SliderNumericSpanT: TypeAlias = Union[
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
list[SliderNumericT],
|
67
|
+
tuple[()],
|
68
|
+
tuple[SliderNumericT],
|
69
|
+
tuple[SliderNumericT, SliderNumericT],
|
72
70
|
]
|
73
71
|
SliderDatelikeSpanT: TypeAlias = Union[
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
list[SliderDatelikeT],
|
73
|
+
tuple[()],
|
74
|
+
tuple[SliderDatelikeT],
|
75
|
+
tuple[SliderDatelikeT, SliderDatelikeT],
|
78
76
|
]
|
79
77
|
|
80
78
|
StepNumericT: TypeAlias = SliderNumericT
|
@@ -96,8 +94,8 @@ SliderValue: TypeAlias = Union[
|
|
96
94
|
]
|
97
95
|
SliderReturnGeneric: TypeAlias = Union[
|
98
96
|
SliderValueT,
|
99
|
-
|
100
|
-
|
97
|
+
tuple[SliderValueT],
|
98
|
+
tuple[SliderValueT, SliderValueT],
|
101
99
|
]
|
102
100
|
SliderReturn: TypeAlias = Union[
|
103
101
|
SliderReturnGeneric[int],
|
@@ -426,10 +424,14 @@ class SliderMixin:
|
|
426
424
|
If this is omitted, a key will be generated for the widget
|
427
425
|
based on its content. No two widgets may have the same key.
|
428
426
|
|
429
|
-
help : str
|
430
|
-
|
431
|
-
|
432
|
-
``
|
427
|
+
help : str or None
|
428
|
+
A tooltip that gets displayed next to the widget label. Streamlit
|
429
|
+
only displays the tooltip when ``label_visibility="visible"``. If
|
430
|
+
this is ``None`` (default), no tooltip is displayed.
|
431
|
+
|
432
|
+
The tooltip can optionally contain GitHub-flavored Markdown,
|
433
|
+
including the Markdown directives described in the ``body``
|
434
|
+
parameter of ``st.markdown``.
|
433
435
|
|
434
436
|
on_change : callable
|
435
437
|
An optional callback invoked when this slider's value changes.
|
@@ -176,10 +176,14 @@ class TextWidgetsMixin:
|
|
176
176
|
a regular text input), or "password" (for a text input that
|
177
177
|
masks the user's typed value). Defaults to "default".
|
178
178
|
|
179
|
-
help : str
|
180
|
-
|
181
|
-
|
182
|
-
``
|
179
|
+
help : str or None
|
180
|
+
A tooltip that gets displayed next to the widget label. Streamlit
|
181
|
+
only displays the tooltip when ``label_visibility="visible"``. If
|
182
|
+
this is ``None`` (default), no tooltip is displayed.
|
183
|
+
|
184
|
+
The tooltip can optionally contain GitHub-flavored Markdown,
|
185
|
+
including the Markdown directives described in the ``body``
|
186
|
+
parameter of ``st.markdown``.
|
183
187
|
|
184
188
|
autocomplete : str
|
185
189
|
An optional value that will be passed to the <input> element's
|
@@ -450,10 +454,14 @@ class TextWidgetsMixin:
|
|
450
454
|
If this is omitted, a key will be generated for the widget
|
451
455
|
based on its content. No two widgets may have the same key.
|
452
456
|
|
453
|
-
help : str
|
454
|
-
|
455
|
-
|
456
|
-
``
|
457
|
+
help : str or None
|
458
|
+
A tooltip that gets displayed next to the widget label. Streamlit
|
459
|
+
only displays the tooltip when ``label_visibility="visible"``. If
|
460
|
+
this is ``None`` (default), no tooltip is displayed.
|
461
|
+
|
462
|
+
The tooltip can optionally contain GitHub-flavored Markdown,
|
463
|
+
including the Markdown directives described in the ``body``
|
464
|
+
parameter of ``st.markdown``.
|
457
465
|
|
458
466
|
on_change : callable
|
459
467
|
An optional callback invoked when this text_area's value changes.
|
@@ -14,6 +14,7 @@
|
|
14
14
|
from __future__ import annotations
|
15
15
|
|
16
16
|
import re
|
17
|
+
from collections.abc import Sequence
|
17
18
|
from dataclasses import dataclass
|
18
19
|
from datetime import date, datetime, time, timedelta
|
19
20
|
from textwrap import dedent
|
@@ -21,10 +22,7 @@ from typing import (
|
|
21
22
|
TYPE_CHECKING,
|
22
23
|
Any,
|
23
24
|
Final,
|
24
|
-
List,
|
25
25
|
Literal,
|
26
|
-
Sequence,
|
27
|
-
Tuple,
|
28
26
|
Union,
|
29
27
|
cast,
|
30
28
|
overload,
|
@@ -72,9 +70,9 @@ DateValue: TypeAlias = Union[NullableScalarDateValue, Sequence[NullableScalarDat
|
|
72
70
|
|
73
71
|
# The return value of st.date_input.
|
74
72
|
DateWidgetRangeReturn: TypeAlias = Union[
|
75
|
-
|
76
|
-
|
77
|
-
|
73
|
+
tuple[()],
|
74
|
+
tuple[date],
|
75
|
+
tuple[date, date],
|
78
76
|
]
|
79
77
|
DateWidgetReturn: TypeAlias = Union[date, DateWidgetRangeReturn, None]
|
80
78
|
|
@@ -229,7 +227,7 @@ class _DateInputValues:
|
|
229
227
|
)
|
230
228
|
|
231
229
|
if value == "today":
|
232
|
-
v = cast(
|
230
|
+
v = cast(list[date], parsed_value)[0]
|
233
231
|
if v < parsed_min:
|
234
232
|
parsed_value = [parsed_min]
|
235
233
|
if v > parsed_max:
|
@@ -406,10 +404,14 @@ class TimeWidgetsMixin:
|
|
406
404
|
If this is omitted, a key will be generated for the widget
|
407
405
|
based on its content. No two widgets may have the same key.
|
408
406
|
|
409
|
-
help : str
|
410
|
-
|
411
|
-
|
412
|
-
``
|
407
|
+
help : str or None
|
408
|
+
A tooltip that gets displayed next to the widget label. Streamlit
|
409
|
+
only displays the tooltip when ``label_visibility="visible"``. If
|
410
|
+
this is ``None`` (default), no tooltip is displayed.
|
411
|
+
|
412
|
+
The tooltip can optionally contain GitHub-flavored Markdown,
|
413
|
+
including the Markdown directives described in the ``body``
|
414
|
+
parameter of ``st.markdown``.
|
413
415
|
|
414
416
|
on_change : callable
|
415
417
|
An optional callback invoked when this time_input's value changes.
|
@@ -716,10 +718,14 @@ class TimeWidgetsMixin:
|
|
716
718
|
If this is omitted, a key will be generated for the widget
|
717
719
|
based on its content. No two widgets may have the same key.
|
718
720
|
|
719
|
-
help : str
|
720
|
-
|
721
|
-
|
722
|
-
``
|
721
|
+
help : str or None
|
722
|
+
A tooltip that gets displayed next to the widget label. Streamlit
|
723
|
+
only displays the tooltip when ``label_visibility="visible"``. If
|
724
|
+
this is ``None`` (default), no tooltip is displayed.
|
725
|
+
|
726
|
+
The tooltip can optionally contain GitHub-flavored Markdown,
|
727
|
+
including the Markdown directives described in the ``body``
|
728
|
+
parameter of ``st.markdown``.
|
723
729
|
|
724
730
|
on_change : callable
|
725
731
|
An optional callback invoked when this date_input's value changes.
|
streamlit/elements/write.py
CHANGED
@@ -18,17 +18,20 @@ import dataclasses
|
|
18
18
|
import inspect
|
19
19
|
import types
|
20
20
|
from collections import ChainMap, UserDict, UserList
|
21
|
-
from collections.abc import
|
21
|
+
from collections.abc import (
|
22
|
+
AsyncGenerator,
|
23
|
+
Generator,
|
24
|
+
ItemsView,
|
25
|
+
Iterable,
|
26
|
+
KeysView,
|
27
|
+
ValuesView,
|
28
|
+
)
|
22
29
|
from io import StringIO
|
23
30
|
from typing import (
|
24
31
|
TYPE_CHECKING,
|
25
32
|
Any,
|
26
|
-
AsyncGenerator,
|
27
33
|
Callable,
|
28
34
|
Final,
|
29
|
-
Generator,
|
30
|
-
Iterable,
|
31
|
-
List,
|
32
35
|
cast,
|
33
36
|
)
|
34
37
|
|
@@ -58,7 +61,7 @@ _LOGGER: Final = get_logger(__name__)
|
|
58
61
|
_TEXT_CURSOR: Final = " ▏"
|
59
62
|
|
60
63
|
|
61
|
-
class StreamingOutput(
|
64
|
+
class StreamingOutput(list[Any]):
|
62
65
|
pass
|
63
66
|
|
64
67
|
|
@@ -251,48 +254,59 @@ class WriteMixin:
|
|
251
254
|
|
252
255
|
@gather_metrics("write")
|
253
256
|
def write(self, *args: Any, unsafe_allow_html: bool = False, **kwargs) -> None:
|
254
|
-
"""
|
257
|
+
"""Displays arguments in the app.
|
255
258
|
|
256
259
|
This is the Swiss Army knife of Streamlit commands: it does different
|
257
|
-
things depending on what you throw at it. Unlike other Streamlit
|
258
|
-
write() has some unique properties:
|
260
|
+
things depending on what you throw at it. Unlike other Streamlit
|
261
|
+
commands, ``st.write()`` has some unique properties:
|
259
262
|
|
260
|
-
|
261
|
-
|
262
|
-
3. It returns None, so its "slot" in the App cannot be reused.
|
263
|
+
- You can pass in multiple arguments, all of which will be displayed.
|
264
|
+
- Its behavior depends on the input type(s).
|
263
265
|
|
264
266
|
Parameters
|
265
267
|
----------
|
266
268
|
*args : any
|
267
|
-
One or many objects to
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
269
|
+
One or many objects to display in the app.
|
270
|
+
|
271
|
+
.. list-table:: Each type of argument is handled as follows:
|
272
|
+
:header-rows: 1
|
273
|
+
|
274
|
+
* - Type
|
275
|
+
- Handling
|
276
|
+
* - ``str``
|
277
|
+
- Uses ``st.markdown()``.
|
278
|
+
* - dataframe-like, ``dict``, or ``list``
|
279
|
+
- Uses ``st.dataframe()``.
|
280
|
+
* - ``Exception``
|
281
|
+
- Uses ``st.exception()``.
|
282
|
+
* - function, module, or class
|
283
|
+
- Uses ``st.help()``.
|
284
|
+
* - ``DeltaGenerator``
|
285
|
+
- Uses ``st.help()``.
|
286
|
+
* - Altair chart
|
287
|
+
- Uses ``st.altair_chart()``.
|
288
|
+
* - Bokeh figure
|
289
|
+
- Uses ``st.bokeh_chart()``.
|
290
|
+
* - Graphviz graph
|
291
|
+
- Uses ``st.graphviz_chart()``.
|
292
|
+
* - Keras model
|
293
|
+
- Converts model and uses ``st.graphviz_chart()``.
|
294
|
+
* - Matplotlib figure
|
295
|
+
- Uses ``st.pyplot()``.
|
296
|
+
* - Plotly figure
|
297
|
+
- Uses ``st.plotly_chart()``.
|
298
|
+
* - ``PIL.Image``
|
299
|
+
- Uses ``st.image()``.
|
300
|
+
* - generator or stream (like ``openai.Stream``)
|
301
|
+
- Uses ``st.write_stream()``.
|
302
|
+
* - SymPy expression
|
303
|
+
- Uses ``st.latex()``.
|
304
|
+
* - An object with ``._repr_html()``
|
305
|
+
- Uses ``st.html()``.
|
306
|
+
* - Database cursor
|
307
|
+
- Displays DB API 2.0 cursor results in a table.
|
308
|
+
* - Any
|
309
|
+
- Displays ``str(arg)`` as inline code.
|
296
310
|
|
297
311
|
unsafe_allow_html : bool
|
298
312
|
Whether to render HTML within ``*args``. This only applies to
|
@@ -316,9 +330,12 @@ class WriteMixin:
|
|
316
330
|
Use other, more specific Streamlit commands to pass additional
|
317
331
|
keyword arguments.
|
318
332
|
|
319
|
-
|
320
|
-
Example
|
333
|
+
Returns
|
321
334
|
-------
|
335
|
+
None
|
336
|
+
|
337
|
+
Examples
|
338
|
+
--------
|
322
339
|
|
323
340
|
Its basic use case is to draw Markdown-formatted text, whenever the
|
324
341
|
input is a string:
|
streamlit/errors.py
CHANGED
@@ -154,8 +154,7 @@ class StreamlitModuleNotFoundError(StreamlitAPIWarning):
|
|
154
154
|
|
155
155
|
def __init__(self, module_name, *args):
|
156
156
|
message = (
|
157
|
-
f'This Streamlit command requires module "{module_name}" '
|
158
|
-
"to be installed."
|
157
|
+
f'This Streamlit command requires module "{module_name}" to be installed.'
|
159
158
|
)
|
160
159
|
super().__init__(message, *args)
|
161
160
|
|
@@ -246,9 +246,9 @@ class LLMThought:
|
|
246
246
|
def complete(self, final_label: str | None = None) -> None:
|
247
247
|
"""Finish the thought."""
|
248
248
|
if final_label is None and self._state == LLMThoughtState.RUNNING_TOOL:
|
249
|
-
assert (
|
250
|
-
|
251
|
-
)
|
249
|
+
assert self._last_tool is not None, (
|
250
|
+
"_last_tool should never be null when _state == RUNNING_TOOL"
|
251
|
+
)
|
252
252
|
final_label = self._labeler.get_tool_label(
|
253
253
|
self._last_tool, is_complete=True
|
254
254
|
)
|
@@ -74,7 +74,7 @@ st.title("Animation demo")
|
|
74
74
|
st.write(
|
75
75
|
"""
|
76
76
|
This app shows how you can use Streamlit to build cool animations.
|
77
|
-
It displays an animated fractal based on the
|
77
|
+
It displays an animated fractal based on the Julia Set. Use the slider
|
78
78
|
to tune different parameters.
|
79
79
|
"""
|
80
80
|
)
|