streamlit 1.48.0__py3-none-any.whl → 1.49.0__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 (208) hide show
  1. streamlit/__init__.py +3 -10
  2. streamlit/commands/logo.py +4 -3
  3. streamlit/commands/navigation.py +1 -1
  4. streamlit/commands/page_config.py +4 -1
  5. streamlit/components/v1/custom_component.py +2 -2
  6. streamlit/config.py +82 -1
  7. streamlit/connections/snowflake_connection.py +3 -1
  8. streamlit/delta_generator.py +3 -0
  9. streamlit/elements/arrow.py +155 -70
  10. streamlit/elements/bokeh_chart.py +13 -3
  11. streamlit/elements/deck_gl_json_chart.py +0 -1
  12. streamlit/elements/dialog_decorator.py +7 -59
  13. streamlit/elements/form.py +10 -1
  14. streamlit/elements/graphviz_chart.py +57 -6
  15. streamlit/elements/heading.py +17 -16
  16. streamlit/elements/iframe.py +13 -22
  17. streamlit/elements/image.py +64 -37
  18. streamlit/elements/layouts.py +2 -2
  19. streamlit/elements/lib/built_in_chart_utils.py +2 -5
  20. streamlit/elements/lib/column_config_utils.py +18 -4
  21. streamlit/elements/lib/column_types.py +75 -30
  22. streamlit/elements/lib/dialog.py +3 -3
  23. streamlit/elements/lib/image_utils.py +19 -11
  24. streamlit/elements/lib/layout_utils.py +15 -2
  25. streamlit/elements/lib/utils.py +20 -41
  26. streamlit/elements/markdown.py +7 -6
  27. streamlit/elements/media.py +6 -13
  28. streamlit/elements/metric.py +78 -1
  29. streamlit/elements/pdf.py +192 -0
  30. streamlit/elements/plotly_chart.py +3 -2
  31. streamlit/elements/pyplot.py +53 -11
  32. streamlit/elements/toast.py +81 -5
  33. streamlit/elements/vega_charts.py +3 -8
  34. streamlit/elements/widgets/audio_input.py +0 -1
  35. streamlit/elements/widgets/button.py +0 -4
  36. streamlit/elements/widgets/button_group.py +5 -4
  37. streamlit/elements/widgets/camera_input.py +0 -1
  38. streamlit/elements/widgets/chat.py +11 -13
  39. streamlit/elements/widgets/checkbox.py +0 -1
  40. streamlit/elements/widgets/color_picker.py +0 -1
  41. streamlit/elements/widgets/data_editor.py +142 -62
  42. streamlit/elements/widgets/file_uploader.py +74 -37
  43. streamlit/elements/widgets/multiselect.py +0 -1
  44. streamlit/elements/widgets/number_input.py +0 -1
  45. streamlit/elements/widgets/radio.py +0 -1
  46. streamlit/elements/widgets/select_slider.py +0 -1
  47. streamlit/elements/widgets/selectbox.py +0 -1
  48. streamlit/elements/widgets/slider.py +0 -1
  49. streamlit/elements/widgets/text_widgets.py +0 -2
  50. streamlit/elements/widgets/time_widgets.py +0 -2
  51. streamlit/errors.py +11 -0
  52. streamlit/material_icon_names.py +1 -1
  53. streamlit/proto/Arrow_pb2.py +14 -8
  54. streamlit/proto/Arrow_pb2.pyi +11 -3
  55. streamlit/proto/Block_pb2.py +16 -16
  56. streamlit/proto/Block_pb2.pyi +2 -0
  57. streamlit/proto/ChatInput_pb2.py +3 -3
  58. streamlit/proto/ChatInput_pb2.pyi +2 -0
  59. streamlit/proto/FileUploader_pb2.py +2 -2
  60. streamlit/proto/FileUploader_pb2.pyi +5 -1
  61. streamlit/proto/GraphVizChart_pb2.py +4 -2
  62. streamlit/proto/GraphVizChart_pb2.pyi +1 -1
  63. streamlit/proto/IFrame_pb2.py +8 -2
  64. streamlit/proto/IFrame_pb2.pyi +3 -0
  65. streamlit/proto/Image_pb2.py +4 -2
  66. streamlit/proto/Image_pb2.pyi +1 -10
  67. streamlit/proto/Metric_pb2.py +8 -6
  68. streamlit/proto/Metric_pb2.pyi +34 -10
  69. streamlit/proto/Toast_pb2.py +2 -2
  70. streamlit/proto/Toast_pb2.pyi +10 -1
  71. streamlit/runtime/caching/__init__.py +14 -2
  72. streamlit/runtime/caching/cache_data_api.py +0 -17
  73. streamlit/runtime/caching/cache_resource_api.py +0 -16
  74. streamlit/runtime/caching/cached_message_replay.py +8 -20
  75. streamlit/runtime/caching/hashing.py +31 -1
  76. streamlit/runtime/credentials.py +4 -4
  77. streamlit/runtime/fragment.py +0 -42
  78. streamlit/runtime/websocket_session_manager.py +1 -1
  79. streamlit/static/index.html +2 -2
  80. streamlit/static/manifest.json +224 -252
  81. streamlit/static/static/css/{index.CJVRHjQZ.css → index.C8X8rNzw.css} +1 -1
  82. streamlit/static/static/css/index.COe1010n.css +1 -0
  83. streamlit/static/static/js/{ErrorOutline.esm.D_4oFNKB.js → ErrorOutline.esm.u9XvzxL8.js} +1 -1
  84. streamlit/static/static/js/{FileDownload.esm.NPgaLlUE.js → FileDownload.esm.CaRyZ-b2.js} +1 -1
  85. streamlit/static/static/js/FileHelper.Dk2SwIi3.js +5 -0
  86. streamlit/static/static/js/FormClearHelper.l_UPPvkg.js +1 -0
  87. streamlit/static/static/js/{Hooks.BGm9sd4U.js → Hooks.BxrVEftw.js} +1 -1
  88. streamlit/static/static/js/InputInstructions.C254RU9X.js +1 -0
  89. streamlit/static/static/js/Particles.DkY6FDnc.js +1 -0
  90. streamlit/static/static/js/ProgressBar.BPtSM82n.js +2 -0
  91. streamlit/static/static/js/Toolbar.BO_3WBaS.js +1 -0
  92. streamlit/static/static/js/{base-input.DeBqm5mN.js → base-input.egUI4LjJ.js} +4 -4
  93. streamlit/static/static/js/{checkbox.C0odQfKb.js → checkbox.ButpszcE.js} +2 -2
  94. streamlit/static/static/js/createSuper.DYJA5xa6.js +1 -0
  95. streamlit/static/static/js/data-grid-overlay-editor.C9gQLEnU.js +1 -0
  96. streamlit/static/static/js/{downloader.Bx1D0jhz.js → downloader.B3TjsSPZ.js} +1 -1
  97. streamlit/static/static/js/es6.BYSNuG4D.js +2 -0
  98. streamlit/static/static/js/iframeResizer.contentWindow.CNPHJsF2.js +1 -0
  99. streamlit/static/static/js/index.0tDq1WXk.js +1 -0
  100. streamlit/static/static/js/index.BBnWuh07.js +976 -0
  101. streamlit/static/static/js/index.BDZorv41.js +1 -0
  102. streamlit/static/static/js/{index.DwaoC4Zp.js → index.BH79B25f.js} +3 -3
  103. streamlit/static/static/js/index.BeTC4Yl-.js +197 -0
  104. streamlit/static/static/js/index.BnOd05Ko.js +2 -0
  105. streamlit/static/static/js/index.BoJaJReB.js +1 -0
  106. streamlit/static/static/js/index.Bp1Of6L8.js +1 -0
  107. streamlit/static/static/js/index.Bpe4-O2W.js +1 -0
  108. streamlit/static/static/js/index.BrD9sbpx.js +1 -0
  109. streamlit/static/static/js/index.C1qCS-sd.js +1 -0
  110. streamlit/static/static/js/index.C3EXAI-u.js +1 -0
  111. streamlit/static/static/js/index.C77g9sAQ.js +3 -0
  112. streamlit/static/static/js/{index.PyIqRRSR.js → index.CFePF7s4.js} +1 -1
  113. streamlit/static/static/js/index.CFjU0x00.js +1 -0
  114. streamlit/static/static/js/index.Ca3y4ztK.js +1 -0
  115. streamlit/static/static/js/{index.ClRTsv8m.js → index.Cb9gN2T2.js} +2 -2
  116. streamlit/static/static/js/{index.wDYef4mQ.js → index.CbwuUwu4.js} +9 -9
  117. streamlit/static/static/js/index.CeXLlclc.js +1 -0
  118. streamlit/static/static/js/index.CfiZGqj3.js +3 -0
  119. streamlit/static/static/js/index.CjQnYKID.js +1 -0
  120. streamlit/static/static/js/index.Cl_966eE.js +3858 -0
  121. streamlit/static/static/js/{index.DCpyIFTV.js → index.CqSRo6zQ.js} +1 -1
  122. streamlit/static/static/js/index.CuEFSQ-o.js +1 -0
  123. streamlit/static/static/js/index.D4jR1m1z.js +1 -0
  124. streamlit/static/static/js/index.DGcW849X.js +1 -0
  125. streamlit/static/static/js/index.DKb-BAE2.js +1 -0
  126. streamlit/static/static/js/index.DP1rDFP0.js +1 -0
  127. streamlit/static/static/js/{index.HeVbRh9H.js → index.DStzYLqM.js} +2 -2
  128. streamlit/static/static/js/index.DVKQKDLu.js +1 -0
  129. streamlit/static/static/js/index.DWedOrkQ.js +1 -0
  130. streamlit/static/static/js/index.DYbRPmVF.js +1 -0
  131. streamlit/static/static/js/index.DgpIMUsr.js +1 -0
  132. streamlit/static/static/js/index.DtwkPJs5.js +5367 -0
  133. streamlit/static/static/js/{index.CnfWsQzS.js → index.MQLQLR5Z.js} +1 -1
  134. streamlit/static/static/js/index.uInpwWAP.js +1 -0
  135. streamlit/static/static/js/index.z992t-BQ.js +7 -0
  136. streamlit/static/static/js/{input.BL2buuce.js → input.CbP5ZuQ7.js} +2 -2
  137. streamlit/static/static/js/{memory.CUxjUWS7.js → memory.BuacVo2L.js} +1 -1
  138. streamlit/static/static/js/number-overlay-editor.BZb9zRl_.js +9 -0
  139. streamlit/static/static/js/{possibleConstructorReturn.DbvQboK3.js → possibleConstructorReturn.DSM84rOS.js} +1 -1
  140. streamlit/static/static/js/{sandbox.6lnFVWhX.js → sandbox.C480llMG.js} +1 -1
  141. streamlit/static/static/js/{timepicker.Bg4xAK95.js → timepicker.BunxCVp7.js} +4 -4
  142. streamlit/static/static/js/{toConsumableArray.D9x7Ktv4.js → toConsumableArray.B4o8rEx1.js} +3 -3
  143. streamlit/static/static/js/uniqueId.tii0yosY.js +1 -0
  144. streamlit/static/static/js/{useBasicWidgetState.CUSYQZpm.js → useBasicWidgetState.Bnm4FD6K.js} +1 -1
  145. streamlit/static/static/js/useTextInputAutoExpand.Dgtwc1m0.js +2 -0
  146. streamlit/static/static/js/useUpdateUiValue.DjXdMFGw.js +1 -0
  147. streamlit/static/static/js/withFullScreenWrapper.0cy2pVf5.js +1 -0
  148. streamlit/static/static/media/MaterialSymbols-Rounded.CBxVaFdk.woff2 +0 -0
  149. streamlit/user_info.py +16 -13
  150. streamlit/web/server/browser_websocket_handler.py +15 -0
  151. streamlit/web/server/oauth_authlib_routes.py +3 -59
  152. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/METADATA +4 -2
  153. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/RECORD +157 -160
  154. streamlit/static/static/css/index.CQt5TjGB.css +0 -1
  155. streamlit/static/static/js/FileHelper.B2t9ikoS.js +0 -5
  156. streamlit/static/static/js/FormClearHelper.BLEIUk6L.js +0 -1
  157. streamlit/static/static/js/InputInstructions.DtUxCBS8.js +0 -1
  158. streamlit/static/static/js/Particles.BDRPO7r3.js +0 -1
  159. streamlit/static/static/js/ProgressBar.B64DUUqp.js +0 -2
  160. streamlit/static/static/js/Toolbar.B3FquPk5.js +0 -1
  161. streamlit/static/static/js/createSuper.DqQ5L3XG.js +0 -1
  162. streamlit/static/static/js/data-grid-overlay-editor.DbNsQa8Y.js +0 -1
  163. streamlit/static/static/js/es6.CbPK4m0H.js +0 -2
  164. streamlit/static/static/js/iframeResizer.contentWindow.CfLKrptA.js +0 -1
  165. streamlit/static/static/js/index.0XDwe9RV.js +0 -203
  166. streamlit/static/static/js/index.4lI9TuZm.js +0 -3
  167. streamlit/static/static/js/index.6s0nVIis.js +0 -3855
  168. streamlit/static/static/js/index.9E7bRUBU.js +0 -1
  169. streamlit/static/static/js/index.B9PgeLrZ.js +0 -1
  170. streamlit/static/static/js/index.B9vzGbOt.js +0 -1
  171. streamlit/static/static/js/index.BDrQKMCm.js +0 -1
  172. streamlit/static/static/js/index.BPsoiGgP.js +0 -1
  173. streamlit/static/static/js/index.CJzdLAun.js +0 -1
  174. streamlit/static/static/js/index.CNNlC1NL.js +0 -1
  175. streamlit/static/static/js/index.CO1sClzJ.js +0 -2
  176. streamlit/static/static/js/index.CZnagxXD.js +0 -1
  177. streamlit/static/static/js/index.Cb0xSF7V.js +0 -5366
  178. streamlit/static/static/js/index.CgUt3tz_.js +0 -1
  179. streamlit/static/static/js/index.CjImmcsV.js +0 -1
  180. streamlit/static/static/js/index.CrJ1XD_V.js +0 -1
  181. streamlit/static/static/js/index.CtiKsjSC.js +0 -1
  182. streamlit/static/static/js/index.CwAuytgV.js +0 -1
  183. streamlit/static/static/js/index.D7GB-kly.js +0 -1
  184. streamlit/static/static/js/index.DA5wU0mQ.js +0 -1
  185. streamlit/static/static/js/index.DE9wNOje.js +0 -1
  186. streamlit/static/static/js/index.DHnB-C8A.js +0 -1
  187. streamlit/static/static/js/index.DRTn9zvD.js +0 -1
  188. streamlit/static/static/js/index.DjMjyJl9.js +0 -7
  189. streamlit/static/static/js/index.DvRPFfw6.js +0 -781
  190. streamlit/static/static/js/index.F9tSej94.js +0 -1
  191. streamlit/static/static/js/index.J2D_m7LY.js +0 -197
  192. streamlit/static/static/js/index.dfivzJNz.js +0 -1
  193. streamlit/static/static/js/index.mRztGO69.js +0 -3
  194. streamlit/static/static/js/index.tB1kn_7z.js +0 -1
  195. streamlit/static/static/js/mergeWith.C1kp1zIi.js +0 -1
  196. streamlit/static/static/js/number-overlay-editor.WpheGpmR.js +0 -9
  197. streamlit/static/static/js/threshold.DjX0wlsa.js +0 -1
  198. streamlit/static/static/js/timer.CAwTRJ_g.js +0 -1
  199. streamlit/static/static/js/uniqueId.Bm8FHN92.js +0 -1
  200. streamlit/static/static/js/useTextInputAutoExpand.Bf2egQOG.js +0 -2
  201. streamlit/static/static/js/useUpdateUiValue.lE5xnYWF.js +0 -1
  202. streamlit/static/static/js/value.CgPGBV_l.js +0 -1
  203. streamlit/static/static/js/withFullScreenWrapper.CCOXR7N6.js +0 -1
  204. streamlit/static/static/media/MaterialSymbols-Rounded.DsbC8sYI.woff2 +0 -0
  205. {streamlit-1.48.0.data → streamlit-1.49.0.data}/scripts/streamlit.cmd +0 -0
  206. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/WHEEL +0 -0
  207. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/entry_points.txt +0 -0
  208. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/top_level.txt +0 -0
