streamlit-nightly 1.43.3.dev20250311__py3-none-any.whl → 1.43.3.dev20250313__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.
Files changed (159) hide show
  1. streamlit/__init__.py +1 -0
  2. streamlit/auth_util.py +2 -1
  3. streamlit/commands/experimental_query_params.py +1 -1
  4. streamlit/commands/logo.py +3 -3
  5. streamlit/components/v1/__init__.py +1 -3
  6. streamlit/config.py +3 -2
  7. streamlit/config_option.py +1 -3
  8. streamlit/connections/snowflake_connection.py +0 -1
  9. streamlit/connections/sql_connection.py +0 -1
  10. streamlit/dataframe_util.py +7 -6
  11. streamlit/delta_generator_singletons.py +2 -2
  12. streamlit/elements/arrow.py +0 -1
  13. streamlit/elements/exception.py +3 -1
  14. streamlit/elements/form.py +3 -3
  15. streamlit/elements/json.py +2 -2
  16. streamlit/elements/layouts.py +0 -5
  17. streamlit/elements/lib/built_in_chart_utils.py +1 -2
  18. streamlit/elements/lib/column_config_utils.py +0 -3
  19. streamlit/elements/lib/column_types.py +6 -39
  20. streamlit/elements/lib/image_utils.py +2 -1
  21. streamlit/elements/lib/options_selector_utils.py +6 -3
  22. streamlit/elements/lib/subtitle_utils.py +2 -0
  23. streamlit/elements/lib/utils.py +0 -2
  24. streamlit/elements/markdown.py +98 -2
  25. streamlit/elements/media.py +2 -1
  26. streamlit/elements/metric.py +0 -1
  27. streamlit/elements/progress.py +1 -1
  28. streamlit/elements/text.py +2 -2
  29. streamlit/elements/vega_charts.py +2 -1
  30. streamlit/elements/widgets/audio_input.py +2 -1
  31. streamlit/elements/widgets/button.py +0 -1
  32. streamlit/elements/widgets/button_group.py +2 -3
  33. streamlit/elements/widgets/data_editor.py +2 -3
  34. streamlit/elements/widgets/slider.py +1 -1
  35. streamlit/elements/widgets/text_widgets.py +1 -0
  36. streamlit/elements/write.py +0 -1
  37. streamlit/errors.py +11 -2
  38. streamlit/external/langchain/streamlit_callback_handler.py +1 -2
  39. streamlit/file_util.py +4 -2
  40. streamlit/navigation/page.py +0 -1
  41. streamlit/platform.py +1 -3
  42. streamlit/runtime/caching/cache_data_api.py +5 -5
  43. streamlit/runtime/caching/cache_errors.py +1 -1
  44. streamlit/runtime/caching/cache_resource_api.py +4 -4
  45. streamlit/runtime/caching/cache_utils.py +6 -4
  46. streamlit/runtime/caching/storage/cache_storage_protocol.py +6 -6
  47. streamlit/runtime/caching/storage/dummy_cache_storage.py +2 -2
  48. streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py +6 -6
  49. streamlit/runtime/caching/storage/local_disk_cache_storage.py +6 -6
  50. streamlit/runtime/connection_factory.py +0 -1
  51. streamlit/runtime/context.py +1 -1
  52. streamlit/runtime/credentials.py +1 -1
  53. streamlit/runtime/forward_msg_cache.py +1 -1
  54. streamlit/runtime/forward_msg_queue.py +2 -1
  55. streamlit/runtime/fragment.py +2 -1
  56. streamlit/runtime/memory_media_file_storage.py +2 -2
  57. streamlit/runtime/metrics_util.py +2 -2
  58. streamlit/runtime/runtime_util.py +1 -1
  59. streamlit/runtime/scriptrunner/script_runner.py +1 -1
  60. streamlit/runtime/scriptrunner_utils/exceptions.py +1 -1
  61. streamlit/runtime/scriptrunner_utils/script_run_context.py +1 -0
  62. streamlit/runtime/secrets.py +28 -31
  63. streamlit/runtime/state/common.py +1 -1
  64. streamlit/runtime/state/safe_session_state.py +1 -1
  65. streamlit/runtime/state/session_state.py +4 -3
  66. streamlit/runtime/stats.py +1 -1
  67. streamlit/runtime/uploaded_file_manager.py +4 -3
  68. streamlit/static/index.html +1 -1
  69. streamlit/static/static/js/{FileDownload.esm.B-R2xJ_2.js → FileDownload.esm.imTamlxP.js} +1 -1
  70. streamlit/static/static/js/{FileHelper.Dpame4Yy.js → FileHelper.BwPSCUvG.js} +1 -1
  71. streamlit/static/static/js/{FormClearHelper.CJtgEcyv.js → FormClearHelper.DB5q2Avl.js} +1 -1
  72. streamlit/static/static/js/{Hooks.eMU4yP9C.js → Hooks.Cxijo2P7.js} +1 -1
  73. streamlit/static/static/js/{InputInstructions.Bt5nMAh-.js → InputInstructions.B3OvMrKL.js} +1 -1
  74. streamlit/static/static/js/{ProgressBar.CRfY498S.js → ProgressBar.DmTol130.js} +1 -1
  75. streamlit/static/static/js/{RenderInPortalIfExists.CjsBZs42.js → RenderInPortalIfExists.B8t62565.js} +1 -1
  76. streamlit/static/static/js/{Toolbar.CBmSHKas.js → Toolbar.CbG49UPG.js} +1 -1
  77. streamlit/static/static/js/{base-input.pwi2uHY4.js → base-input.D7sJ1S2g.js} +1 -1
  78. streamlit/static/static/js/{checkbox.BRMCIUrT.js → checkbox.0Qx7AQxA.js} +1 -1
  79. streamlit/static/static/js/{createSuper.BT2FfU2u.js → createSuper.DYiyAta_.js} +1 -1
  80. streamlit/static/static/js/{data-grid-overlay-editor.DR231PaH.js → data-grid-overlay-editor.DH61CZYo.js} +1 -1
  81. streamlit/static/static/js/{downloader.Cwh9Q8n3.js → downloader.ClUad3SK.js} +1 -1
  82. streamlit/static/static/js/{es6.DXFo1lzk.js → es6.oePMPTIo.js} +2 -2
  83. streamlit/static/static/js/{iframeResizer.contentWindow.BqHH3gN-.js → iframeResizer.contentWindow.DWkIX4K7.js} +1 -1
  84. streamlit/static/static/js/{index.SGdFItlP.js → index.1VrMb7Gq.js} +1 -1
  85. streamlit/static/static/js/index.62zz5frt.js +1 -0
  86. streamlit/static/static/js/index.BJRyQckV.js +1 -0
  87. streamlit/static/static/js/{index.C8ZQWk_P.js → index.BQVZQA1G.js} +1 -1
  88. streamlit/static/static/js/{index.-J5N3GRT.js → index.BSZRb65z.js} +1 -1
  89. streamlit/static/static/js/{index.oH2t20_d.js → index.BUJE3tb_.js} +1 -1
  90. streamlit/static/static/js/{index.DAIPHdqL.js → index.BWsaTYC-.js} +1 -1
  91. streamlit/static/static/js/{index.B9ftDzXT.js → index.BccrUqFL.js} +1 -1
  92. streamlit/static/static/js/index.BhzKPoO6.js +1 -0
  93. streamlit/static/static/js/{index._HJ2bgYb.js → index.BpNXx3zc.js} +6 -6
  94. streamlit/static/static/js/{index.DzJ-K9FH.js → index.BzEstIKX.js} +1 -1
  95. streamlit/static/static/js/{index.Cqy-AKUq.js → index.C-ilKj2l.js} +1 -1
  96. streamlit/static/static/js/{index.DBAW0l2y.js → index.CCAIkxXD.js} +2367 -1541
  97. streamlit/static/static/js/{index.DklFRDjI.js → index.CEXlj4h2.js} +1 -1
  98. streamlit/static/static/js/{index.E4BOW70b.js → index.CEtBn4Yo.js} +1 -1
  99. streamlit/static/static/js/{index.Y1Qnwm4b.js → index.CM7PC5PD.js} +1 -1
  100. streamlit/static/static/js/{index.BAQ_1jSz.js → index.CSLXWDcG.js} +1 -1
  101. streamlit/static/static/js/{index.7mbSZESp.js → index.CqywW5KK.js} +1 -1
  102. streamlit/static/static/js/{index.DGe1v1i2.js → index.CyRCgpSs.js} +1 -1
  103. streamlit/static/static/js/{index.BiPCWEUM.js → index.CzFs8nXc.js} +45 -45
  104. streamlit/static/static/js/{index.DTC2KQEB.js → index.Czxn5B2N.js} +1 -1
  105. streamlit/static/static/js/{index.BhhnIkTX.js → index.D0OLo5Dp.js} +1 -1
  106. streamlit/static/static/js/{index.DC7tm9ca.js → index.D2JlVfHE.js} +1 -1
  107. streamlit/static/static/js/{index.BtuGy7By.js → index.D8rVyQy1.js} +2 -2
  108. streamlit/static/static/js/{index.BN2fMHzp.js → index.DJRmF7dm.js} +1 -1
  109. streamlit/static/static/js/{index.eHde7unb.js → index.Dd9D963h.js} +1 -1
  110. streamlit/static/static/js/{index.CtDd3Kvg.js → index.DhcpqbOJ.js} +1 -1
  111. streamlit/static/static/js/{index.DJZrR-yh.js → index.DlEF0vUx.js} +1 -1
  112. streamlit/static/static/js/{index.pfdwKIIK.js → index.DnJimAdR.js} +1 -1
  113. streamlit/static/static/js/index.DoqMrowT.js +1 -0
  114. streamlit/static/static/js/{index.B71BDPil.js → index.DqsHy8ck.js} +1 -1
  115. streamlit/static/static/js/{index.DbtNEUBr.js → index.DtS10fdK.js} +1 -1
  116. streamlit/static/static/js/{index.BtaSeLy3.js → index.XZw2NTV4.js} +1 -1
  117. streamlit/static/static/js/index.YB9Oe71d.js +1 -0
  118. streamlit/static/static/js/{index.Bt4_I4Hr.js → index.axjxDsFs.js} +1 -1
  119. streamlit/static/static/js/{index.CKLHvpe_.js → index.kB2IGVOe.js} +1 -1
  120. streamlit/static/static/js/{index.ClCou1d2.js → index.tVO_vJdT.js} +1 -1
  121. streamlit/static/static/js/{index.DIxz2WrU.js → index.uPQFE7KD.js} +1 -1
  122. streamlit/static/static/js/{input.Rf6xGN5X.js → input.od7ufwko.js} +1 -1
  123. streamlit/static/static/js/{memory.D5NLCYdA.js → memory.B4tdC6o-.js} +1 -1
  124. streamlit/static/static/js/{mergeWith.Bcdwg8Ac.js → mergeWith.BIQlVIWW.js} +1 -1
  125. streamlit/static/static/js/{number-overlay-editor.CCjfRIEO.js → number-overlay-editor.yJDCpy9b.js} +1 -1
  126. streamlit/static/static/js/{possibleConstructorReturn.B8bXiVQj.js → possibleConstructorReturn.CarGSmuW.js} +1 -1
  127. streamlit/static/static/js/{sandbox.lrrkbqxh.js → sandbox.DMCKOK6i.js} +1 -1
  128. streamlit/static/static/js/{textarea.DCEYRe9D.js → textarea.CKKbJt6B.js} +1 -1
  129. streamlit/static/static/js/{timepicker.DpQ3WAC_.js → timepicker.BgsARtBm.js} +1 -1
  130. streamlit/static/static/js/{toConsumableArray.EduObuzm.js → toConsumableArray.DXHhbr1a.js} +1 -1
  131. streamlit/static/static/js/{uniqueId.qyd-2U_A.js → uniqueId.Cb5oTCCd.js} +1 -1
  132. streamlit/static/static/js/{useBasicWidgetState.B0zc_tpZ.js → useBasicWidgetState.8rZ80dWq.js} +1 -1
  133. streamlit/static/static/js/{useOnInputChange.tzktvOeD.js → useOnInputChange.Bc5KC47X.js} +1 -1
  134. streamlit/static/static/js/{withFullScreenWrapper.TezXOJ_z.js → withFullScreenWrapper.CSP3iCNz.js} +1 -1
  135. streamlit/string_util.py +3 -2
  136. streamlit/testing/v1/element_tree.py +30 -30
  137. streamlit/testing/v1/util.py +2 -1
  138. streamlit/time_util.py +1 -3
  139. streamlit/type_util.py +2 -1
  140. streamlit/user_info.py +0 -1
  141. streamlit/watcher/event_based_path_watcher.py +1 -1
  142. streamlit/web/bootstrap.py +3 -1
  143. streamlit/web/cache_storage_manager_config.py +1 -1
  144. streamlit/web/cli.py +44 -2
  145. streamlit/web/server/authlib_tornado_integration.py +1 -1
  146. streamlit/web/server/browser_websocket_handler.py +2 -1
  147. streamlit/web/server/routes.py +2 -2
  148. streamlit/web/server/server_util.py +2 -4
  149. {streamlit_nightly-1.43.3.dev20250311.dist-info → streamlit_nightly-1.43.3.dev20250313.dist-info}/METADATA +1 -1
  150. {streamlit_nightly-1.43.3.dev20250311.dist-info → streamlit_nightly-1.43.3.dev20250313.dist-info}/RECORD +154 -154
  151. streamlit/static/static/js/index.BMcgy3Eb.js +0 -1
  152. streamlit/static/static/js/index.COJ2HeaK.js +0 -1
  153. streamlit/static/static/js/index.D6iEZATu.js +0 -1
  154. streamlit/static/static/js/index.DuXQiNfC.js +0 -1
  155. streamlit/static/static/js/index.Fi_0UKZA.js +0 -1
  156. {streamlit_nightly-1.43.3.dev20250311.data → streamlit_nightly-1.43.3.dev20250313.data}/scripts/streamlit.cmd +0 -0
  157. {streamlit_nightly-1.43.3.dev20250311.dist-info → streamlit_nightly-1.43.3.dev20250313.dist-info}/WHEEL +0 -0
  158. {streamlit_nightly-1.43.3.dev20250311.dist-info → streamlit_nightly-1.43.3.dev20250313.dist-info}/entry_points.txt +0 -0
  159. {streamlit_nightly-1.43.3.dev20250311.dist-info → streamlit_nightly-1.43.3.dev20250313.dist-info}/top_level.txt +0 -0
