streamlit-nightly 1.42.3.dev20250227__py2.py3-none-any.whl → 1.42.3.dev20250228__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/arrow.py +6 -5
- streamlit/elements/lib/column_types.py +101 -70
- streamlit/elements/widgets/button.py +13 -2
- streamlit/elements/widgets/data_editor.py +6 -5
- streamlit/elements/widgets/number_input.py +3 -2
- streamlit/elements/widgets/slider.py +11 -3
- streamlit/runtime/context.py +47 -2
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.rdZtCw5-.js → FileDownload.esm.BjRCwIvW.js} +1 -1
- streamlit/static/static/js/{FileHelper.BztOEKJy.js → FileHelper.CGrcmoNK.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.Drd1fMJc.js → FormClearHelper.CyjIZnZM.js} +1 -1
- streamlit/static/static/js/{Hooks.DWd0hyk4.js → Hooks.-DbiQ7Am.js} +1 -1
- streamlit/static/static/js/{InputInstructions.B7xrWTG0.js → InputInstructions.CV_L9pmm.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CBgJiTH-.js → ProgressBar.BMUfDSdU.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.US28tQOn.js → RenderInPortalIfExists.DBak2tzf.js} +1 -1
- streamlit/static/static/js/{Toolbar.CAOt-xaL.js → Toolbar.BpCHhFl7.js} +1 -1
- streamlit/static/static/js/{base-input.CauNaJqr.js → base-input.B4K7gn3m.js} +1 -1
- streamlit/static/static/js/{checkbox.ChzWCtre.js → checkbox.CAX7YHDZ.js} +1 -1
- streamlit/static/static/js/{createSuper.D_39RJB6.js → createSuper.D9gT0sOi.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.rIelkOVS.js → data-grid-overlay-editor.gLdGVwGm.js} +1 -1
- streamlit/static/static/js/{downloader.Dz5I28nG.js → downloader.DcsU6eyn.js} +1 -1
- streamlit/static/static/js/{es6.DwnEjMMn.js → es6.dTL0Du7U.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.BRiRifwd.js → iframeResizer.contentWindow.flH1YmDM.js} +1 -1
- streamlit/static/static/js/{index.D9rv1PQ0.js → index.-WtL21xT.js} +1 -1
- streamlit/static/static/js/{index.BWeYb5ES.js → index.B0VH6CCN.js} +1 -1
- streamlit/static/static/js/{index.pvQjxG7y.js → index.B6RoN18x.js} +1 -1
- streamlit/static/static/js/{index.DkgVNhWs.js → index.B7TcBuqC.js} +1 -1
- streamlit/static/static/js/{index.CM12P2T1.js → index.BCg2ff_8.js} +2 -2
- streamlit/static/static/js/{index.CUz1_nAm.js → index.BFxZ-0WR.js} +1 -1
- streamlit/static/static/js/{index.CO3dZWKG.js → index.BJIOzTyr.js} +1 -1
- streamlit/static/static/js/{index.Dzp8iBkF.js → index.BMUI3dle.js} +1 -1
- streamlit/static/static/js/{index.DfNAkKAr.js → index.BUNYdCvS.js} +8 -8
- streamlit/static/static/js/{index.DWFLx6Tc.js → index.BV2qQuMO.js} +5 -5
- streamlit/static/static/js/{index.D1K6NCBQ.js → index.BX8IgiDA.js} +1 -1
- streamlit/static/static/js/{index.DYUhWSq6.js → index.BYdIAAme.js} +1 -1
- streamlit/static/static/js/{index.CoUzNoRf.js → index.BzXJd4o6.js} +1 -1
- streamlit/static/static/js/{index.aL_kqyvR.js → index.BzxT1LSG.js} +1 -1
- streamlit/static/static/js/{index.CmYiLKNX.js → index.CHfW08Eb.js} +1 -1
- streamlit/static/static/js/{index.BUdhIGhT.js → index.CWFsehBI.js} +1 -1
- streamlit/static/static/js/{index.LL2DLZZA.js → index.C_m4U-ik.js} +2 -2
- streamlit/static/static/js/{index.ORHz8Y8P.js → index.CgbCWpVz.js} +8 -8
- streamlit/static/static/js/{index.V3Vj2d9m.js → index.ChXmN16b.js} +1 -1
- streamlit/static/static/js/{index.YNWoT4uW.js → index.D-_iawK3.js} +1 -1
- streamlit/static/static/js/{index.C_C365T5.js → index.D7qPBPzh.js} +1 -1
- streamlit/static/static/js/{index.fP6rBxlc.js → index.D9Gtya_A.js} +1 -1
- streamlit/static/static/js/{index.DJvwxFLn.js → index.D9jWe5tN.js} +1 -1
- streamlit/static/static/js/{index.Db3jGJxa.js → index.DB-0Yu8-.js} +1 -1
- streamlit/static/static/js/{index.D2xM-XzG.js → index.DGu65w1V.js} +3 -3
- streamlit/static/static/js/index.DIHkG0HG.js +12 -0
- streamlit/static/static/js/{index.CBre8Aui.js → index.DIgKi8Bp.js} +1 -1
- streamlit/static/static/js/{index.BrAW6bFJ.js → index.DbiiV9to.js} +1 -1
- streamlit/static/static/js/{index.DgNQKEeQ.js → index.DgSb0EiE.js} +1 -1
- streamlit/static/static/js/{index.Ct7MPsA3.js → index.DkoFwjhv.js} +1 -1
- streamlit/static/static/js/{index.wxpL02VY.js → index.DwAnNzqz.js} +1 -1
- streamlit/static/static/js/{index.DIeegLbv.js → index.PrjikacM.js} +1 -1
- streamlit/static/static/js/{index.Dj91melR.js → index.QEh4WZkI.js} +1 -1
- streamlit/static/static/js/{index.CAHGh74D.js → index.iqovFu7V.js} +1 -1
- streamlit/static/static/js/{index.DkKZlAsv.js → index.mRpR0u1n.js} +1 -1
- streamlit/static/static/js/{index.BE6MTF-B.js → index.u-XgtJxJ.js} +3 -3
- streamlit/static/static/js/{index.DKuQg2D4.js → index.y-qJHV46.js} +1 -1
- streamlit/static/static/js/{input.D_dn5-2t.js → input.DqgaXn2o.js} +1 -1
- streamlit/static/static/js/{memory.pnMTtWQR.js → memory.DszNDPLb.js} +1 -1
- streamlit/static/static/js/{mergeWith.CRrYodeI.js → mergeWith.DFTSkXIf.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.C65GBS2P.js → number-overlay-editor.C8_ha9YJ.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.BnQk7lq_.js → possibleConstructorReturn.cS4Ei6et.js} +1 -1
- streamlit/static/static/js/{sandbox.CrxXt1li.js → sandbox.Bj-BfqPP.js} +1 -1
- streamlit/static/static/js/{textarea.DiFyO5JY.js → textarea.BrvMyGxB.js} +1 -1
- streamlit/static/static/js/{timepicker.B1Y7LIk4.js → timepicker.Ds8_GzH8.js} +2 -2
- streamlit/static/static/js/{toConsumableArray.BWpBUK-j.js → toConsumableArray.RfoD5uEy.js} +1 -1
- streamlit/static/static/js/{uniqueId.7ecIUkUs.js → uniqueId.R_vr2E5T.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.deG0KPm0.js → useBasicWidgetState.Cglgg1W1.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CQ7sD7CO.js → useOnInputChange.CFTHBDsA.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.D0wnBu3k.js → withFullScreenWrapper.BcyXoen-.js} +1 -1
- streamlit/user_info.py +3 -0
- {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/RECORD +80 -80
- streamlit/static/static/js/index.Bb4OB39A.js +0 -12
- {streamlit_nightly-1.42.3.dev20250227.data → streamlit_nightly-1.42.3.dev20250228.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/top_level.txt +0 -0
streamlit/elements/arrow.py
CHANGED
@@ -331,10 +331,10 @@ class ArrowMixin:
|
|
331
331
|
|
332
332
|
use_container_width : bool
|
333
333
|
Whether to override ``width`` with the width of the parent
|
334
|
-
container. If
|
335
|
-
|
336
|
-
|
337
|
-
|
334
|
+
container. If this is ``True`` (default), Streamlit sets the width
|
335
|
+
of the dataframe to match the width of the parent container. If
|
336
|
+
this is ``False``, Streamlit sets the dataframe's width according
|
337
|
+
to ``width``.
|
338
338
|
|
339
339
|
hide_index : bool or None
|
340
340
|
Whether to hide the index column(s). If ``hide_index`` is ``None``
|
@@ -421,7 +421,8 @@ class ArrowMixin:
|
|
421
421
|
|
422
422
|
row_height : int or None
|
423
423
|
The height of each row in the dataframe in pixels. If ``row_height``
|
424
|
-
is ``None`` (default), Streamlit will use a default row height
|
424
|
+
is ``None`` (default), Streamlit will use a default row height,
|
425
|
+
which fits one line of text.
|
425
426
|
|
426
427
|
Returns
|
427
428
|
-------
|
@@ -419,25 +419,28 @@ def NumberColumn(
|
|
419
419
|
|
420
420
|
format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
|
421
421
|
A format string controlling how numbers are displayed.
|
422
|
-
|
423
|
-
|
424
|
-
- ``
|
425
|
-
- ``"
|
426
|
-
- ``"
|
427
|
-
- ``"
|
428
|
-
- ``"
|
429
|
-
- ``"
|
430
|
-
- ``"
|
431
|
-
- ``"
|
432
|
-
- ``"
|
433
|
-
-
|
434
|
-
|
435
|
-
|
436
|
-
|
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>`_.
|
437
440
|
|
438
|
-
|
439
|
-
|
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``.
|
441
444
|
|
442
445
|
min_value: int, float, or None
|
443
446
|
The minimum value that can be entered. If this is ``None`` (default),
|
@@ -1571,18 +1574,25 @@ def DatetimeColumn(
|
|
1571
1574
|
|
1572
1575
|
format: str, "localized", "distance", "calendar", "iso8601", or None
|
1573
1576
|
A format string controlling how datetimes are displayed.
|
1574
|
-
|
1575
|
-
|
1576
|
-
- ``
|
1577
|
-
|
1578
|
-
- ``"
|
1579
|
-
|
1580
|
-
-
|
1581
|
-
|
1582
|
-
- ``
|
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/>`_.
|
1583
1592
|
|
1584
1593
|
Formatting from ``column_config`` always takes precedence over
|
1585
|
-
|
1594
|
+
formatting from ``pandas.Styler``. The formatting does not impact the
|
1595
|
+
return value when used in ``st.data_editor``.
|
1586
1596
|
|
1587
1597
|
min_value: datetime.datetime or None
|
1588
1598
|
The minimum datetime that can be entered. If this is ``None``
|
@@ -1728,15 +1738,21 @@ def TimeColumn(
|
|
1728
1738
|
|
1729
1739
|
format: str, "localized", "iso8601", or None
|
1730
1740
|
A format string controlling how times are displayed.
|
1731
|
-
|
1732
|
-
|
1733
|
-
- ``
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
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/>`_.
|
1737
1752
|
|
1738
|
-
|
1739
|
-
|
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``.
|
1740
1756
|
|
1741
1757
|
min_value: datetime.time or None
|
1742
1758
|
The minimum time that can be entered. If this is ``None`` (default),
|
@@ -1876,17 +1892,24 @@ def DateColumn(
|
|
1876
1892
|
the user. This defaults to ``None``.
|
1877
1893
|
|
1878
1894
|
format: str, "localized", "distance", "iso8601", or None
|
1879
|
-
A format string controlling how
|
1880
|
-
|
1881
|
-
|
1882
|
-
- ``
|
1883
|
-
|
1884
|
-
-
|
1885
|
-
|
1886
|
-
- ``
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
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``.
|
1890
1913
|
|
1891
1914
|
min_value: datetime.date or None
|
1892
1915
|
The minimum date that can be entered. If this is ``None`` (default),
|
@@ -1996,25 +2019,29 @@ def ProgressColumn(
|
|
1996
2019
|
``st.markdown``.
|
1997
2020
|
|
1998
2021
|
format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
|
1999
|
-
A format string controlling how numbers are displayed.
|
2000
|
-
|
2001
|
-
|
2002
|
-
- ``
|
2003
|
-
- ``"
|
2004
|
-
- ``"
|
2005
|
-
- ``"
|
2006
|
-
- ``"
|
2007
|
-
- ``"
|
2008
|
-
- ``"
|
2009
|
-
- ``"
|
2010
|
-
- ``"
|
2011
|
-
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
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``.
|
2018
2045
|
|
2019
2046
|
pinned: bool or None
|
2020
2047
|
Whether the column is pinned. A pinned column will stay visible on the
|
@@ -2085,8 +2112,8 @@ def JsonColumn(
|
|
2085
2112
|
) -> ColumnConfig:
|
2086
2113
|
"""Configure a JSON column in ``st.dataframe`` or ``st.data_editor``.
|
2087
2114
|
|
2088
|
-
Cells need to contain
|
2089
|
-
|
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
|
2090
2117
|
``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``.
|
2091
2118
|
|
2092
2119
|
Parameters
|
@@ -2106,8 +2133,12 @@ def JsonColumn(
|
|
2106
2133
|
- ``"large"``: 400px wide
|
2107
2134
|
|
2108
2135
|
help: str or None
|
2109
|
-
|
2110
|
-
|
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``.
|
2111
2142
|
|
2112
2143
|
pinned: bool or None
|
2113
2144
|
Whether the column is pinned. A pinned column will stay visible on the
|
@@ -335,8 +335,19 @@ class ButtonMixin:
|
|
335
335
|
including the Markdown directives described in the ``body``
|
336
336
|
parameter of ``st.markdown``.
|
337
337
|
|
338
|
-
on_click : callable
|
339
|
-
|
338
|
+
on_click : callable, "rerun", "ignore", or None
|
339
|
+
How the button should respond to user interaction. This controls
|
340
|
+
whether or not the button triggers a rerun and if a callback
|
341
|
+
function is called. This can be one of the following values:
|
342
|
+
|
343
|
+
- ``"rerun"`` (default): The user downloads the file and the app
|
344
|
+
reruns. No callback function is called.
|
345
|
+
- ``"ignore"``: The user downloads the file and the app doesn't
|
346
|
+
rerun. No callback function is called.
|
347
|
+
- A ``callable``: The user downloads the file and app reruns. The
|
348
|
+
callable is called before the rest of the app.
|
349
|
+
- ``None``: This is same as ``on_click="rerun"``. This value exists
|
350
|
+
for backwards compatibility and shouldn't be used.
|
340
351
|
|
341
352
|
args : tuple
|
342
353
|
An optional tuple of args to pass to the callback.
|
@@ -636,10 +636,10 @@ class DataEditorMixin:
|
|
636
636
|
|
637
637
|
use_container_width : bool
|
638
638
|
Whether to override ``width`` with the width of the parent
|
639
|
-
container. If
|
640
|
-
|
641
|
-
|
642
|
-
|
639
|
+
container. If this is ``True`` (default), Streamlit sets the width
|
640
|
+
of the data editor to match the width of the parent container. If
|
641
|
+
this is ``False``, Streamlit sets the data editor's width according
|
642
|
+
to ``width``.
|
643
643
|
|
644
644
|
hide_index : bool or None
|
645
645
|
Whether to hide the index column(s). If ``hide_index`` is ``None``
|
@@ -697,7 +697,8 @@ class DataEditorMixin:
|
|
697
697
|
|
698
698
|
row_height : int or None
|
699
699
|
The height of each row in the data editor in pixels. If ``row_height``
|
700
|
-
is ``None`` (default), Streamlit will use a default row height
|
700
|
+
is ``None`` (default), Streamlit will use a default row height,
|
701
|
+
which fits one line of text.
|
701
702
|
|
702
703
|
Returns
|
703
704
|
-------
|
@@ -240,8 +240,9 @@ class NumberInputMixin:
|
|
240
240
|
format : str or None
|
241
241
|
A printf-style format string controlling how the interface should
|
242
242
|
display numbers. The output must be purely numeric. This does not
|
243
|
-
impact the return value of the widget.
|
244
|
-
`sprintf.js
|
243
|
+
impact the return value of the widget. For more information about
|
244
|
+
the formatting specification, see `sprintf.js
|
245
|
+
<https://github.com/alexei/sprintf.js?tab=readme-ov-file#format-specification>`_.
|
245
246
|
|
246
247
|
For example, ``format="%0.1f"`` adjusts the displayed decimal
|
247
248
|
precision to only show one digit after the decimal.
|
@@ -415,9 +415,17 @@ class SliderMixin:
|
|
415
415
|
format : str or None
|
416
416
|
A printf-style format string controlling how the interface should
|
417
417
|
display numbers. This does not impact the return value.
|
418
|
-
|
419
|
-
|
420
|
-
|
418
|
+
|
419
|
+
For information about formatting integers and floats, see
|
420
|
+
`sprintf.js
|
421
|
+
<https://github.com/alexei/sprintf.js?tab=readme-ov-file#format-specification>`_.
|
422
|
+
For example, ``format="%0.1f"`` adjusts the displayed decimal
|
423
|
+
precision to only show one digit after the decimal.
|
424
|
+
|
425
|
+
For information about formatting datetimes, dates, and times, see
|
426
|
+
`momentJS <https://momentjs.com/docs/#/displaying/format/>`_.
|
427
|
+
For example, ``format="ddd ha"`` adjusts the displayed datetime to
|
428
|
+
show the day of the week and the hour ("Tue 8pm").
|
421
429
|
|
422
430
|
key : str or int
|
423
431
|
An optional string or integer to use as the unique key for the widget.
|
streamlit/runtime/context.py
CHANGED
@@ -146,6 +146,8 @@ class ContextProxy:
|
|
146
146
|
|
147
147
|
Examples
|
148
148
|
--------
|
149
|
+
**Example 1: Access all available headers**
|
150
|
+
|
149
151
|
Show a dictionary of headers (with only the last instance of any
|
150
152
|
repeated key):
|
151
153
|
|
@@ -153,6 +155,8 @@ class ContextProxy:
|
|
153
155
|
>>>
|
154
156
|
>>> st.context.headers
|
155
157
|
|
158
|
+
**Example 2: Access a specific header**
|
159
|
+
|
156
160
|
Show the value of a specific header (or the last instance if it's
|
157
161
|
repeated):
|
158
162
|
|
@@ -183,12 +187,16 @@ class ContextProxy:
|
|
183
187
|
|
184
188
|
Examples
|
185
189
|
--------
|
190
|
+
**Example 1: Access all available cookies**
|
191
|
+
|
186
192
|
Show a dictionary of cookies:
|
187
193
|
|
188
194
|
>>> import streamlit as st
|
189
195
|
>>>
|
190
196
|
>>> st.context.cookies
|
191
197
|
|
198
|
+
**Example 2: Access a specific cookie**
|
199
|
+
|
192
200
|
Show the value of a specific cookie:
|
193
201
|
|
194
202
|
>>> import streamlit as st
|
@@ -209,7 +217,26 @@ class ContextProxy:
|
|
209
217
|
@property
|
210
218
|
@gather_metrics("context.timezone")
|
211
219
|
def timezone(self) -> str | None:
|
212
|
-
"""The timezone of the user's browser
|
220
|
+
"""The read-only timezone of the user's browser.
|
221
|
+
|
222
|
+
Example
|
223
|
+
-------
|
224
|
+
Access the user's timezone, and format a datetime to display locally:
|
225
|
+
|
226
|
+
>>> import streamlit as st
|
227
|
+
>>> from datetime import datetime, timezone
|
228
|
+
>>> import pytz
|
229
|
+
>>>
|
230
|
+
>>> tz = st.context.timezone
|
231
|
+
>>> tz_obj = pytz.timezone(tz)
|
232
|
+
>>>
|
233
|
+
>>> now = datetime.now(timezone.utc)
|
234
|
+
>>>
|
235
|
+
>>> f"The user's timezone is {tz}."
|
236
|
+
>>> f"The UTC time is {now}."
|
237
|
+
>>> f"The user's local time is {now.astimezone(tz_obj)}"
|
238
|
+
|
239
|
+
"""
|
213
240
|
ctx = get_script_run_ctx()
|
214
241
|
|
215
242
|
if ctx is None or ctx.context_info is None:
|
@@ -219,7 +246,25 @@ class ContextProxy:
|
|
219
246
|
@property
|
220
247
|
@gather_metrics("context.timezone_offset")
|
221
248
|
def timezone_offset(self) -> int | None:
|
222
|
-
"""The timezone offset of the user's browser
|
249
|
+
"""The read-only timezone offset of the user's browser.
|
250
|
+
|
251
|
+
Example
|
252
|
+
-------
|
253
|
+
Access the user's timezone offset, and format a datetime to display locally:
|
254
|
+
|
255
|
+
>>> import streamlit as st
|
256
|
+
>>> from datetime import datetime, timezone, timedelta
|
257
|
+
>>>
|
258
|
+
>>> tzoff = st.context.timezone_offset
|
259
|
+
>>> tz_obj = timezone(-timedelta(minutes=tzoff))
|
260
|
+
>>>
|
261
|
+
>>> now = datetime.now(timezone.utc)
|
262
|
+
>>>
|
263
|
+
>>> f"The user's timezone is {tz}."
|
264
|
+
>>> f"The UTC time is {now}."
|
265
|
+
>>> f"The user's local time is {now.astimezone(tz_obj)}"
|
266
|
+
|
267
|
+
"""
|
223
268
|
ctx = get_script_run_ctx()
|
224
269
|
if ctx is None or ctx.context_info is None:
|
225
270
|
return None
|
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.BUNYdCvS.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.BUNYdCvS.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};
|