streamlit/user_info.py CHANGED
@@ -100,7 +100,9 @@ def login(provider: str | None = None) -> None:
100
100
  - You must install ``Authlib>=1.3.2`` to use this command. You can
101
101
  install it as an extra with Streamlit:
102
102
 
103
- >>> pip install streamlit[auth]
103
+ .. code-block:: shell
104
+
105
+ pip install streamlit[auth]
104
106
 
105
107
  - Your authentication configuration is dependent on your host location.
106
108
  When you deploy your app, remember to update your ``redirect_uri``
@@ -299,18 +301,19 @@ def login(provider: str | None = None) -> None:
299
301
  def logout() -> None:
300
302
  """Logout the current user.
301
303
 
302
- This command removes the user's information from ``st.user`` and deletes
303
- their Streamlit identity cookie. If the OpenID Connect (OIDC) provider's
304
- server metadata includes ``end_session_endpoint``, this command also
305
- redirects the user to perform a logout from the identity provider before
306
- returning to your app. Otherwise, it only performs a local logout from your
307
- app. This creates a new session.
308
-
309
- If the user has multiple sessions open in the same browser, ``st.user``
310
- will not be cleared in any other session. ``st.user`` only reads from the
311
- identity cookie at the start of a session. After a session is running, you
312
- must call ``st.login()`` or ``st.logout()`` within that session to update
313
- ``st.user``.
304
+ This command removes the user's information from ``st.user``,
305
+ deletes their identity cookie, and redirects them back to your app's home
306
+ page. This creates a new session.
307
+
308
+ If the user has multiple sessions open in the same browser,
309
+ ``st.user`` will not be cleared in any other session.
310
+ ``st.user`` only reads from the identity cookie at the start
311
+ of a session. After a session is running, you must call ``st.login()`` or
312
+ ``st.logout()`` within that session to update ``st.user``.
313
+
314
+ .. Note::
315
+ This does not log the user out of their underlying account from the
316
+ identity provider.
314
317
 
315
318
  Example
316
319
  -------
@@ -180,6 +180,21 @@ class BrowserWebSocketHandler(WebSocketHandler, SessionClient):
180
180
  # extract it from the Sec-Websocket-Protocol header.
181
181
  pass
182
182
 
183
+ # Map in any user-configured headers. Note that these override anything coming
184
+ # from the auth cookie.
185
+ mapping_config = config.get_option("server.trustedUserHeaders")
186
+ for header_name, user_info_key in mapping_config.items():
187
+ header_values = self.request.headers.get_list(header_name)
188
+ if header_values:
189
+ # If there's at least one value, use the first value.
190
+ # NOTE: Tornado doesn't document the order of these values, so it's
191
+ # possible this won't be the first value that was received by the
192
+ # server.
193
+ user_info[user_info_key] = header_values[0]
194
+ else:
195
+ # Default to explicit None.
196
+ user_info[user_info_key] = None
197
+
183
198
  self._session_id = self._runtime.connect_session(
184
199
  client=self,
185
200
  user_info=user_info,
@@ -15,7 +15,7 @@ from __future__ import annotations
15
15
 
16
16
  import json
17
17
  from typing import Any, Final, cast
18
- from urllib.parse import urlencode, urlparse
18
+ from urllib.parse import urlparse
19
19
 
20
20
  import tornado.web
21
21
 
@@ -130,63 +130,7 @@ class AuthLoginHandler(AuthHandlerMixin, tornado.web.RequestHandler):
130
130
  class AuthLogoutHandler(AuthHandlerMixin, tornado.web.RequestHandler):
131
131
  def get(self) -> None:
132
132
  self.clear_auth_cookie()
133
-
134
- provider_logout_url = self._get_provider_logout_url()
135
- if provider_logout_url:
136
- self.redirect(provider_logout_url)
137
- else:
138
- self.redirect_to_base()
139
-
140
- def _get_redirect_root(self) -> str | None:
141
- auth_section = get_secrets_auth_section()
142
- if not auth_section or not auth_section.get("redirect_uri"):
143
- return None
144
-
145
- redirect_uri: str = auth_section["redirect_uri"]
146
- if not redirect_uri.endswith("/oauth2callback"):
147
- _LOGGER.warning("Redirect URI does not end with /oauth2callback")
148
- return None
149
-
150
- return redirect_uri.removesuffix("oauth2callback")
151
-
152
- def _get_provider_logout_url(self) -> str | None:
153
- """Get the OAuth provider's logout URL from OIDC metadata."""
154
- try:
155
- cookie_value = self.get_signed_cookie(AUTH_COOKIE_NAME)
156
- except AttributeError: # Backward compatibility with Tornado < 6.3.0
157
- cookie_value = self.get_secure_cookie(AUTH_COOKIE_NAME)
158
-
159
- if not cookie_value:
160
- return None
161
-
162
- try:
163
- user_info = json.loads(cookie_value)
164
- provider = user_info.get("provider")
165
- if not provider:
166
- return None
167
-
168
- client, _ = create_oauth_client(provider)
169
-
170
- metadata = client.load_server_metadata()
171
- end_session_endpoint = metadata.get("end_session_endpoint")
172
-
173
- if not end_session_endpoint:
174
- _LOGGER.info("No end_session_endpoint found for provider %s", provider)
175
- return None
176
-
177
- redirect_root = self._get_redirect_root()
178
- if redirect_root is None:
179
- _LOGGER.info("Redirect url could not be determined")
180
- return None
181
-
182
- logout_params = {"post_logout_redirect_uri": redirect_root}
183
-
184
- # Not using id_token_hint as we don't store the id token
185
- return f"{end_session_endpoint}?{urlencode(logout_params)}"
186
-
187
- except Exception as e:
188
- _LOGGER.warning("Failed to get provider logout URL: %s", e)
189
- return None
133
+ self.redirect_to_base()
190
134
 
