streamlit-nightly 1.42.1.dev20250216__py2.py3-none-any.whl → 1.42.2.dev20250218__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/elements/bokeh_chart.py +5 -4
- streamlit/elements/graphviz_chart.py +2 -3
- streamlit/elements/lib/column_types.py +97 -44
- streamlit/elements/lib/subtitle_utils.py +2 -2
- streamlit/elements/lib/utils.py +1 -2
- streamlit/elements/vega_charts.py +2 -5
- streamlit/runtime/caching/cache_utils.py +2 -3
- streamlit/runtime/caching/hashing.py +1 -2
- streamlit/runtime/forward_msg_cache.py +1 -5
- streamlit/runtime/fragment.py +3 -5
- streamlit/runtime/memory_media_file_storage.py +1 -2
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.K0RIIaSL.js → FileDownload.esm.DU-1rCSB.js} +1 -1
- streamlit/static/static/js/{FileDropzone.DRcTUuNN.js → FileDropzone.BI3MGDdT.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.Dha_cfuU.js → FormClearHelper.DzU-mNjk.js} +1 -1
- streamlit/static/static/js/{Hooks.BrulV197.js → Hooks.qUbVZL-A.js} +1 -1
- streamlit/static/static/js/{InputInstructions.C_m6JNSV.js → InputInstructions.CpNPMMpX.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CXgDz0lS.js → ProgressBar.4yIafGOA.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.DbjYtj_E.js → RenderInPortalIfExists.31NYBozH.js} +1 -1
- streamlit/static/static/js/{Toolbar.B5RomQbU.js → Toolbar.lnT7wtEH.js} +1 -1
- streamlit/static/static/js/{base-input.B_U9Mij-.js → base-input.DYDwDBVN.js} +4 -4
- streamlit/static/static/js/{createSuper.DiPn7x2M.js → createSuper.CP_bqXkl.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CxpMznuV.js → data-grid-overlay-editor.Bw6S-08j.js} +1 -1
- streamlit/static/static/js/{downloader.CMxfwi0g.js → downloader.DZpOwdni.js} +1 -1
- streamlit/static/static/js/{es6.CWDfc2yc.js → es6.D670kkuw.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CyCMpBzy.js → iframeResizer.contentWindow.CBWvp4oS.js} +1 -1
- streamlit/static/static/js/{index.CLXysuIS.js → index.-wGNsvT9.js} +1 -1
- streamlit/static/static/js/{index.CmyE8x29.js → index.0jzSLI-x.js} +2 -2
- streamlit/static/static/js/index.8M0nMTyK.js +1 -0
- streamlit/static/static/js/index.B-Bz2NGO.js +1 -0
- streamlit/static/static/js/index.B6KnC7nW.js +1 -0
- streamlit/static/static/js/index.B9mk7o4G.js +3 -0
- streamlit/static/static/js/index.BCorV1AX.js +1 -0
- streamlit/static/static/js/index.BMlBBPxY.js +9 -0
- streamlit/static/static/js/index.BhTUDBBK.js +1 -0
- streamlit/static/static/js/index.Bif_gpeX.js +1 -0
- streamlit/static/static/js/index.BkURA4Nq.js +3 -0
- streamlit/static/static/js/index.Byj6qntv.js +2 -0
- streamlit/static/static/js/index.C0O8ISw8.js +1 -0
- streamlit/static/static/js/index.C5VAa8DZ.js +1 -0
- streamlit/static/static/js/{index.FVzOj77v.js → index.CA6bEd5D.js} +10 -10
- streamlit/static/static/js/{index.XB-MiuZp.js → index.CD53GuKN.js} +1 -1
- streamlit/static/static/js/index.CKT6gwZG.js +2 -0
- streamlit/static/static/js/{index.DeuQX1T6.js → index.CLsHMaqe.js} +17 -17
- streamlit/static/static/js/index.Ch1c3KR1.js +1 -0
- streamlit/static/static/js/{index.CnzapoES.js → index.ChIZFRw0.js} +1 -1
- streamlit/static/static/js/{index.68LnD3a5.js → index.CrYKK91g.js} +63 -63
- streamlit/static/static/js/index.Cvgj5_qB.js +1 -0
- streamlit/static/static/js/{index.Ctuil2Zq.js → index.D3VdaBwP.js} +1 -1
- streamlit/static/static/js/{index.BW9gD4O1.js → index.D6UL3iMZ.js} +82 -82
- streamlit/static/static/js/index.D8aCPmhr.js +1 -0
- streamlit/static/static/js/{index.B7-ka68B.js → index.DHBu5iL6.js} +2 -2
- streamlit/static/static/js/index.DJF89pFO.js +1 -0
- streamlit/static/static/js/{index.CxT-55oh.js → index.DNEGP5ih.js} +1 -1
- streamlit/static/static/js/index.DRJutLeV.js +1 -0
- streamlit/static/static/js/{index.CZjrVNQ3.js → index.DS38XxzV.js} +1 -1
- streamlit/static/static/js/index.DdeHhk74.js +1 -0
- streamlit/static/static/js/index.De5HitMn.js +1 -0
- streamlit/static/static/js/index.DsvnAu-2.js +1 -0
- streamlit/static/static/js/index.Du4f6P1i.js +1 -0
- streamlit/static/static/js/index.HCbHLWBq.js +1 -0
- streamlit/static/static/js/index.XAUdgEdp.js +1 -0
- streamlit/static/static/js/{index.vyj1usur.js → index.edlGQJ3v.js} +28 -28
- streamlit/static/static/js/{input.D-b9-dhW.js → input.e-37_Dj1.js} +1 -1
- streamlit/static/static/js/{memory.C27_0JRm.js → memory.B5p-2jga.js} +1 -1
- streamlit/static/static/js/{mergeWith.D8F46YVj.js → mergeWith.D8nk5iJa.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CaHpEyvW.js → number-overlay-editor.DLD5-9zx.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CnSJ4CFa.js → possibleConstructorReturn.eeV6HB6T.js} +1 -1
- streamlit/static/static/js/{sandbox.Cx5mAMmC.js → sandbox.ChKquq8J.js} +1 -1
- streamlit/static/static/js/{textarea.YeGMY3Ts.js → textarea.ZI_0MUsX.js} +1 -1
- streamlit/static/static/js/{timepicker.BSApuR_7.js → timepicker.C8N66VUc.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DFJurSxu.js → toConsumableArray.DKg00cRh.js} +1 -1
- streamlit/static/static/js/{uniqueId.B4ugkryR.js → uniqueId.fc9w8X88.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.e9cw5rKa.js → useBasicWidgetState.CySX_BlM.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CHDPgswc.js → useOnInputChange.BF6Trlh5.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.x2WsM7iA.js +1 -0
- streamlit/testing/v1/app_test.py +2 -4
- streamlit/util.py +6 -9
- streamlit/watcher/util.py +2 -7
- streamlit/web/server/app_static_file_handler.py +17 -1
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/RECORD +86 -86
- streamlit/static/static/js/index.11KmKkMp.js +0 -1
- streamlit/static/static/js/index.B5QCo4O8.js +0 -1
- streamlit/static/static/js/index.B9xlEQvM.js +0 -3
- streamlit/static/static/js/index.Bb_vborY.js +0 -1
- streamlit/static/static/js/index.BoLiyuG0.js +0 -1
- streamlit/static/static/js/index.CBswNuTs.js +0 -1
- streamlit/static/static/js/index.CGHmjGTj.js +0 -1
- streamlit/static/static/js/index.CMM3vxd_.js +0 -1
- streamlit/static/static/js/index.CTrIDSw5.js +0 -1
- streamlit/static/static/js/index.CrDkQv4h.js +0 -1
- streamlit/static/static/js/index.CxX3WJZV.js +0 -9
- streamlit/static/static/js/index.D4y-ZpWF.js +0 -3
- streamlit/static/static/js/index.DUqWz4q7.js +0 -1
- streamlit/static/static/js/index.DaR46enR.js +0 -1
- streamlit/static/static/js/index.DcCioSks.js +0 -2
- streamlit/static/static/js/index.Di8ddb5O.js +0 -1
- streamlit/static/static/js/index.Djk5RccG.js +0 -1
- streamlit/static/static/js/index.DsPUu3xS.js +0 -2
- streamlit/static/static/js/index.FjL8doTL.js +0 -1
- streamlit/static/static/js/index.OiKVkRzb.js +0 -1
- streamlit/static/static/js/index.YBzhCbWe.js +0 -1
- streamlit/static/static/js/index.ZlPieA63.js +0 -1
- streamlit/static/static/js/index.eP8uJaty.js +0 -1
- streamlit/static/static/js/index.fz6QTJde.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.BKBYrOn-.js +0 -1
- {streamlit_nightly-1.42.1.dev20250216.data → streamlit_nightly-1.42.2.dev20250218.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/top_level.txt +0 -0
@@ -16,14 +16,13 @@
|
|
16
16
|
|
17
17
|
from __future__ import annotations
|
18
18
|
|
19
|
-
import hashlib
|
20
19
|
import json
|
21
20
|
from typing import TYPE_CHECKING, Final, cast
|
22
21
|
|
23
22
|
from streamlit.errors import StreamlitAPIException
|
24
23
|
from streamlit.proto.BokehChart_pb2 import BokehChart as BokehChartProto
|
25
24
|
from streamlit.runtime.metrics_util import gather_metrics
|
26
|
-
from streamlit.util import
|
25
|
+
from streamlit.util import calc_md5
|
27
26
|
|
28
27
|
if TYPE_CHECKING:
|
29
28
|
from bokeh.plotting.figure import Figure
|
@@ -91,13 +90,15 @@ class BokehMixin:
|
|
91
90
|
f"Streamlit only supports Bokeh version {ST_BOKEH_VERSION}, "
|
92
91
|
f"but you have version {bokeh.__version__} installed. Please "
|
93
92
|
f"run `pip install --force-reinstall --no-deps bokeh=="
|
94
|
-
f"{ST_BOKEH_VERSION}` to install the correct version
|
93
|
+
f"{ST_BOKEH_VERSION}` to install the correct version.\n\n\n"
|
94
|
+
f"To use the latest version of Bokeh, install our custom component, "
|
95
|
+
f"[streamlit-bokeh](https://github.com/streamlit/streamlit-bokeh)."
|
95
96
|
)
|
96
97
|
|
97
98
|
# Generate element ID from delta path
|
98
99
|
delta_path = self.dg._get_delta_path_str()
|
99
100
|
|
100
|
-
element_id =
|
101
|
+
element_id = calc_md5(delta_path.encode())
|
101
102
|
bokeh_chart_proto = BokehChartProto()
|
102
103
|
marshall(bokeh_chart_proto, figure, use_container_width, element_id)
|
103
104
|
return self.dg._enqueue("bokeh_chart", bokeh_chart_proto)
|
@@ -16,7 +16,6 @@
|
|
16
16
|
|
17
17
|
from __future__ import annotations
|
18
18
|
|
19
|
-
import hashlib
|
20
19
|
from typing import TYPE_CHECKING, Union, cast
|
21
20
|
|
22
21
|
from typing_extensions import TypeAlias
|
@@ -25,7 +24,7 @@ from streamlit import type_util
|
|
25
24
|
from streamlit.errors import StreamlitAPIException
|
26
25
|
from streamlit.proto.GraphVizChart_pb2 import GraphVizChart as GraphVizChartProto
|
27
26
|
from streamlit.runtime.metrics_util import gather_metrics
|
28
|
-
from streamlit.util import
|
27
|
+
from streamlit.util import calc_md5
|
29
28
|
|
30
29
|
if TYPE_CHECKING:
|
31
30
|
import graphviz
|
@@ -110,7 +109,7 @@ class GraphvizMixin:
|
|
110
109
|
"""
|
111
110
|
# Generate element ID from delta path
|
112
111
|
delta_path = self.dg._get_delta_path_str()
|
113
|
-
element_id =
|
112
|
+
element_id = calc_md5(delta_path.encode())
|
114
113
|
|
115
114
|
graphviz_chart_proto = GraphVizChartProto()
|
116
115
|
|
@@ -24,6 +24,18 @@ from streamlit.runtime.metrics_util import gather_metrics
|
|
24
24
|
if TYPE_CHECKING:
|
25
25
|
from collections.abc import Iterable
|
26
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
|
+
|
27
39
|
ColumnWidth: TypeAlias = Literal["small", "medium", "large"]
|
28
40
|
|
29
41
|
# Type alias that represents all available column types
|
@@ -49,7 +61,7 @@ ColumnType: TypeAlias = Literal[
|
|
49
61
|
|
50
62
|
class NumberColumnConfig(TypedDict):
|
51
63
|
type: Literal["number"]
|
52
|
-
format: NotRequired[str | None]
|
64
|
+
format: NotRequired[str | NumberFormat | None]
|
53
65
|
min_value: NotRequired[int | float | None]
|
54
66
|
max_value: NotRequired[int | float | None]
|
55
67
|
step: NotRequired[int | float | None]
|
@@ -105,7 +117,9 @@ class ListColumnConfig(TypedDict):
|
|
105
117
|
|
106
118
|
class DatetimeColumnConfig(TypedDict):
|
107
119
|
type: Literal["datetime"]
|
108
|
-
format: NotRequired[
|
120
|
+
format: NotRequired[
|
121
|
+
str | Literal["localized", "distance", "calendar", "iso8601"] | None
|
122
|
+
]
|
109
123
|
min_value: NotRequired[str | None]
|
110
124
|
max_value: NotRequired[str | None]
|
111
125
|
step: NotRequired[int | float | None]
|
@@ -114,7 +128,7 @@ class DatetimeColumnConfig(TypedDict):
|
|
114
128
|
|
115
129
|
class TimeColumnConfig(TypedDict):
|
116
130
|
type: Literal["time"]
|
117
|
-
format: NotRequired[str | None]
|
131
|
+
format: NotRequired[str | Literal["localized", "iso8601"] | None]
|
118
132
|
min_value: NotRequired[str | None]
|
119
133
|
max_value: NotRequired[str | None]
|
120
134
|
step: NotRequired[int | float | None]
|
@@ -122,7 +136,7 @@ class TimeColumnConfig(TypedDict):
|
|
122
136
|
|
123
137
|
class DateColumnConfig(TypedDict):
|
124
138
|
type: Literal["date"]
|
125
|
-
format: NotRequired[str | None]
|
139
|
+
format: NotRequired[str | Literal["localized", "distance", "iso8601"] | None]
|
126
140
|
min_value: NotRequired[str | None]
|
127
141
|
max_value: NotRequired[str | None]
|
128
142
|
step: NotRequired[int | None]
|
@@ -130,7 +144,7 @@ class DateColumnConfig(TypedDict):
|
|
130
144
|
|
131
145
|
class ProgressColumnConfig(TypedDict):
|
132
146
|
type: Literal["progress"]
|
133
|
-
format: NotRequired[str | None]
|
147
|
+
format: NotRequired[str | NumberFormat | None]
|
134
148
|
min_value: NotRequired[int | float | None]
|
135
149
|
max_value: NotRequired[int | float | None]
|
136
150
|
|
@@ -337,7 +351,7 @@ def NumberColumn(
|
|
337
351
|
required: bool | None = None,
|
338
352
|
pinned: bool | None = None,
|
339
353
|
default: int | float | None = None,
|
340
|
-
format: str | None = None,
|
354
|
+
format: str | NumberFormat | None = None,
|
341
355
|
min_value: int | float | None = None,
|
342
356
|
max_value: int | float | None = None,
|
343
357
|
step: int | float | None = None,
|
@@ -397,15 +411,27 @@ def NumberColumn(
|
|
397
411
|
Specifies the default value in this column when a new row is added by
|
398
412
|
the user. This defaults to ``None``.
|
399
413
|
|
400
|
-
format:
|
401
|
-
A
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
414
|
+
format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
|
415
|
+
A format string controlling how numbers are displayed.
|
416
|
+
Can be one of the following:
|
417
|
+
|
418
|
+
- ``"plain"``: Shows the full number without any formatting (1234.567)
|
419
|
+
- ``"localized"``: Shows the number in the default locale format (1,234.567)
|
420
|
+
- ``"percent"``: Shows the number as a percentage (123456.70%)
|
421
|
+
- ``"dollar"``: Shows the number as a dollar amount ($1,234.57)
|
422
|
+
- ``"euro"``: Shows the number as a euro amount (€1,234.57)
|
423
|
+
- ``"accounting"``: Shows the number in an accounting format (1,234.00)
|
424
|
+
- ``"compact"``: Shows the number in a compact format (1.2K)
|
425
|
+
- ``"scientific"``: Shows the number in a scientific notation (1.235E3)
|
426
|
+
- ``"engineering"``: Shows the number in an engineering notation (1.235E3)
|
427
|
+
- printf-style format string: The following formatters are valid:
|
428
|
+
``%d``, ``%e``, ``%f``, ``%g``, ``%i``, ``%u``. You can also add
|
429
|
+
prefixes and suffixes, e.g. ``"$ %.2f"`` to show a dollar prefix.
|
430
|
+
- ``None`` (default): the numbers are formatted via a default formatter.
|
406
431
|
|
407
432
|
Number formatting from ``column_config`` always takes precedence over
|
408
|
-
number formatting from ``pandas.Styler``.
|
433
|
+
number formatting from ``pandas.Styler``. The number formatting does
|
434
|
+
not impact the return value when used in ``st.data_editor``.
|
409
435
|
|
410
436
|
min_value: int, float, or None
|
411
437
|
The minimum value that can be entered. If this is ``None`` (default),
|
@@ -1475,7 +1501,7 @@ def DatetimeColumn(
|
|
1475
1501
|
required: bool | None = None,
|
1476
1502
|
pinned: bool | None = None,
|
1477
1503
|
default: datetime.datetime | None = None,
|
1478
|
-
format: str | None = None,
|
1504
|
+
format: str | Literal["localized", "distance", "calendar", "iso8601"] | None = None,
|
1479
1505
|
min_value: datetime.datetime | None = None,
|
1480
1506
|
max_value: datetime.datetime | None = None,
|
1481
1507
|
step: int | float | datetime.timedelta | None = None,
|
@@ -1537,14 +1563,20 @@ def DatetimeColumn(
|
|
1537
1563
|
Specifies the default value in this column when a new row is added by
|
1538
1564
|
the user. This defaults to ``None``.
|
1539
1565
|
|
1540
|
-
format: str or None
|
1541
|
-
A
|
1542
|
-
|
1543
|
-
available formats. If this is ``None`` (default), the format is
|
1544
|
-
``YYYY-MM-DD HH:mm:ss``.
|
1566
|
+
format: str, "localized", "distance", "calendar", "iso8601", or None
|
1567
|
+
A format string controlling how datetimes are displayed.
|
1568
|
+
Can be one of the following:
|
1545
1569
|
|
1546
|
-
|
1547
|
-
|
1570
|
+
- ``"localized"``: Shows the datetime in the default locale format.
|
1571
|
+
- ``"distance"``: Shows the datetime in a relative format.
|
1572
|
+
- ``"calendar"``: Shows the datetime in a calendar format.
|
1573
|
+
- ``"iso8601"``: Shows the datetime in ISO 8601 format.
|
1574
|
+
- A momentJS format string: See `momentJS docs <https://momentjs.com/docs/#/displaying/format/>`_
|
1575
|
+
for available formats.
|
1576
|
+
- ``None`` (default): uses ``YYYY-MM-DD HH:mm:ss`` as format.
|
1577
|
+
|
1578
|
+
Formatting from ``column_config`` always takes precedence over
|
1579
|
+
datetime formatting from ``pandas.Styler``.
|
1548
1580
|
|
1549
1581
|
min_value: datetime.datetime or None
|
1550
1582
|
The minimum datetime that can be entered. If this is ``None``
|
@@ -1628,7 +1660,7 @@ def TimeColumn(
|
|
1628
1660
|
required: bool | None = None,
|
1629
1661
|
pinned: bool | None = None,
|
1630
1662
|
default: datetime.time | None = None,
|
1631
|
-
format: str | None = None,
|
1663
|
+
format: str | Literal["localized", "iso8601"] | None = None,
|
1632
1664
|
min_value: datetime.time | None = None,
|
1633
1665
|
max_value: datetime.time | None = None,
|
1634
1666
|
step: int | float | datetime.timedelta | None = None,
|
@@ -1688,14 +1720,17 @@ def TimeColumn(
|
|
1688
1720
|
Specifies the default value in this column when a new row is added by
|
1689
1721
|
the user. This defaults to ``None``.
|
1690
1722
|
|
1691
|
-
format: str or None
|
1692
|
-
A
|
1693
|
-
|
1694
|
-
|
1695
|
-
``
|
1723
|
+
format: str, "localized", "iso8601", or None
|
1724
|
+
A format string controlling how times are displayed.
|
1725
|
+
Can be one of the following:
|
1726
|
+
- ``"localized"``: Shows the time in the default locale format.
|
1727
|
+
- ``"iso8601"``: Shows the time in ISO 8601 format.
|
1728
|
+
- A momentJS format string: See `momentJS docs <https://momentjs.com/docs/#/displaying/format/>`_
|
1729
|
+
for available formats.
|
1730
|
+
- ``None`` (default): uses ``HH:mm:ss`` as format.
|
1696
1731
|
|
1697
|
-
|
1698
|
-
|
1732
|
+
Time formatting from ``column_config`` always takes precedence over
|
1733
|
+
time formatting from ``pandas.Styler``.
|
1699
1734
|
|
1700
1735
|
min_value: datetime.time or None
|
1701
1736
|
The minimum time that can be entered. If this is ``None`` (default),
|
@@ -1774,7 +1809,7 @@ def DateColumn(
|
|
1774
1809
|
required: bool | None = None,
|
1775
1810
|
pinned: bool | None = None,
|
1776
1811
|
default: datetime.date | None = None,
|
1777
|
-
format: str | None = None,
|
1812
|
+
format: str | Literal["localized", "distance", "iso8601"] | None = None,
|
1778
1813
|
min_value: datetime.date | None = None,
|
1779
1814
|
max_value: datetime.date | None = None,
|
1780
1815
|
step: int | None = None,
|
@@ -1834,14 +1869,18 @@ def DateColumn(
|
|
1834
1869
|
Specifies the default value in this column when a new row is added by
|
1835
1870
|
the user. This defaults to ``None``.
|
1836
1871
|
|
1837
|
-
format: str or None
|
1838
|
-
A
|
1839
|
-
|
1840
|
-
|
1841
|
-
``
|
1872
|
+
format: str, "localized", "distance", "iso8601", or None
|
1873
|
+
A format string controlling how the dates are displayed.
|
1874
|
+
Can be one of the following:
|
1875
|
+
- ``"localized"``: Shows the date in the default locale format.
|
1876
|
+
- ``"distance"``: Shows the date in a relative format (e.g. "1 day ago").
|
1877
|
+
- ``"iso8601"``: Shows the date in ISO 8601 format.
|
1878
|
+
- A momentJS format string: See `momentJS docs <https://momentjs.com/docs/#/displaying/format/>`_
|
1879
|
+
for available formats.
|
1880
|
+
- ``None`` (default): uses ``YYYY-MM-DD`` as format.
|
1842
1881
|
|
1843
|
-
|
1844
|
-
|
1882
|
+
Date formatting from ``column_config`` always takes precedence over
|
1883
|
+
date formatting from ``pandas.Styler``.
|
1845
1884
|
|
1846
1885
|
min_value: datetime.date or None
|
1847
1886
|
The minimum date that can be entered. If this is ``None`` (default),
|
@@ -1916,7 +1955,7 @@ def ProgressColumn(
|
|
1916
1955
|
width: ColumnWidth | None = None,
|
1917
1956
|
help: str | None = None,
|
1918
1957
|
pinned: bool | None = None,
|
1919
|
-
format: str | None = None,
|
1958
|
+
format: str | NumberFormat | None = None,
|
1920
1959
|
min_value: int | float | None = None,
|
1921
1960
|
max_value: int | float | None = None,
|
1922
1961
|
) -> ColumnConfig:
|
@@ -1950,12 +1989,26 @@ def ProgressColumn(
|
|
1950
1989
|
the Markdown directives described in the ``body`` parameter of
|
1951
1990
|
``st.markdown``.
|
1952
1991
|
|
1953
|
-
format: str or None
|
1954
|
-
A
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1992
|
+
format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
|
1993
|
+
A format string controlling how numbers are displayed.
|
1994
|
+
Can be one of the following:
|
1995
|
+
|
1996
|
+
- ``"plain"``: Shows the full number without any formatting (1234.567)
|
1997
|
+
- ``"localized"``: Shows the number in the default locale format (1,234.567)
|
1998
|
+
- ``"percent"``: Shows the number as a percentage (123456.70%)
|
1999
|
+
- ``"dollar"``: Shows the number as a dollar amount ($1,234.57)
|
2000
|
+
- ``"euro"``: Shows the number as a euro amount (€1,234.57)
|
2001
|
+
- ``"accounting"``: Shows the number in an accounting format (1,234.00)
|
2002
|
+
- ``"compact"``: Shows the number in a compact format (1.2K)
|
2003
|
+
- ``"scientific"``: Shows the number in a scientific notation (1.235E3)
|
2004
|
+
- ``"engineering"``: Shows the number in an engineering notation (1.235E3)
|
2005
|
+
- printf-style format string: The following formatters are valid:
|
2006
|
+
``%d``, ``%e``, ``%f``, ``%g``, ``%i``, ``%u``. You can also add
|
2007
|
+
prefixes and suffixes, e.g. ``"$ %.2f"`` to show a dollar prefix.
|
2008
|
+
- ``None`` (default): the numbers are formatted via a default formatter.
|
2009
|
+
|
2010
|
+
The number formatting does not impact the return value when used in
|
2011
|
+
``st.data_editor``.
|
1959
2012
|
|
1960
2013
|
pinned: bool or None
|
1961
2014
|
Whether the column is pinned. A pinned column will stay visible on the
|
@@ -14,7 +14,6 @@
|
|
14
14
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
|
-
import hashlib
|
18
17
|
import io
|
19
18
|
import os
|
20
19
|
import re
|
@@ -22,6 +21,7 @@ from pathlib import Path
|
|
22
21
|
|
23
22
|
from streamlit import runtime
|
24
23
|
from streamlit.runtime import caching
|
24
|
+
from streamlit.util import calc_md5
|
25
25
|
|
26
26
|
# Regular expression to match the SRT timestamp format
|
27
27
|
# It matches the
|
@@ -161,7 +161,7 @@ def process_subtitle_data(
|
|
161
161
|
raise TypeError(f"Invalid binary data format for subtitle: {type(data)}.")
|
162
162
|
|
163
163
|
if runtime.exists():
|
164
|
-
filename =
|
164
|
+
filename = calc_md5(label.encode())
|
165
165
|
# Save the processed data and return the file URL
|
166
166
|
file_url = runtime.get_instance().media_file_mgr.add(
|
167
167
|
path_or_data=subtitle_data,
|
streamlit/elements/lib/utils.py
CHANGED
@@ -40,7 +40,6 @@ from streamlit.runtime.state.common import (
|
|
40
40
|
TESTING_KEY,
|
41
41
|
user_key_from_element_id,
|
42
42
|
)
|
43
|
-
from streamlit.util import HASHLIB_KWARGS
|
44
43
|
|
45
44
|
if TYPE_CHECKING:
|
46
45
|
from builtins import ellipsis
|
@@ -164,7 +163,7 @@ def _compute_element_id(
|
|
164
163
|
use it to be distinct. The element ID includes an easily identified prefix, and the
|
165
164
|
user_key as a suffix, to make it easy to identify it and know if a key maps to it.
|
166
165
|
"""
|
167
|
-
h = hashlib.new("md5",
|
166
|
+
h = hashlib.new("md5", usedforsecurity=False)
|
168
167
|
h.update(element_type.encode("utf-8"))
|
169
168
|
if user_key:
|
170
169
|
# Adding this to the hash isn't necessary for uniqueness since the
|
@@ -16,7 +16,6 @@
|
|
16
16
|
|
17
17
|
from __future__ import annotations
|
18
18
|
|
19
|
-
import hashlib
|
20
19
|
import json
|
21
20
|
import re
|
22
21
|
from contextlib import nullcontext
|
@@ -54,7 +53,7 @@ from streamlit.proto.ArrowVegaLiteChart_pb2 import (
|
|
54
53
|
from streamlit.runtime.metrics_util import gather_metrics
|
55
54
|
from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx
|
56
55
|
from streamlit.runtime.state import WidgetCallback, register_widget
|
57
|
-
from streamlit.util import
|
56
|
+
from streamlit.util import calc_md5
|
58
57
|
|
59
58
|
if TYPE_CHECKING:
|
60
59
|
from collections.abc import Iterable, Sequence
|
@@ -355,9 +354,7 @@ def _convert_altair_to_vega_lite_spec(
|
|
355
354
|
# dataset name:
|
356
355
|
data_bytes = dataframe_util.convert_anything_to_arrow_bytes(data)
|
357
356
|
# Use the md5 hash of the data as the name:
|
358
|
-
|
359
|
-
h.update(str(data_bytes).encode("utf-8"))
|
360
|
-
name = h.hexdigest()
|
357
|
+
name = calc_md5(str(data_bytes))
|
361
358
|
|
362
359
|
datasets[name] = data_bytes
|
363
360
|
return {"name": name}
|
@@ -49,7 +49,6 @@ from streamlit.runtime.caching.hashing import HashFuncsDict, update_hash
|
|
49
49
|
from streamlit.runtime.scriptrunner_utils.script_run_context import (
|
50
50
|
in_cached_function,
|
51
51
|
)
|
52
|
-
from streamlit.util import HASHLIB_KWARGS
|
53
52
|
|
54
53
|
if TYPE_CHECKING:
|
55
54
|
from types import FunctionType
|
@@ -430,7 +429,7 @@ def _make_value_key(
|
|
430
429
|
# Create the hash from each arg value, except for those args whose name
|
431
430
|
# starts with "_". (Underscore-prefixed args are deliberately excluded from
|
432
431
|
# hashing.)
|
433
|
-
args_hasher = hashlib.new("md5",
|
432
|
+
args_hasher = hashlib.new("md5", usedforsecurity=False)
|
434
433
|
for arg_name, arg_value in arg_pairs:
|
435
434
|
if arg_name is not None and arg_name.startswith("_"):
|
436
435
|
_LOGGER.debug("Not hashing %s because it starts with _", arg_name)
|
@@ -468,7 +467,7 @@ def _make_function_key(cache_type: CacheType, func: FunctionType) -> str:
|
|
468
467
|
A function's key is stable across reruns of the app, and changes when
|
469
468
|
the function's source code changes.
|
470
469
|
"""
|
471
|
-
func_hasher = hashlib.new("md5",
|
470
|
+
func_hasher = hashlib.new("md5", usedforsecurity=False)
|
472
471
|
|
473
472
|
# Include the function's __module__ and __qualname__ strings in the hash.
|
474
473
|
# This means that two identical functions in different modules
|
@@ -43,7 +43,6 @@ from streamlit.errors import StreamlitAPIException
|
|
43
43
|
from streamlit.runtime.caching.cache_errors import UnhashableTypeError
|
44
44
|
from streamlit.runtime.caching.cache_type import CacheType
|
45
45
|
from streamlit.runtime.uploaded_file_manager import UploadedFile
|
46
|
-
from streamlit.util import HASHLIB_KWARGS
|
47
46
|
|
48
47
|
# If a dataframe has more than this many rows, we consider it large and hash a sample.
|
49
48
|
_PANDAS_ROWS_LARGE: Final = 100000
|
@@ -351,7 +350,7 @@ class _CacheFuncHasher:
|
|
351
350
|
runs.
|
352
351
|
"""
|
353
352
|
|
354
|
-
h = hashlib.new("md5",
|
353
|
+
h = hashlib.new("md5", usedforsecurity=False)
|
355
354
|
|
356
355
|
if type_util.is_type(obj, "unittest.mock.Mock") or type_util.is_type(
|
357
356
|
obj, "unittest.mock.MagicMock"
|
@@ -14,7 +14,6 @@
|
|
14
14
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
|
-
import hashlib
|
18
17
|
from typing import TYPE_CHECKING, Final
|
19
18
|
from weakref import WeakKeyDictionary
|
20
19
|
|
@@ -22,7 +21,6 @@ from streamlit import config, util
|
|
22
21
|
from streamlit.logger import get_logger
|
23
22
|
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
|
24
23
|
from streamlit.runtime.stats import CacheStat, CacheStatsProvider, group_stats
|
25
|
-
from streamlit.util import HASHLIB_KWARGS
|
26
24
|
|
27
25
|
if TYPE_CHECKING:
|
28
26
|
from collections.abc import MutableMapping
|
@@ -56,9 +54,7 @@ def populate_hash_if_needed(msg: ForwardMsg) -> str:
|
|
56
54
|
msg.ClearField("metadata")
|
57
55
|
|
58
56
|
# MD5 is good enough for what we need, which is uniqueness.
|
59
|
-
|
60
|
-
hasher.update(msg.SerializeToString())
|
61
|
-
msg.hash = hasher.hexdigest()
|
57
|
+
msg.hash = util.calc_md5(msg.SerializeToString())
|
62
58
|
|
63
59
|
# Restore metadata.
|
64
60
|
msg.metadata.CopyFrom(metadata)
|
streamlit/runtime/fragment.py
CHANGED
@@ -15,7 +15,6 @@
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
17
|
import contextlib
|
18
|
-
import hashlib
|
19
18
|
import inspect
|
20
19
|
from abc import abstractmethod
|
21
20
|
from copy import deepcopy
|
@@ -36,6 +35,7 @@ from streamlit.runtime.scriptrunner_utils.exceptions import (
|
|
36
35
|
)
|
37
36
|
from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx
|
38
37
|
from streamlit.time_util import time_to_seconds
|
38
|
+
from streamlit.util import calc_md5
|
39
39
|
|
40
40
|
if TYPE_CHECKING:
|
41
41
|
from datetime import timedelta
|
@@ -167,11 +167,9 @@ def _fragment(
|
|
167
167
|
|
168
168
|
cursors_snapshot = deepcopy(ctx.cursors)
|
169
169
|
dg_stack_snapshot = deepcopy(context_dg_stack.get())
|
170
|
-
|
171
|
-
|
172
|
-
f"{non_optional_func.__module__}.{non_optional_func.__qualname__}{dg_stack_snapshot[-1]._get_delta_path_str()}{additional_hash_info}".encode()
|
170
|
+
fragment_id = calc_md5(
|
171
|
+
f"{non_optional_func.__module__}.{non_optional_func.__qualname__}{dg_stack_snapshot[-1]._get_delta_path_str()}{additional_hash_info}"
|
173
172
|
)
|
174
|
-
fragment_id = h.hexdigest()
|
175
173
|
|
176
174
|
# We intentionally want to capture the active script hash here to ensure
|
177
175
|
# that the fragment is associated with the correct script running.
|
@@ -29,7 +29,6 @@ from streamlit.runtime.media_file_storage import (
|
|
29
29
|
MediaFileStorageError,
|
30
30
|
)
|
31
31
|
from streamlit.runtime.stats import CacheStat, CacheStatsProvider, group_stats
|
32
|
-
from streamlit.util import HASHLIB_KWARGS
|
33
32
|
|
34
33
|
_LOGGER: Final = get_logger(__name__)
|
35
34
|
|
@@ -55,7 +54,7 @@ def _calculate_file_id(data: bytes, mimetype: str, filename: str | None = None)
|
|
55
54
|
filename
|
56
55
|
Any string. Will be converted to bytes and used to compute a hash.
|
57
56
|
"""
|
58
|
-
filehash = hashlib.new("sha224",
|
57
|
+
filehash = hashlib.new("sha224", usedforsecurity=False)
|
59
58
|
filehash.update(data)
|
60
59
|
filehash.update(bytes(mimetype.encode()))
|
61
60
|
|
streamlit/static/index.html
CHANGED
@@ -51,7 +51,7 @@
|
|
51
51
|
<script>
|
52
52
|
window.prerenderReady = false
|
53
53
|
</script>
|
54
|
-
<script type="module" crossorigin src="./static/js/index.
|
54
|
+
<script type="module" crossorigin src="./static/js/index.CLsHMaqe.js"></script>
|
55
55
|
<link rel="stylesheet" crossorigin href="./static/css/index.DpJG_94W.css">
|
56
56
|
</head>
|
57
57
|
<body>
|
@@ -1 +1 @@
|
|
1
|
-
import{r as e,E as n,_ as a}from"./index.
|
1
|
+
import{r as e,E as n,_ as a}from"./index.CLsHMaqe.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};
|