streamlit/__init__.py CHANGED
@@ -166,6 +166,7 @@ altair_chart = _main.altair_chart
166
166
  area_chart = _main.area_chart
167
167
  audio = _main.audio
168
168
  audio_input = _main.audio_input
169
+ badge = _main.badge
169
170
  balloons = _main.balloons
170
171
  bar_chart = _main.bar_chart
171
172
  bokeh_chart = _main.bokeh_chart
streamlit/auth_util.py CHANGED
@@ -146,7 +146,8 @@ def generate_default_provider_section(auth_section) -> dict[str, Any]:
146
146
 
147
147
  def validate_auth_credentials(provider: str) -> None:
148
148
  """Validate the general auth credentials and auth credentials for the given
149
- provider."""
149
+ provider.
150
+ """
150
151
  if not secrets_singleton.load_if_toml_exists():
151
152
  raise StreamlitAuthError(
152
153
  """To use authentication features you need to configure credentials for at
@@ -109,7 +109,7 @@ def set_query_params(**query_params: Any) -> None:
109
109
  def _exclude_keys_in_dict(
110
110
  d: dict[str, Any], keys_to_exclude: list[str]
111
111
  ) -> dict[str, Any]:
112
- """Returns new object but without keys defined in keys_to_exclude"""
112
+ """Returns new object but without keys defined in keys_to_exclude."""
113
113
  return {
114
114
  key: value for key, value in d.items() if key.lower() not in keys_to_exclude
115
115
  }
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- """Handle App logos"""
15
+ """Handle App logos."""
16
16
 