191
135
 
192
136
  class AuthCallbackHandler(AuthHandlerMixin, tornado.web.RequestHandler):
@@ -228,7 +172,7 @@ class AuthCallbackHandler(AuthHandlerMixin, tornado.web.RequestHandler):
228
172
  token = client.authorize_access_token(self)
229
173
  user = cast("dict[str, Any]", token.get("userinfo"))
230
174
 
231
- cookie_value = dict(user, origin=origin, is_logged_in=True, provider=provider)
175
+ cookie_value = dict(user, origin=origin, is_logged_in=True)
232
176
  if user:
233
177
  self.set_auth_cookie(cookie_value)
234
178
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamlit
3
- Version: 1.48.0
3
+ Version: 1.49.0
4
4
  Summary: A faster way to build and share data apps
5
5
  Home-page: https://streamlit.io
6
6
  Author: Snowflake Inc
@@ -52,6 +52,8 @@ Requires-Dist: tornado!=6.5.0,<7,>=6.0.3
52
52
  Provides-Extra: snowflake
53
53
  Requires-Dist: snowflake-snowpark-python[modin]>=1.17.0; python_version < "3.12" and extra == "snowflake"
54
54
  Requires-Dist: snowflake-connector-python>=3.3.0; python_version < "3.12" and extra == "snowflake"
55
+ Provides-Extra: pdf
56
+ Requires-Dist: streamlit-pdf>=1.0.0; extra == "pdf"
55
57
  Provides-Extra: auth
56
58
  Requires-Dist: Authlib>=1.3.2; extra == "auth"
57
59
  Provides-Extra: charts
@@ -62,7 +64,7 @@ Requires-Dist: orjson>=3.5.0; extra == "charts"
62
64
  Provides-Extra: sql
63
65
  Requires-Dist: SQLAlchemy>=2.0.0; extra == "sql"
64
66
  Provides-Extra: all
65
- Requires-Dist: streamlit[auth,charts,snowflake,sql]; extra == "all"
67
+ Requires-Dist: streamlit[auth,charts,pdf,snowflake,sql]; extra == "all"
66
68
  Requires-Dist: rich>=11.0.0; extra == "all"
67
69
  Dynamic: author
68
70
  Dynamic: author-email