streamlit-nightly 1.29.1.dev20240107__py2.py3-none-any.whl → 1.29.1.dev20240108__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.
@@ -56,7 +56,7 @@ def stop() -> NoReturn: # type: ignore[misc]
56
56
  def rerun() -> NoReturn: # type: ignore[misc]
57
57
  """Rerun the script immediately.
58
58
 
59
- When `st.rerun()` is called, the script is halted - no more statements will
59
+ When ``st.rerun()`` is called, the script is halted - no more statements will
60
60
  be run, and the script will be queued to re-run from the top.
61
61
  """
62
62
 
@@ -80,7 +80,7 @@ def rerun() -> NoReturn: # type: ignore[misc]
80
80
  def experimental_rerun() -> NoReturn:
81
81
  """Rerun the script immediately.
82
82
 
83
- When `st.experimental_rerun()` is called, the script is halted - no
83
+ When ``st.experimental_rerun()`` is called, the script is halted - no
84
84
  more statements will be run, and the script will be queued to re-run
85
85
  from the top.
86
86
  """
@@ -94,13 +94,42 @@ def experimental_rerun() -> NoReturn:
94
94
 
95
95
  @gather_metrics("switch_page")
96
96
  def switch_page(page: str) -> NoReturn: # type: ignore[misc]
97
- """Switch the current programmatically page in a multi-page app.
98
- When `st.switch_page()` is called with a page, the current page script is halted
99
- and the requested page script will be queued to run from the top.
97
+ """Programmatically switch the current page in a multipage app.
98
+
99
+ When ``st.switch_page()`` is called, the current page execution stops and
100
+ the specified page runs as if the user clicked on it in the sidebar
101
+ navigation. The specified page must be recognized by Streamlit's multipage
102
+ architecture (your main Python file or a Python file in a ``pages/``
103
+ folder). Arbitrary Python scripts cannot be passed to ``st.switch_pages``.
104
+
100
105
  Parameters
101
106
  ----------
102
107
  page: str
103
- The file path, relative to the main script, of the page to switch to.
108
+ The file path (relative to the main script) of the page to switch to.
109
+
110
+ Example
111
+ -------
112
+ Consider the following example given this file structure:
113
+
114
+ >>> your-repository/
115
+ >>> ├── pages/
116
+ >>> │ ├── page_1.py.py
117
+ >>> │ └── page_2.py.py
118
+ >>> └── your_app.py
119
+
120
+ >>> import streamlit as st
121
+ >>>
122
+ >>> if st.button("Home"):
123
+ >>> st.switch_page("your_app.py")
124
+ >>> if st.button("Page 1"):
125
+ >>> st.switch_page("pages/page_1.py")
126
+ >>> if st.button("Page 2"):
127
+ >>> st.switch_page("pages/page_2.py")
128
+
129
+ .. output ::
130
+ https://doc-switch-page.streamlit.app/
131
+ height: 350px
132
+
104
133
  """
105
134
 
106
135
  ctx = get_script_run_ctx()
@@ -93,7 +93,36 @@ class LayoutsMixin:
93
93
 
94
94
  .. output ::
95
95
  https://doc-container2.streamlit.app/
96
- height: 480px
96
+ height: 300px
97
+
98
+ Using ``height`` to make a grid:
99
+
100
+ >>> import streamlit as st
101
+ >>>
102
+ >>> row1 = st.columns(3)
103
+ >>> row2 = st.columns(3)
104
+ >>>
105
+ >>> for col in row1 + row2:
106
+ >>> tile = col.container(height=120, border=True)
107
+ >>> tile.title(":balloon:")
108
+
109
+ .. output ::
110
+ https://doc-container3.streamlit.app/
111
+ height: 350px
112
+
113
+ Using ``height`` to create a scrolling container for long content:
114
+
115
+ >>> import streamlit as st
116
+ >>>
117
+ >>> long_text = "Lorem ipsum. " * 1000
118
+ >>>
119
+ >>> with st.container(height=300):
120
+ >>> st.markdown(long_text)
121
+
122
+ .. output ::
123
+ https://doc-container4.streamlit.app/
124
+ height: 400px
125
+
97
126
  """
98
127
  block_proto = BlockProto()