17
17
  from __future__ import annotations
18
18
 
@@ -38,7 +38,7 @@ def logo(
38
38
  link: str | None = None,
39
39
  icon_image: AtomicImage | None = None,
40
40
  ) -> None:
41
- """
41
+ r"""
42
42
  Renders a logo in the upper-left corner of your app and its sidebar.
43
43
 
44
44
  If ``st.logo`` is called multiple times within a page, Streamlit will
@@ -75,7 +75,7 @@ def logo(
75
75
 
76
76
  link : str or None
77
77
  The external URL to open when a user clicks on the logo. The URL must
78
- start with "\\http://" or "\\https://". If ``link`` is ``None`` (default),
78
+ start with "\http://" or "\https://". If ``link`` is ``None`` (default),
79
79
  the logo will not include a hyperlink.
80
80
  icon_image: Anything supported by st.image (except list) or None
81
81
  An optional, typically smaller image to replace ``image`` in the
@@ -12,9 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- """
16
- This directory contains the files and modules for the exposed API.
17
- """
15
+ """Contains the files and modules for the exposed API."""
18
16
 
19
17
  import streamlit
20
18
  from streamlit.components.v1.component_registry import declare_component
streamlit/config.py CHANGED
@@ -455,8 +455,9 @@ def _logger_log_level() -> str:
455
455
  @_create_option("logger.messageFormat", type_=str)
456
456
  def _logger_message_format() -> str:
457
457
  """String format for logging messages. If logger.datetimeFormat is set,
458
- logger messages will default to `%(asctime)s.%(msecs)03d %(message)s`. See
459
- Python's documentation for available attributes:
458
+ logger messages will default to `%(asctime)s.%(msecs)03d %(message)s`.
459
+
460
+ See Python's documentation for available attributes:
460
461
  https://docs.python.org/3/library/logging.html#formatter-objects
461
462
 
462
463
  Default: "%(asctime)s %(message)s"
@@ -299,9 +299,7 @@ class ConfigOption:
299
299
 
300
300
  @property
301
301
  def env_var(self):
302
- """
303
- Get the name of the environment variable that can be used to set the option.
304
- """
302
+ """Get the name of the environment variable that can be used to set the option."""
305
303
  name = self.key.replace(".", "_")
306
304
  return f"STREAMLIT_{to_snake_case(name).upper()}"
307
305
 
@@ -81,7 +81,6 @@ class SnowflakeConnection(BaseConnection["InternalSnowflakeConnection"]):
81
81
 
82
82
  Examples
83
83
  --------
84
-
85
84
  **Example 1: Configuration with Streamlit secrets**
86
85
 
87
86
  You can configure your Snowflake connection using Streamlit's
@@ -101,7 +101,6 @@ class SQLConnection(BaseConnection["Engine"]):
101
101
 
102
102
  Examples
103
103
  --------
104
-
105
104
  **Example 1: Configuration with URL**
106
105
 
107
106
  You can configure your SQL connection using Streamlit's
@@ -319,7 +319,7 @@ def is_dataframe_like(obj: object) -> bool:
319
319
 
320
320
 
321
321
  def is_unevaluated_data_object(obj: object) -> bool:
322
- """True if the object is one of the supported unevaluated data objects:
322
+ """True if the object is one of the supported unevaluated data objects.
323
323
 
324
324
  Currently supported objects are:
325
325
  - Snowpark DataFrame / Table
@@ -372,7 +372,7 @@ def is_snowpark_row_list(obj: object) -> bool:
372
372
 
373
373
 
374
374
  def is_pyspark_data_object(obj: object) -> bool:
375
- """True if obj is a PySpark or PySpark Connect dataframe"""
375
+ """True if obj is a PySpark or PySpark Connect dataframe."""
376
376
  return (
377
377
  is_type(obj, _PYSPARK_DF_TYPE_STR) or is_type(obj, _PYSPARK_CONNECT_DF_TYPE_STR)
378
378
  ) and has_callable_attr(obj, "toPandas")
@@ -391,7 +391,7 @@ def is_dask_object(obj: object) -> bool:
391
391
 
392
392
 
393
393
  def is_modin_data_object(obj: object) -> bool:
394
- """True if obj is of Modin Dataframe or Series"""
394
+ """True if obj is of Modin Dataframe or Series."""
395
395
  return is_type(obj, _MODIN_DF_TYPE_STR) or is_type(obj, _MODIN_SERIES_TYPE_STR)
396
396
 
397
397
 
@@ -857,7 +857,8 @@ def convert_arrow_bytes_to_pandas_df(source: bytes) -> DataFrame:
857
857
 
858
858
  def _show_data_information(msg: str) -> None:
859
859
  """Show a message to the user with important information
860
- about the processed dataset."""
860
+ about the processed dataset.
861
+ """
861
862
  from streamlit.delta_generator_singletons import get_dg_singleton_instance
862
863
 
863
864
  get_dg_singleton_instance().main_dg.caption(msg)
@@ -910,7 +911,6 @@ def convert_anything_to_list(obj: OptionSequence[V_co]) -> list[V_co]:
910
911
 
911
912
  Parameters
912
913
  ----------
913
-
914
914
  obj : dataframe-, array-, or collections-like object
915
915
  The object to convert to a list.
916
916
 
@@ -1035,7 +1035,8 @@ def _maybe_truncate_table(
1035
1035
 
1036
1036
  def is_colum_type_arrow_incompatible(column: Series[Any] | Index) -> bool:
1037
1037
  """Return True if the column type is known to cause issues during
1038
- Arrow conversion."""
1038
+ Arrow conversion.
1039
+ """
1039
1040
  from pandas.api.types import infer_dtype, is_dict_like, is_list_like
1040
1041
 
1041
1042
  if column.dtype.kind in [
@@ -57,7 +57,6 @@ class DeltaGeneratorSingleton:
57
57
 
58
58
  Parameters
59
59
  ----------
60
-
61
60
  delta_generator_cls : type[DeltaGenerator]
62
61
  The main DeltaGenerator class.
63
62
  status_container_cls : type[StatusContainer]
@@ -179,7 +178,8 @@ context_dg_stack: ContextVarWithLazyDefault[tuple[DeltaGenerator, ...]] = (
179
178
 
180
179
  def get_default_dg_stack_value() -> tuple[DeltaGenerator, ...]:
181
180
  """Get the default dg_stack value with which the dg_stack should
182
- be initialized and reset if needed."""
181
+ be initialized and reset if needed.
182
+ """
183
183
  instance = get_dg_singleton_instance()
184
184
  if instance._main_dg is None:
185
185
  raise RuntimeError("main_dg is not set")
@@ -436,7 +436,6 @@ class ArrowMixin:
436
436
 
437
437
  Examples
438
438
  --------
439
-
440
439
  **Example 1: Display a dataframe**
441
440
 
442
441
  >>> import streamlit as st
@@ -180,7 +180,9 @@ Traceback:
180
180
 
181
181
  def _format_syntax_error_message(exception: SyntaxError) -> str:
182
182
  """Returns a nicely formatted SyntaxError message that emulates
183
- what the Python interpreter outputs, e.g.:
183
+ what the Python interpreter outputs.
184
+
185
+ For example:
184
186
 
185
187
  > File "raven.py", line 3
186
188
  > st.write('Hello world!!'))
@@ -202,7 +202,7 @@ class FormMixin:
202
202
  disabled: bool = False,
203
203
  use_container_width: bool = False,
204
204
  ) -> bool:
205
- """Display a form submit button.
205
+ r"""Display a form submit button.
206
206
 
207
207
  When this button is clicked, all widget values inside the form will be
208
208
  sent from the user's browser to your Streamlit server in a batch.
@@ -225,7 +225,7 @@ class FormMixin:
225
225
  Unsupported Markdown elements are unwrapped so only their children
226
226
  (text contents) render. Display unsupported elements as literal
227
227
  characters by backslash-escaping them. E.g.,
228
- ``"1\\. Not an ordered list"``.
228
+ ``"1\. Not an ordered list"``.
229
229
 
230
230
  See the ``body`` parameter of |st.markdown|_ for additional,
231
231
  supported Markdown directives.
@@ -269,7 +269,7 @@ class FormMixin:
269
269
  of the icon in snake case.
270
270
 
271
271
  For example, ``icon=":material/thumb_up:"`` will display the
272
- Thumb Up icon. Find additional icons in the `Material Symbols \
272
+ Thumb Up icon. Find additional icons in the `Material Symbols
273
273
  <https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
274
274
  font library.
275
275
  disabled : bool
@@ -34,7 +34,8 @@ if TYPE_CHECKING:
34
34
 
35
35
  def _ensure_serialization(o: object) -> str | list[Any]:
36
36
  """A repr function for json.dumps default arg, which tries to serialize sets
37
- as lists."""
37
+ as lists.
38
+ """
38
39
  return list(o) if isinstance(o, set) else repr(o)
39
40
 
40
41
 
@@ -50,7 +51,6 @@ class JsonMixin:
50
51
 
51
52
  Parameters
52
53
  ----------
53
-
54
54
  body : object or str
55
55
  The object to print as JSON. All referenced objects should be
56
56
  serializable to JSON as well. If object is a string, we assume it
@@ -60,7 +60,6 @@ class LayoutsMixin:
60
60
 
61
61
  Parameters
62
62
  ----------
63
-
64
63
  height : int or None
65
64
  Desired height of the container expressed in pixels. If ``None`` (default)
66
65
  the container grows to fit its content. If a fixed height, scrolling is
@@ -230,7 +229,6 @@ class LayoutsMixin:
230
229
 
231
230
  Examples
232
231
  --------
233
-
234
232
  **Example 1: Use context management**
235
233
 
236
234
  You can use the ``with`` statement to insert any element into a column:
@@ -768,7 +766,6 @@ class LayoutsMixin:
768
766
 
769
767
  Parameters
770
768
  ----------
771
-
772
769
  label : str
773
770
  The initial label of the status container. The label can optionally
774
771
  contain GitHub-flavored Markdown of the following types: Bold, Italics,
@@ -802,14 +799,12 @@ class LayoutsMixin:
802
799
 
803
800
  Returns
804
801
  -------
805
-
806
802
  StatusContainer
807
803
  A mutable status container that can hold multiple elements. The label, state,
808
804
  and expanded state can be updated after creation via ``.update()``.
809
805
 
810
806
  Examples
811
807
  --------
812
-
813
808
  You can use the ``with`` notation to insert any element into an status container:
814
809
 
815
810
  >>> import time
@@ -331,7 +331,7 @@ def _infer_vegalite_type(
331
331
  ) -> VegaLiteType:
332
332
  """
333
333
  From an array-like input, infer the correct vega typecode
334
- ('ordinal', 'nominal', 'quantitative', or 'temporal')
334
+ ('ordinal', 'nominal', 'quantitative', or 'temporal').
335
335
 
336
336
  Parameters
337
337
  ----------
@@ -503,7 +503,6 @@ def _melt_data(
503
503
 
504
504
  Examples
505
505
  --------
506
-
507
506
  >>> import pandas as pd
508
507
  >>> df = pd.DataFrame(
509
508
  ... {
@@ -142,7 +142,6 @@ def _determine_data_kind_via_arrow(field: pa.Field) -> ColumnDataKind:
142
142
 
143
143
  Parameters
144
144
  ----------
145
-
146
145
  field : pa.Field
147
146
  The arrow field from the arrow table schema.
148
147
 
@@ -375,7 +374,6 @@ def determine_dataframe_schema(
375
374
 
376
375
  Returns
377
376
  -------
378
-
379
377
  DataframeSchema
380
378
  A mapping that contains the detected data type for the index and columns.
381
379
  The key is the column name in the underlying dataframe or ``_index`` for index columns.
@@ -448,7 +446,6 @@ def update_column_config(
448
446
 
449
447
  Parameters
450
448
  ----------
451
-
452
449
  column_config_mapping : ColumnConfigMapping
453
450
  The column config mapping to update.
454
451
 
@@ -159,7 +159,6 @@ class ColumnConfig(TypedDict, total=False):
159
159
 
160
160
  Parameters
161
161
  ----------
162
-
163
162
  label: str or None
164
163
  The label shown at the top of the column. If this is ``None``
165
164
  (default), the column name is used.
@@ -264,7 +263,6 @@ def Column(
264
263
 
265
264
  Parameters
266
265
  ----------
267
-
268
266
  label: str or None
269
267
  The label shown at the top of the column. If this is ``None``
270
268
  (default), the column name is used.
@@ -309,7 +307,6 @@ def Column(
309
307
 
310
308
  Examples
311
309
  --------
312
-
313
310
  >>> import pandas as pd
314
311
  >>> import streamlit as st
315
312
  >>>
@@ -370,7 +367,6 @@ def NumberColumn(
370
367
 
371
368
  Parameters
372
369
  ----------
373
-
374
370
  label: str or None
375
371
  The label shown at the top of the column. If this is ``None``
376
372
  (default), the column name is used.
@@ -459,7 +455,6 @@ def NumberColumn(
459
455
 
460
456
  Examples
461
457
  --------
462
-
463
458
  >>> import pandas as pd
464
459
  >>> import streamlit as st
465
460
  >>>
@@ -528,7 +523,6 @@ def TextColumn(
528
523
 
529
524
  Parameters
530
525
  ----------
531
-
532
526
  label: str or None
533
527
  The label shown at the top of the column. If this is ``None``
534
528
  (default), the column name is used.
@@ -586,7 +580,6 @@ def TextColumn(
586
580
 
587
581
  Examples
588
582
  --------
589
-
590
583
  >>> import pandas as pd
591
584
  >>> import streamlit as st
592
585
  >>>
@@ -643,7 +636,7 @@ def LinkColumn(
643
636
  validate: str | None = None,
644
637
  display_text: str | None = None,
645
638
  ) -> ColumnConfig:
646
- """Configure a link column in ``st.dataframe`` or ``st.data_editor``.
639
+ r"""Configure a link column in ``st.dataframe`` or ``st.data_editor``.
647
640
 
648
641
  The cell values need to be string and will be shown as clickable links.
649
642
  This command needs to be used in the column_config parameter of ``st.dataframe``
@@ -652,7 +645,6 @@ def LinkColumn(
652
645
 
653
646
  Parameters
654
647
  ----------
655
-
656
648
  label: str or None
657
649
  The label shown at the top of the column. If this is ``None``
658
650
  (default), the column name is used.
@@ -716,12 +708,12 @@ def LinkColumn(
716
708
  - A string that is displayed in every cell, e.g. ``"Open link"``.
717
709
  - A JS-flavored regular expression (detected by usage of parentheses)
718
710
  to extract a part of the URL via a capture group. For example, use
719
- ``"https://(.*?)\\.example\\.com"`` to extract the display text
720
- "foo" from the URL "\\https://foo.example.com".
711
+ ``"https://(.*?)\.example\.com"`` to extract the display text
712
+ "foo" from the URL "\https://foo.example.com".
721
713
 
722
714
  .. Comment: The backslash in front of foo.example.com prevents a hyperlink in docs.
723
715
 
724
- For more complex cases, you may use `Pandas Styler's format \
716
+ For more complex cases, you may use `Pandas Styler's format
725
717
  <https://pandas.pydata.org/docs/reference/api/pandas.io.formats.style.Styler.format.html>`_
726
718
  function on the underlying dataframe. Note that this makes the app slow,
727
719
  doesn't work with editable columns, and might be removed in the future.
@@ -730,7 +722,6 @@ def LinkColumn(
730
722
 
731
723
  Examples
732
724
  --------
733
-
734
725
  >>> import pandas as pd
735
726
  >>> import streamlit as st
736
727
  >>>
@@ -757,9 +748,9 @@ def LinkColumn(
757
748
  >>> "apps": st.column_config.LinkColumn(
758
749
  >>> "Trending apps",
759
750
  >>> help="The top trending Streamlit apps",
760
- >>> validate=r"^https://[a-z]+\\.streamlit\\.app$",
751
+ >>> validate=r"^https://[a-z]+\.streamlit\.app$",
761
752
  >>> max_chars=100,
762
- >>> display_text=r"https://(.*?)\\.streamlit\\.app"
753
+ >>> display_text=r"https://(.*?)\.streamlit\.app"
763
754
  >>> ),
764
755
  >>> "creator": st.column_config.LinkColumn(
765
756
  >>> "App Creator", display_text="Open profile"
@@ -809,7 +800,6 @@ def CheckboxColumn(
809
800
 
810
801
  Parameters
811
802
  ----------
812
-
813
803
  label: str or None
814
804
  The label shown at the top of the column. If this is ``None``
815
805
  (default), the column name is used.
@@ -858,7 +848,6 @@ def CheckboxColumn(
858
848
 
859
849
  Examples
860
850
  --------
861
-
862
851
  >>> import pandas as pd
863
852
  >>> import streamlit as st
864
853
  >>>
@@ -919,7 +908,6 @@ def SelectboxColumn(
919
908
 
920
909
  Parameters
921
910
  ----------
922
-
923
911
  label: str or None
924
912
  The label shown at the top of the column. If this is ``None``
925
913
  (default), the column name is used.
@@ -974,7 +962,6 @@ def SelectboxColumn(
974
962
 
975
963
  Examples
976
964
  --------
977
-
978
965
  >>> import pandas as pd
979
966
  >>> import streamlit as st
980
967
  >>>
@@ -1044,7 +1031,6 @@ def BarChartColumn(
1044
1031
 
1045
1032
  Parameters
1046
1033
  ----------
1047
-
1048
1034
  label: str or None
1049
1035
  The label shown at the top of the column. If this is ``None``
1050
1036
  (default), the column name is used.
@@ -1082,7 +1068,6 @@ def BarChartColumn(
1082
1068
 
1083
1069
  Examples
1084
1070
  --------
1085
-
1086
1071
  >>> import pandas as pd
1087
1072
  >>> import streamlit as st
1088
1073
  >>>
@@ -1142,7 +1127,6 @@ def LineChartColumn(
1142
1127
 
1143
1128
  Parameters
1144
1129
  ----------
1145
-
1146
1130
  label: str or None
1147
1131
  The label shown at the top of the column. If this is ``None``
1148
1132
  (default), the column name is used.
@@ -1180,7 +1164,6 @@ def LineChartColumn(
1180
1164
 
1181
1165
  Examples
1182
1166
  --------
1183
-
1184
1167
  >>> import pandas as pd
1185
1168
  >>> import streamlit as st
1186
1169
  >>>
@@ -1241,7 +1224,6 @@ def AreaChartColumn(
1241
1224
 
1242
1225
  Parameters
1243
1226
  ----------
1244
-
1245
1227
  label: str or None
1246
1228
  The label shown at the top of the column. If this is ``None``
1247
1229
  (default), the column name is used.
@@ -1279,7 +1261,6 @@ def AreaChartColumn(
1279
1261
 
1280
1262
  Examples
1281
1263
  --------
1282
-
1283
1264
  >>> import pandas as pd
1284
1265
  >>> import streamlit as st
1285
1266
  >>>
@@ -1346,7 +1327,6 @@ def ImageColumn(
1346
1327
 
1347
1328
  Parameters
1348
1329
  ----------
1349
-
1350
1330
  label: str or None
1351
1331
  The label shown at the top of the column. If this is ``None``
1352
1332
  (default), the column name is used.
@@ -1376,7 +1356,6 @@ def ImageColumn(
1376
1356
 
1377
1357
  Examples
1378
1358
  --------
1379
-
1380
1359
  >>> import pandas as pd
1381
1360
  >>> import streamlit as st
1382
1361
  >>>
@@ -1430,7 +1409,6 @@ def ListColumn(
1430
1409
 
1431
1410
  Parameters
1432
1411
  ----------
1433
-
1434
1412
  label: str or None
1435
1413
  The label shown at the top of the column. If this is ``None``
1436
1414
  (default), the column name is used.
@@ -1460,7 +1438,6 @@ def ListColumn(
1460
1438
 
1461
1439
  Examples
1462
1440
  --------
1463
-
1464
1441
  >>> import pandas as pd
1465
1442
  >>> import streamlit as st
1466
1443
  >>>
@@ -1525,7 +1502,6 @@ def DatetimeColumn(
1525
1502
 
1526
1503
  Parameters
1527
1504
  ----------
1528
-
1529
1505
  label: str or None
1530
1506
  The label shown at the top of the column. If this is ``None``
1531
1507
  (default), the column name is used.
@@ -1612,7 +1588,6 @@ def DatetimeColumn(
1612
1588
 
1613
1589
  Examples
1614
1590
  --------
1615
-
1616
1591
  >>> from datetime import datetime
1617
1592
  >>> import pandas as pd
1618
1593
  >>> import streamlit as st
@@ -1689,7 +1664,6 @@ def TimeColumn(
1689
1664
 
1690
1665
  Parameters
1691
1666
  ----------
1692
-
1693
1667
  label: str or None
1694
1668
  The label shown at the top of the column. If this is ``None``
1695
1669
  (default), the column name is used.
@@ -1768,7 +1742,6 @@ def TimeColumn(
1768
1742
 
1769
1743
  Examples
1770
1744
  --------
1771
-
1772
1745
  >>> from datetime import time
1773
1746
  >>> import pandas as pd
1774
1747
  >>> import streamlit as st
@@ -1844,7 +1817,6 @@ def DateColumn(
1844
1817
 
1845
1818
  Parameters
1846
1819
  ----------
1847
-
1848
1820
  label: str or None
1849
1821
  The label shown at the top of the column. If this is ``None``
1850
1822
  (default), the column name is used.
@@ -1925,7 +1897,6 @@ def DateColumn(
1925
1897
 
1926
1898
  Examples
1927
1899
  --------
1928
-
1929
1900
  >>> from datetime import date
1930
1901
  >>> import pandas as pd
1931
1902
  >>> import streamlit as st
@@ -1996,7 +1967,6 @@ def ProgressColumn(
1996
1967
 
1997
1968
  Parameters
1998
1969
  ----------
1999
-
2000
1970
  label: str or None
2001
1971
  The label shown at the top of the column. If this is ``None``
2002
1972
  (default), the column name is used.
@@ -2059,7 +2029,6 @@ def ProgressColumn(
2059
2029
 
2060
2030
  Examples
2061
2031
  --------
2062
-
2063
2032
  >>> import pandas as pd
2064
2033
  >>> import streamlit as st
2065
2034
  >>>
@@ -2118,7 +2087,6 @@ def JsonColumn(
2118
2087
 
2119
2088
  Parameters
2120
2089
  ----------
2121
-
2122
2090
  label: str or None
2123
2091
  The label shown at the top of the column. If this is ``None``
2124
2092
  (default), the column name is used.
@@ -2148,7 +2116,6 @@ def JsonColumn(
2148
2116
 
2149
2117
  Examples
2150
2118
  --------
2151
-
2152
2119
  >>> import pandas as pd
2153
2120
  >>> import streamlit as st
2154
2121
  >>>
@@ -241,7 +241,7 @@ def image_to_url(
241
241
  If `image` is already a URL, return it unmodified.
242
242
  Otherwise, add the image to the MediaFileManager and return the URL.
243
243
  (When running in "raw" mode, we won't actually load data into the
244
- MediaFileManager, and we'll return an empty URL.)
244
+ MediaFileManager, and we'll return an empty URL).
245
245
  """
246
246
  import numpy as np
247
247
  from PIL import Image, ImageFile
@@ -359,6 +359,7 @@ def marshall_images(
359
359
  ) -> None:
360
360
  """Fill an ImageListProto with a list of images and their captions.
361
361
  The images will be resized and reformatted as necessary.
362
+
362
363
  Parameters
363
364
  ----------
364
365
  coordinates
@@ -155,7 +155,8 @@ def _coerce_enum(from_enum_value: E1, to_enum_class: type[E2]) -> E1 | E2:
155
155
 
156
156
  def _extract_common_class_from_iter(iterable: Iterable[Any]) -> Any:
157
157
  """Return the common class of all elements in a iterable if they share one.
158
- Otherwise, return None."""
158
+ Otherwise, return None.
159
+ """
159
160
  try:
160
161
  inner_iter = iter(iterable)
161
162
  first_class = type(next(inner_iter))
@@ -185,7 +186,8 @@ def maybe_coerce_enum(
185
186
  def maybe_coerce_enum(register_widget_result, options, opt_sequence):
186
187
  """Maybe Coerce a RegisterWidgetResult with an Enum member value to
187
188
  RegisterWidgetResult[option] if option is an EnumType, otherwise just return
188
- the original RegisterWidgetResult."""
189
+ the original RegisterWidgetResult.
190
+ """
189
191
 
190
192
  # If the value is not a Enum, return early
191
193
  if not isinstance(register_widget_result.value, Enum):
@@ -226,7 +228,8 @@ def maybe_coerce_enum_sequence(
226
228
  def maybe_coerce_enum_sequence(register_widget_result, options, opt_sequence):
227
229
  """Maybe Coerce a RegisterWidgetResult with a sequence of Enum members as value
228
230
  to RegisterWidgetResult[Sequence[option]] if option is an EnumType, otherwise just return
229
- the original RegisterWidgetResult."""
231
+ the original RegisterWidgetResult.
232
+ """
230
233
 
231
234
  # If not all widget values are Enums, return early
232
235
  if not all(isinstance(val, Enum) for val in register_widget_result.value):
@@ -73,10 +73,12 @@ def _srt_to_vtt(srt_data: str | bytes) -> bytes:
73
73
  Convert subtitles from SubRip (.srt) format to WebVTT (.vtt) format.
74
74
  This function accepts the content of the .srt file either as a string
75
75
  or as a BytesIO stream.
76
+
76
77
  Parameters
77
78
  ----------
78
79
  srt_data : str or bytes
79
80
  The content of the .srt file as a string or a bytes stream.
81
+
80
82
  Returns
81
83
  -------
82
84
  bytes