streamlit-nightly 1.43.2.dev20250310__py3-none-any.whl → 1.43.3.dev20250312__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 +1 -0
- streamlit/config.py +9 -0
- streamlit/elements/markdown.py +98 -2
- streamlit/errors.py +7 -0
- streamlit/material_icon_names.py +1 -1
- streamlit/proto/NewSession_pb2.py +16 -16
- streamlit/proto/NewSession_pb2.pyi +4 -1
- streamlit/runtime/secrets.py +24 -29
- streamlit/static/index.html +2 -2
- streamlit/static/static/css/{index.DpJG_94W.css → index.DQZt7VFg.css} +1 -1
- streamlit/static/static/js/{FileDownload.esm.ImqzQhZO.js → FileDownload.esm.C9csNfwR.js} +1 -1
- streamlit/static/static/js/{FileHelper.rj4_ZPRJ.js → FileHelper.CTWNHaVI.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.D4sU81IJ.js → FormClearHelper.1VkFJY3v.js} +1 -1
- streamlit/static/static/js/{Hooks.DFrYYSEo.js → Hooks.vPqq3xQ5.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DrB4DkBs.js → InputInstructions.7jABRwB0.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BGAzeSxa.js → ProgressBar.BWY8ITDS.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.CHKLYdVa.js → RenderInPortalIfExists.CP_sn1OG.js} +1 -1
- streamlit/static/static/js/{Toolbar.BKtx2beJ.js → Toolbar.DzqMcgvB.js} +1 -1
- streamlit/static/static/js/{base-input.aWYv_T3A.js → base-input.DjuthXF0.js} +1 -1
- streamlit/static/static/js/{checkbox.BwU9xDqy.js → checkbox.BddRUN3_.js} +1 -1
- streamlit/static/static/js/{createSuper.T98hP8lB.js → createSuper.BAGgahBq.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BUhzwZ10.js → data-grid-overlay-editor.Bscjz8_-.js} +1 -1
- streamlit/static/static/js/{downloader.UHMJklqr.js → downloader.BgDSv-Ig.js} +1 -1
- streamlit/static/static/js/{es6.D7RXNPxf.js → es6.3kVHyEdR.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.BNi8dGHB.js → iframeResizer.contentWindow.n2oqEwdf.js} +1 -1
- streamlit/static/static/js/{index.BjSSnVYr.js → index.0JqsAt5p.js} +1 -1
- streamlit/static/static/js/{index.BWImpdJl.js → index.3k9e_sFT.js} +1 -1
- streamlit/static/static/js/{index.C7CIfK5x.js → index.B1ZLFKil.js} +1 -1
- streamlit/static/static/js/{index.D9hw0QoD.js → index.B8IuPu4x.js} +1 -1
- streamlit/static/static/js/{index.DcMqY8Rt.js → index.BNTyamf9.js} +1 -1
- streamlit/static/static/js/{index.Beb9exCG.js → index.BPcgpI5G.js} +1 -1
- streamlit/static/static/js/{index.Cojuevm_.js → index.BQXOwXQG.js} +1 -1
- streamlit/static/static/js/index.BaYVwylD.js +1 -0
- streamlit/static/static/js/{index.EnNuubQT.js → index.Bd5GUMH8.js} +1 -1
- streamlit/static/static/js/index.BfTunuGf.js +1 -0
- streamlit/static/static/js/{index.DrVJtFAu.js → index.C28BRw13.js} +1 -1
- streamlit/static/static/js/{index.DMx15udc.js → index.C8ZHYetm.js} +1 -1
- streamlit/static/static/js/index.CFbiFnmq.js +1 -0
- streamlit/static/static/js/{index.BulZmEHg.js → index.CYrF9jN2.js} +1 -1
- streamlit/static/static/js/index.ChDimwy6.js +1 -0
- streamlit/static/static/js/{index.9BQEZqbt.js → index.Cj7yHfOR.js} +1 -1
- streamlit/static/static/js/{index.CG3GMqFW.js → index.CrZncPLs.js} +1 -1
- streamlit/static/static/js/{index.C3qGK5uD.js → index.CrjCtGqg.js} +1 -1
- streamlit/static/static/js/{index.Bmx8iP3n.js → index.D3EE2F77.js} +1 -1
- streamlit/static/static/js/{index.x7KxH0wZ.js → index.D3uVQMaA.js} +1 -1
- streamlit/static/static/js/{index.RW0WBvU0.js → index.D7k3QVrz.js} +1 -1
- streamlit/static/static/js/{index.BtuGy7By.js → index.D8rVyQy1.js} +2 -2
- streamlit/static/static/js/{index.D_WVKhzB.js → index.DAAc9Gb3.js} +1 -1
- streamlit/static/static/js/{index.huSsicgb.js → index.DAghU1FB.js} +1 -1
- streamlit/static/static/js/{index.B8zj_6Gl.js → index.DbI6X421.js} +1 -1
- streamlit/static/static/js/{index.BQ2ayi8Y.js → index.DlXteNnv.js} +1 -1
- streamlit/static/static/js/{index.CNhtDtLa.js → index.Dv6XiWKs.js} +1 -1
- streamlit/static/static/js/{index.DiApz_4C.js → index.FJszpQ-y.js} +6 -6
- streamlit/static/static/js/{index.DWy7AE10.js → index.N6CP_9Qh.js} +1 -1
- streamlit/static/static/js/{index._vK60a8u.js → index.OtBp-Blq.js} +1 -1
- streamlit/static/static/js/{index.BGU5att3.js → index.S_LaABz9.js} +1 -1
- streamlit/static/static/js/{index._mmzo3HM.js → index.UJT9uVs_.js} +1 -1
- streamlit/static/static/js/index.j6cgFK9c.js +2 -0
- streamlit/static/static/js/index.k2DDVmzp.js +1 -0
- streamlit/static/static/js/{index.DDV4_OwR.js → index.mMuChmJi.js} +1 -1
- streamlit/static/static/js/{index.JTJJx0oP.js → index.pEU90S1o.js} +78 -78
- streamlit/static/static/js/index.svH5ea22.js +1 -0
- streamlit/static/static/js/index.zrNj-omI.js +1 -0
- streamlit/static/static/js/{input.CRcp3Fnf.js → input.A7Xel5Mz.js} +1 -1
- streamlit/static/static/js/{memory.C5iL6e9f.js → memory.DKAi1aOw.js} +1 -1
- streamlit/static/static/js/{mergeWith.D636WLv0.js → mergeWith.BOXngkwE.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.Dadneluu.js → number-overlay-editor.Dr9nZLr4.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.LzqmZCNB.js → possibleConstructorReturn.Dmq70n5Q.js} +1 -1
- streamlit/static/static/js/{sandbox.D3tUJo--.js → sandbox.OiNVhKVk.js} +1 -1
- streamlit/static/static/js/{textarea.BSbs9R6k.js → textarea.BvcErhuX.js} +1 -1
- streamlit/static/static/js/{timepicker.4bpv4ADz.js → timepicker.BndxQ_56.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.BnZG_fhu.js → toConsumableArray.Bvyh5k2t.js} +1 -1
- streamlit/static/static/js/{uniqueId.Ck5sBKql.js → uniqueId.BJXawxf6.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.BXs1ExMv.js → useBasicWidgetState.-z6NaxAe.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CTyvPTRS.js → useOnInputChange.DvBUKld6.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.X3X2mchO.js → withFullScreenWrapper.CubK7zml.js} +1 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.CRt5Q-14.woff2 +0 -0
- streamlit/web/cli.py +42 -0
- {streamlit_nightly-1.43.2.dev20250310.dist-info → streamlit_nightly-1.43.3.dev20250312.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.43.2.dev20250310.dist-info → streamlit_nightly-1.43.3.dev20250312.dist-info}/RECORD +84 -84
- streamlit/static/static/js/index.BBex1k5g.js +0 -1
- streamlit/static/static/js/index.BGskt5lK.js +0 -1
- streamlit/static/static/js/index.Bs7kgLMz.js +0 -1
- streamlit/static/static/js/index.CAGVaxpR.js +0 -2
- streamlit/static/static/js/index.CR21S11A.js +0 -1
- streamlit/static/static/js/index.d_01YSRR.js +0 -1
- streamlit/static/static/js/index.fu_9grXc.js +0 -1
- streamlit/static/static/js/index.jv2SuPfs.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.DcZbplWk.woff2 +0 -0
- {streamlit_nightly-1.43.2.dev20250310.data → streamlit_nightly-1.43.3.dev20250312.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.43.2.dev20250310.dist-info → streamlit_nightly-1.43.3.dev20250312.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.43.2.dev20250310.dist-info → streamlit_nightly-1.43.3.dev20250312.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.43.2.dev20250310.dist-info → streamlit_nightly-1.43.3.dev20250312.dist-info}/top_level.txt +0 -0
streamlit/__init__.py
CHANGED
streamlit/config.py
CHANGED
@@ -1055,6 +1055,15 @@ _create_option(
|
|
1055
1055
|
visibility="hidden",
|
1056
1056
|
)
|
1057
1057
|
|
1058
|
+
_create_option(
|
1059
|
+
"theme.headingFont",
|
1060
|
+
description="""
|
1061
|
+
The font family to use for headings in the app.
|
1062
|
+
To use a custom font, it needs to be added via [theme.fontFaces].
|
1063
|
+
""",
|
1064
|
+
visibility="hidden",
|
1065
|
+
)
|
1066
|
+
|
1058
1067
|
_create_option(
|
1059
1068
|
"theme.fontFaces",
|
1060
1069
|
description="""
|
streamlit/elements/markdown.py
CHANGED
@@ -14,11 +14,11 @@
|
|
14
14
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
|
-
from typing import TYPE_CHECKING, Final, cast
|
17
|
+
from typing import TYPE_CHECKING, Final, Literal, cast
|
18
18
|
|
19
19
|
from streamlit.proto.Markdown_pb2 import Markdown as MarkdownProto
|
20
20
|
from streamlit.runtime.metrics_util import gather_metrics
|
21
|
-
from streamlit.string_util import clean_text
|
21
|
+
from streamlit.string_util import clean_text, validate_icon_or_emoji
|
22
22
|
from streamlit.type_util import SupportsStr, is_sympy_expression
|
23
23
|
|
24
24
|
if TYPE_CHECKING:
|
@@ -80,8 +80,14 @@ class MarkdownMixin:
|
|
80
80
|
primary accent color unless you set the ``theme.primaryColor``
|
81
81
|
configuration option.
|
82
82
|
|
83
|
+
- Colored badges, using the syntax ``:color-badge[text in the badge]``.
|
84
|
+
Supported colors are: blue, green, orange, red, violet, gray/grey,
|
85
|
+
or primary. For example, you can use ``:orange-badge[your text here]``
|
86
|
+
or ``:blue-badge[your text here]``.
|
87
|
+
|
83
88
|
- Small text, using the syntax ``:small[text to show small]``.
|
84
89
|
|
90
|
+
|
85
91
|
unsafe_allow_html : bool
|
86
92
|
Whether to render HTML within ``body``. If this is ``False``
|
87
93
|
(default), any HTML tags found in ``body`` will be escaped and
|
@@ -271,6 +277,96 @@ class MarkdownMixin:
|
|
271
277
|
divider_proto.element_type = MarkdownProto.Type.DIVIDER
|
272
278
|
return self.dg._enqueue("markdown", divider_proto)
|
273
279
|
|
280
|
+
@gather_metrics("badge")
|
281
|
+
def badge(
|
282
|
+
self,
|
283
|
+
label: str,
|
284
|
+
*, # keyword-only arguments:
|
285
|
+
icon: str | None = None,
|
286
|
+
color: Literal[
|
287
|
+
"blue",
|
288
|
+
"green",
|
289
|
+
"orange",
|
290
|
+
"red",
|
291
|
+
"violet",
|
292
|
+
"gray",
|
293
|
+
"grey",
|
294
|
+
"rainbow",
|
295
|
+
"primary",
|
296
|
+
] = "blue",
|
297
|
+
) -> DeltaGenerator:
|
298
|
+
"""Display a colored badge with an icon and label.
|
299
|
+
|
300
|
+
You can also insert badges directly in Markdown, e.g. via
|
301
|
+
`st.markdown(":blue-badge[Home]")`. This works in all places where Streamlit
|
302
|
+
supports Markdown, e.g. widget labels or `st.table` cells. See `st.markdown`
|
303
|
+
for more information.
|
304
|
+
|
305
|
+
Parameters
|
306
|
+
----------
|
307
|
+
label : str
|
308
|
+
The label to display in the badge. The label can optionally contain
|
309
|
+
GitHub-flavored Markdown of the following types: Bold, Italics,
|
310
|
+
Strikethroughs, Inline Code.
|
311
|
+
|
312
|
+
See the ``body`` parameter of |st.markdown|_ for additional,
|
313
|
+
supported Markdown directives.
|
314
|
+
|
315
|
+
.. |st.markdown| replace:: ``st.markdown``
|
316
|
+
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
317
|
+
|
318
|
+
icon : str or None
|
319
|
+
An optional emoji or icon to display next to the badge label. If
|
320
|
+
``icon`` is ``None`` (default), no icon is displayed. If ``icon``
|
321
|
+
is a string, the following options are valid:
|
322
|
+
|
323
|
+
- A single-character emoji. For example, you can set ``icon="🚨"``
|
324
|
+
or ``icon="🔥"``. Emoji short codes are not supported.
|
325
|
+
|
326
|
+
- An icon from the Material Symbols library (rounded style) in the
|
327
|
+
format ``":material/icon_name:"`` where "icon_name" is the name
|
328
|
+
of the icon in snake case.
|
329
|
+
|
330
|
+
For example, ``icon=":material/thumb_up:"`` will display the
|
331
|
+
Thumb Up icon. Find additional icons in the `Material Symbols \
|
332
|
+
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
333
|
+
font library.
|
334
|
+
|
335
|
+
color : str
|
336
|
+
The color to use for the badge. Supported colors are: blue, green,
|
337
|
+
orange, red, violet, gray/grey, primary.
|
338
|
+
If you use "primary" for color, Streamlit will use the default
|
339
|
+
primary accent color unless you set the ``theme.primaryColor``
|
340
|
+
configuration option.
|
341
|
+
|
342
|
+
Examples
|
343
|
+
--------
|
344
|
+
>>> import streamlit as st
|
345
|
+
>>>
|
346
|
+
>>> # Simple badge
|
347
|
+
>>> st.badge("Home")
|
348
|
+
>>>
|
349
|
+
>>> # Badge with icon and color
|
350
|
+
>>> st.badge("Success", icon=":material/check:", color="green")
|
351
|
+
>>>
|
352
|
+
>>> # Multiple badges side by side in Markdown
|
353
|
+
>>> st.markdown(
|
354
|
+
... "Here are some badges: :orange-badge[⭐️ Favorite] :blue-badge[🏠 Home] :green-badge[✅ Success]"
|
355
|
+
... )
|
356
|
+
"""
|
357
|
+
if icon is not None:
|
358
|
+
icon_str = validate_icon_or_emoji(icon) + " "
|
359
|
+
else:
|
360
|
+
icon_str = ""
|
361
|
+
|
362
|
+
# Escape [ and ] characters in the label to prevent breaking the directive syntax
|
363
|
+
escaped_label = label.replace("[", "\\[").replace("]", "\\]")
|
364
|
+
|
365
|
+
badge_proto = MarkdownProto()
|
366
|
+
badge_proto.body = f":{color}-badge[{icon_str}{escaped_label}]"
|
367
|
+
badge_proto.element_type = MarkdownProto.Type.NATIVE
|
368
|
+
return self.dg._enqueue("markdown", badge_proto)
|
369
|
+
|
274
370
|
@property
|
275
371
|
def dg(self) -> DeltaGenerator:
|
276
372
|
"""Get our DeltaGenerator."""
|
streamlit/errors.py
CHANGED
@@ -450,3 +450,10 @@ class StreamlitBadTimeStringError(LocalizableStreamlitException):
|
|
450
450
|
"`'1d2h34m'` or `2 days`, for example. Got: {time_string}",
|
451
451
|
time_string=time_string,
|
452
452
|
)
|
453
|
+
|
454
|
+
|
455
|
+
class StreamlitSecretNotFoundError(LocalizableStreamlitException, FileNotFoundError):
|
456
|
+
"""Exception raised when a secret cannot be found or parsed in the secrets.toml file."""
|
457
|
+
|
458
|
+
def __init__(self, message: str):
|
459
|
+
super().__init__(message)
|