99
128
  block_proto.allow_empty = False
@@ -98,7 +98,7 @@ class PlotlyMixin:
98
98
 
99
99
  Parameters
100
100
  ----------
101
- figure_or_data : plotly.graph_objs.Figure, plotly.graph_objs.Data,
101
+ figure_or_data : plotly.graph_objs.Figure, plotly.graph_objs.Data,\
102
102
  dict/list of plotly.graph_objs.Figure/Data
103
103
 
104
104
  See https://plot.ly/python/ for examples of graph descriptions.
@@ -303,8 +303,6 @@ class CacheResourceAPI:
303
303
  <https://docs.python.org/3/library/datetime.html#timedelta-objects>`_,
304
304
  e.g. ``timedelta(days=1)``.
305
305
 
306
- Note that ``ttl`` will be ignored if ``persist="disk"`` or ``persist=True``.
307
-
308
306
  max_entries : int or None
309
307
  The maximum number of entries to keep in the cache, or None
310
308
  for an unbounded cache. When a new entry is added to a full cache,
@@ -20,7 +20,8 @@ from streamlit.runtime.state.session_state_proxy import get_session_state
20
20
 
21
21
 
22
22
  class QueryParamsProxy(MutableMapping[str, str]):
23
- """A stateless singleton that proxies `st.query_params` interactions
23
+ """
24
+ A stateless singleton that proxies ``st.query_params`` interactions
24
25
  to the current script thread's QueryParams instance.
25
26
  """
26
27
 
@@ -68,15 +69,51 @@ class QueryParamsProxy(MutableMapping[str, str]):
68
69
 
69
70
  @gather_metrics("query_params.get_all")
70
71
  def get_all(self, key: str) -> List[str]:
72
+ """
73
+ Get a list of all query parameter values associated to a given key.
74
+
75
+ When a key is repeated as a query parameter within the URL, this method
76
+ allows all values to be obtained. In contrast, dict-like methods only
77
+ retrieve the last value when a key is repeated in the URL.
78
+
79
+ Parameters
80
+ ----------
81
+ key: str
82
+ The label of the query parameter in the URL.
83
+
84
+ Returns
85
+ -------
86
+ List[str]
87
+ A list of values associated to the given key. May return zero, one,
88
+ or multiple values.
89
+ """
71
90
  with get_session_state().query_params() as qp:
72
91
  return qp.get_all(key)
73
92
 
74
93
  @gather_metrics("query_params.clear")
75
94
  def clear(self) -> None:
95
+ """
96
+ Clear all query parameters from the URL of the app.
97
+
98
+ Returns
99
+ -------
100
+ None
101
+ """
76
102
  with get_session_state().query_params() as qp:
77
103
  qp.clear()
78
104
 
79
105
  @gather_metrics("query_params.to_dict")
80
106
  def to_dict(self) -> Dict[str, str]:
107
+ """
108
+ Get all query parameters as a dictionary.
109
+
110
+ When a key is repeated as a query parameter within the URL, this method
111
+ will return only the last value of each unique key.
112
+
113
+ Returns
114
+ -------
115
+ Dict[str,str]
116
+ A dictionary of the current query paramters in the app's URL.
117
+ """
81
118
  with get_session_state().query_params() as qp:
82
119
  return qp.to_dict()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: streamlit-nightly
3
- Version: 1.29.1.dev20240107
3
+ Version: 1.29.1.dev20240108
4
4
  Summary: A faster way to build and share data apps
5
5
  Home-page: https://streamlit.io
6
6
  Author: Snowflake Inc
@@ -33,7 +33,7 @@ streamlit/user_info.py,sha256=Ggv5OUw2BNLWbnqQ85agaPvAGarGtROVEWEm5uxExtI,1986
33
33
  streamlit/util.py,sha256=OjZXmz5t_h7SOuvauezUxuQblyUsxd_BzG2-WKGzuxI,6402
34
34
  streamlit/version.py,sha256=NNB_tfVDaLP-CtNeszLbnJVVyI_0hw8Q64NOPRnvkZo,3365
35
35
  streamlit/commands/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
36
- streamlit/commands/execution_control.py,sha256=ezG-wr59VLbjV4VMp2KXU1fT29MQ83s_0d9VwgnocGM,4587
36
+ streamlit/commands/execution_control.py,sha256=zJWuxXgatM65egG3wiQyunBetE3lsltkxw0vslotu2k,5416
37
37
  streamlit/commands/experimental_query_params.py,sha256=tqUVoJglyQT97qYu0EkDVg0jENOVwKjPHByFoxxnkjA,5053
38
38
  streamlit/commands/page_config.py,sha256=w0T_wTzfDhGdMZLSNRMsYqGxqmH1FuE3dGMH3dW6JSk,12111
39
39
  streamlit/components/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
@@ -65,12 +65,12 @@ streamlit/elements/heading.py,sha256=1Q0qqKlkyIOi_ve-LTTwtYC-Kx-2eeXfwHwZvpNKtaU
65
65
  streamlit/elements/iframe.py,sha256=6bW5gPQt5-2FwnlFwjB2JHFOVZ-SOCT5x8VIg7skAC4,4387
66
66
  streamlit/elements/image.py,sha256=SEQ8m0FIXA4HNo11mUIjGL7perThMgZ9LH3tJU5dXGk,20076
67
67
  streamlit/elements/json.py,sha256=fMLeA9FcvV1n-SOWaO5XrAI41HoXNo5qY6u7hMVsLFM,3352
68
- streamlit/elements/layouts.py,sha256=JPUUz0AtXV4qmGt4FZksJ8xCcsKCpcqJfAbxQV5ARXk,21745
68
+ streamlit/elements/layouts.py,sha256=dlCGuK98XiVMqStIIeUHMW_M_3BuqXekc7MRK4HdPkU,22513
69
69
  streamlit/elements/map.py,sha256=pPudBRZME_tFG2dwt8QCjYVV4eEdNINmLeiz2h_yBj0,16180
70
70
  streamlit/elements/markdown.py,sha256=rSsKWigW6ojZOYN4szreSSRPb6tGQVRaqIBW-mIKLNw,9912
71
71
  streamlit/elements/media.py,sha256=XT7w56fXwBLUgqTgNiMi_gSZg95kNP8C9SbtjROcfPg,14671
72
72
  streamlit/elements/metric.py,sha256=jKrpoIbSlKQI_Xw7Cy5ZxtJ0Bc-eKgdgDB3zBsuSJO4,9882
73
- streamlit/elements/plotly_chart.py,sha256=ed4R5Vo2dEsvbNahtOo9FvuunsstUEmnBnF6otZJt5M,8809
73
+ streamlit/elements/plotly_chart.py,sha256=H2ZW64lJH60KK_uk-zS1jEQ_cIhi6z3ubzfjgmbFiGs,8810
74
74
  streamlit/elements/progress.py,sha256=OKPljeEoU18GqiCbgdWmElf7xWOwgYKnjWTo9sIi67o,4758
75
75
  streamlit/elements/pyplot.py,sha256=udVkpFR5jNNJPKScsIlH1GEJrRYy_bCWJwVU_aMEBK8,6578
76
76
  streamlit/elements/snow.py,sha256=LScypkYNNPWEnEwElspnAuHo8OqBmwJfyAo7dcjGezc,1407
@@ -278,7 +278,7 @@ streamlit/runtime/websocket_session_manager.py,sha256=ILbT86PWN-z2DyOxcAMqz-oPGD
278
278
  streamlit/runtime/caching/__init__.py,sha256=anR_SzNOFYDo_9_Y9liP5JnmTWjs3kq1kVX7maRfDNg,5012
279
279
  streamlit/runtime/caching/cache_data_api.py,sha256=w_zRUrqJ596yJ2KCQfN9phVV96CjEKyPpKhZCIvlXdw,26088
280
280
  streamlit/runtime/caching/cache_errors.py,sha256=u9LQlKKgq1XOVZA83eUhlKb1xhIFV6M50gIL2odcrEs,6351
281
- streamlit/runtime/caching/cache_resource_api.py,sha256=ajBEaMelMqCyd6NSdN0uRDL-htJD50kKIkKlfz7jkhA,21270
281
+ streamlit/runtime/caching/cache_resource_api.py,sha256=tIUwNYUhOk9S4zmt9ZTSAqL4f0F2JEyYTxHBV5ACP38,21180
282
282
  streamlit/runtime/caching/cache_type.py,sha256=r_tzxXL_BAgVYTJr57qAiCjxoSdU7DdPRVliGGcKIaU,1095
283
283
  streamlit/runtime/caching/cache_utils.py,sha256=FIhrJTpdFMMYnwrmch_B5VHs0zzaB53AnxTAyVyrOK4,17802
284
284
  streamlit/runtime/caching/cached_message_replay.py,sha256=qxpwVc5Kvqd9sU1bKW5XQ-iDBFgzuYl9eGZG26i9ibM,18540
@@ -301,7 +301,7 @@ streamlit/runtime/scriptrunner/script_runner.py,sha256=hsz_veNsByrGNRLmZYhBY7uVB
301
301
  streamlit/runtime/state/__init__.py,sha256=UpfNfPrWJ6rVdD-qc0IP_bwZ4MrcNUjyU9wEKDK-eWM,1528
302
302
  streamlit/runtime/state/common.py,sha256=7p_wX1jegw_7KYeU8-oHqxOQKK5HybSLU7b1c1_1skA,7579
303
303
  streamlit/runtime/state/query_params.py,sha256=hBf4smsynEOoeG9IeNLFpOQBVXQijQgsQ9EhuPdqLkQ,5038
304
- streamlit/runtime/state/query_params_proxy.py,sha256=XkX3E-cW-9TcFFUgOsGAwYazwZ37f4J8XmyzZxtuACk,3078
304
+ streamlit/runtime/state/query_params_proxy.py,sha256=GoSIHzchD6WrmxWcLr8xiRvt45VUPkm6MVA2enjtPWo,4161
305
305
  streamlit/runtime/state/safe_session_state.py,sha256=UIhqIDtpqP9sX7n3xo1o6X1ft-x6u7uHd34p8MoUAD0,5163
306
306
  streamlit/runtime/state/session_state.py,sha256=MbUxYklQOXzp5tZxOFML_izFR0l45zhAlINBfFaFhEk,26120
307
307
  streamlit/runtime/state/session_state_proxy.py,sha256=cQBtnC1S2awdXlKPKHPJxdQiL5bjObCjYnhyAGkep6g,5117
@@ -498,9 +498,9 @@ streamlit/web/server/server_util.py,sha256=_-RaGl6LU3gebVlW1W6VTAK_6G1S7Zv9ioSW2
498
498
  streamlit/web/server/stats_request_handler.py,sha256=namo6XxyEeACPbKlA9UjnXsJX8pMgVAQDmd7l1iUQvA,3410
499
499
  streamlit/web/server/upload_file_request_handler.py,sha256=WT7SnV6O6hmaK6K2R0smAvvf6LAL-UIMj1ucm5I7514,5034
500
500
  streamlit/web/server/websocket_headers.py,sha256=wZOcWCOZWIfn_omo6ymuy_HaMKa2MMHgri9I2aOggYw,1872
501
- streamlit_nightly-1.29.1.dev20240107.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
502
- streamlit_nightly-1.29.1.dev20240107.dist-info/METADATA,sha256=nh6xbNyinJOdhmE-GsVsqGgPSh7rA8uEkDyKtPl7W0g,8180
503
- streamlit_nightly-1.29.1.dev20240107.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
504
- streamlit_nightly-1.29.1.dev20240107.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
505
- streamlit_nightly-1.29.1.dev20240107.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
506
- streamlit_nightly-1.29.1.dev20240107.dist-info/RECORD,,
501
+ streamlit_nightly-1.29.1.dev20240108.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
502
+ streamlit_nightly-1.29.1.dev20240108.dist-info/METADATA,sha256=oeseS0DVVM0HrRumD9FlXhFaDYwY-BeX2q4ZPia3grQ,8180
503
+ streamlit_nightly-1.29.1.dev20240108.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
504
+ streamlit_nightly-1.29.1.dev20240108.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
505
+ streamlit_nightly-1.29.1.dev20240108.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
506
+ streamlit_nightly-1.29.1.dev20240108.dist-info/RECORD,,