streamlit-nightly 1.35.1.dev20240530__py2.py3-none-any.whl → 1.35.1.dev20240531__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.
Files changed (58) hide show
  1. streamlit/__init__.py +2 -0
  2. streamlit/commands/execution_control.py +23 -13
  3. streamlit/commands/navigation.py +191 -0
  4. streamlit/components/v1/custom_component.py +2 -2
  5. streamlit/elements/media.py +2 -2
  6. streamlit/elements/plotly_chart.py +1 -1
  7. streamlit/elements/widgets/button.py +49 -40
  8. streamlit/elements/widgets/camera_input.py +1 -1
  9. streamlit/elements/widgets/chat.py +1 -1
  10. streamlit/elements/widgets/checkbox.py +1 -1
  11. streamlit/elements/widgets/color_picker.py +1 -1
  12. streamlit/elements/widgets/data_editor.py +1 -1
  13. streamlit/elements/widgets/file_uploader.py +1 -1
  14. streamlit/elements/widgets/multiselect.py +1 -1
  15. streamlit/elements/widgets/number_input.py +1 -1
  16. streamlit/elements/widgets/radio.py +1 -1
  17. streamlit/elements/widgets/select_slider.py +1 -1
  18. streamlit/elements/widgets/selectbox.py +1 -1
  19. streamlit/elements/widgets/slider.py +1 -1
  20. streamlit/elements/widgets/text_widgets.py +2 -2
  21. streamlit/elements/widgets/time_widgets.py +2 -2
  22. streamlit/navigation/__init__.py +13 -0
  23. streamlit/navigation/page.py +197 -0
  24. streamlit/proto/AppPage_pb2.py +3 -3
  25. streamlit/proto/AppPage_pb2.pyi +11 -1
  26. streamlit/proto/ForwardMsg_pb2.py +10 -9
  27. streamlit/proto/ForwardMsg_pb2.pyi +17 -5
  28. streamlit/proto/Navigation_pb2.py +29 -0
  29. streamlit/proto/Navigation_pb2.pyi +79 -0
  30. streamlit/proto/NewSession_pb2.py +24 -24
  31. streamlit/proto/NewSession_pb2.pyi +5 -1
  32. streamlit/runtime/app_session.py +35 -21
  33. streamlit/runtime/fragment.py +18 -2
  34. streamlit/runtime/pages_manager.py +354 -0
  35. streamlit/runtime/scriptrunner/script_run_context.py +13 -2
  36. streamlit/runtime/scriptrunner/script_runner.py +23 -37
  37. streamlit/source_util.py +25 -11
  38. streamlit/static/asset-manifest.json +4 -4
  39. streamlit/static/index.html +1 -1
  40. streamlit/static/static/js/8571.cfc22b99.chunk.js +1 -0
  41. streamlit/static/static/js/9945.47d54f35.chunk.js +2 -0
  42. streamlit/static/static/js/{main.9978e612.js → main.707da454.js} +2 -2
  43. streamlit/testing/v1/app_test.py +7 -1
  44. streamlit/testing/v1/local_script_runner.py +6 -1
  45. streamlit/watcher/local_sources_watcher.py +20 -10
  46. streamlit/web/bootstrap.py +1 -19
  47. streamlit/web/server/routes.py +23 -25
  48. streamlit/web/server/server.py +9 -8
  49. {streamlit_nightly-1.35.1.dev20240530.dist-info → streamlit_nightly-1.35.1.dev20240531.dist-info}/METADATA +1 -1
  50. {streamlit_nightly-1.35.1.dev20240530.dist-info → streamlit_nightly-1.35.1.dev20240531.dist-info}/RECORD +56 -50
  51. streamlit/static/static/js/5117.04bfe5d3.chunk.js +0 -1
  52. streamlit/static/static/js/6950.70fe55c2.chunk.js +0 -2
  53. /streamlit/static/static/js/{6950.70fe55c2.chunk.js.LICENSE.txt → 9945.47d54f35.chunk.js.LICENSE.txt} +0 -0
  54. /streamlit/static/static/js/{main.9978e612.js.LICENSE.txt → main.707da454.js.LICENSE.txt} +0 -0
  55. {streamlit_nightly-1.35.1.dev20240530.data → streamlit_nightly-1.35.1.dev20240531.data}/scripts/streamlit.cmd +0 -0
  56. {streamlit_nightly-1.35.1.dev20240530.dist-info → streamlit_nightly-1.35.1.dev20240531.dist-info}/WHEEL +0 -0
  57. {streamlit_nightly-1.35.1.dev20240530.dist-info → streamlit_nightly-1.35.1.dev20240531.dist-info}/entry_points.txt +0 -0
  58. {streamlit_nightly-1.35.1.dev20240530.dist-info → streamlit_nightly-1.35.1.dev20240531.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,197 @@
1
+ # Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from __future__ import annotations
16
+
17
+ import types
18
+ from pathlib import Path
19
+ from typing import Callable
20
+
21
+ from streamlit.errors import StreamlitAPIException
22
+ from streamlit.runtime.metrics_util import gather_metrics
23
+ from streamlit.runtime.scriptrunner.script_run_context import get_script_run_ctx
24
+ from streamlit.source_util import page_icon_and_name
25
+ from streamlit.string_util import validate_icon_or_emoji
26
+ from streamlit.util import calc_md5
27
+
28
+
29
+ @gather_metrics("Page")
30
+ def Page(
31
+ page: str | Path | Callable[[], None],
32
+ *,
33
+ title: str | None = None,
34
+ icon: str | None = None,
35
+ url_path: str | None = None,
36
+ default: bool = False,
37
+ ):
38
+ """Configure a page in `st.navigation` in a multipage app.
39
+
40
+ The Page object is passed to `st.navigation` and returned when the user
41
+ navigates to that page. Call `Page.run()` on the returned Page in your
42
+ main script to execute the page code.
43
+
44
+ Page code can be specified by file path of the page (relative to the main
45
+ script) or by passing a Callable such as a function.
46
+
47
+ Parameters
48
+ ----------
49
+
50
+ page: str or Path or callable
51
+ The path to the script file or a callable that defines the page.
52
+ The path must be relative to the main script.
53
+
54
+ title: str or None
55
+ The title of the page. If None, the title will be inferred from the
56
+ page path or callable name.
57
+
58
+ icon: str or None
59
+ An optional emoji or icon to display next to the alert. If ``icon``
60
+ is ``None`` (default), no icon is displayed. If ``icon`` is a
61
+ string, the following options are valid:
62
+
63
+ * A single-character emoji. For example, you can set ``icon="🚨"``
64
+ or ``icon="🔥"``. Emoji short codes are not supported.
65
+
66
+ * An icon from the Material Symbols library (outlined style) in the
67
+ format ``":material/icon_name:"`` where "icon_name" is the name
68
+ of the icon in snake case.
69
+
70
+ For example, ``icon=":material/thumb_up:"`` will display the
71
+ Thumb Up icon. Find additional icons in the `Material Symbols \
72
+ <https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Outlined>`_
73
+ font library.
74
+
75
+ url_path: str or None
76
+ The URL pathname associated with a page. If None, the URL pathname will be
77
+ inferred from the file name, callable name. The default page will have
78
+ a url_path of "" to indicate the root url and ignore the value of url_path
79
+
80
+ default: bool
81
+ Whether this page is the default page to be shown when the app is
82
+ loaded. Only one page can be marked default. If no default page is
83
+ provided, the first page will be the default page.
84
+
85
+ Example
86
+ -------
87
+ >>> import streamlit as st
88
+ >>>
89
+ >>> def page2():
90
+ >>> st.title("Second page")
91
+ >>> pg = st.navigation([
92
+ >>> st.Page("page1.py", title="First page", icon="🔥"),
93
+ >>> st.Page(page2, title="Second page", icon=":material/favorite:"),
94
+ >>> ])
95
+ >>> pg.run()
96
+ """
97
+ return StreamlitPage(
98
+ page, title=title, icon=icon, url_path=url_path, default=default
99
+ )
100
+
101
+
102
+ class StreamlitPage:
103
+ def __init__(
104
+ self,
105
+ page: str | Path | Callable[[], None],
106
+ *,
107
+ title: str | None = None,
108
+ icon: str | None = None,
109
+ url_path: str | None = None,
110
+ default: bool = False,
111
+ ):
112
+ ctx = get_script_run_ctx()
113
+ if not ctx:
114
+ return
115
+
116
+ main_path = Path(ctx.pages_manager.main_script_path).parent
117
+ if isinstance(page, str):
118
+ page = Path(page)
119
+ if isinstance(page, Path):
120
+ page = (main_path / page).resolve()
121
+
122
+ inferred_name = ""
123
+ inferred_icon = ""
124
+ if isinstance(page, Path):
125
+ inferred_icon, inferred_name = page_icon_and_name(page)
126
+ elif hasattr(page, "__name__"):
127
+ inferred_name = str(page.__name__)
128
+ elif title is None:
129
+ # At this point, we know the page is not a string or a path, so it
130
+ # must be a callable. We expect it to have a __name__ attribute,
131
+ # but in special cases (e.g. a callable class instance), one may
132
+ # not exist. In that case, we should inform the user the title is
133
+ # mandatory.
134
+ raise StreamlitAPIException(
135
+ "Cannot infer page title for Callable. Set the `title=` keyword argument."
136
+ )
137
+
138
+ self._page: Path | Callable[[], None] = page
139
+ self._title: str = title or inferred_name.replace("_", " ")
140
+ self._icon: str = icon or inferred_icon
141
+ if url_path is not None and url_path.strip() == "" and not default:
142
+ raise StreamlitAPIException(
143
+ "The URL path cannot be an empty string unless the page is the default page."
144
+ )
145
+
146
+ self._url_path: str = inferred_name
147
+ if url_path is not None:
148
+ self._url_path = url_path.lstrip("/")
149
+
150
+ if self._icon:
151
+ validate_icon_or_emoji(self._icon)
152
+
153
+ self._default: bool = default
154
+ # used by st.navigation to ordain a page as runnable
155
+ self._can_be_called: bool = False
156
+
157
+ @property
158
+ def title(self) -> str:
159
+ return self._title
160
+
161
+ @property
162
+ def icon(self) -> str:
163
+ return self._icon
164
+
165
+ @property
166
+ def url_path(self) -> str:
167
+ return "" if self._default else self._url_path
168
+
169
+ def run(self) -> None:
170
+ if not self._can_be_called:
171
+ raise StreamlitAPIException(
172
+ "This page cannot be called directly. Only the page returned from st.navigation can be called once."
173
+ )
174
+
175
+ self._can_be_called = False
176
+
177
+ ctx = get_script_run_ctx()
178
+ if not ctx:
179
+ return
180
+
181
+ with ctx.pages_manager.run_with_active_hash(self._script_hash):
182
+ if callable(self._page):
183
+ self._page()
184
+ return
185
+ else:
186
+ code = ctx.pages_manager.get_page_script_byte_code(str(self._page))
187
+
188
+ # We create a module named __page__ for this specific
189
+ # script. This is differentiate it from the `__main__` module
190
+ module = types.ModuleType("__page__")
191
+ # We want __file__ to be the path to the script
192
+ module.__dict__["__file__"] = self._page
193
+ exec(code, module.__dict__)
194
+
195
+ @property
196
+ def _script_hash(self) -> str:
197
+ return calc_md5(self._url_path)
@@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default()
13
13
 
14
14
 
15
15
 
16
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dstreamlit/proto/AppPage.proto\"D\n\x07\x41ppPage\x12\x18\n\x10page_script_hash\x18\x01 \x01(\t\x12\x11\n\tpage_name\x18\x02 \x01(\t\x12\x0c\n\x04icon\x18\x03 \x01(\tB,\n\x1c\x63om.snowflake.apps.streamlitB\x0c\x41ppPageProtob\x06proto3')
16
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dstreamlit/proto/AppPage.proto\"\x86\x01\n\x07\x41ppPage\x12\x18\n\x10page_script_hash\x18\x01 \x01(\t\x12\x11\n\tpage_name\x18\x02 \x01(\t\x12\x0c\n\x04icon\x18\x03 \x01(\t\x12\x12\n\nis_default\x18\x04 \x01(\x08\x12\x16\n\x0esection_header\x18\x05 \x01(\t\x12\x14\n\x0curl_pathname\x18\x06 \x01(\tB,\n\x1c\x63om.snowflake.apps.streamlitB\x0c\x41ppPageProtob\x06proto3')
17
17
 
18
18
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
19
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.AppPage_pb2', globals())
@@ -21,6 +21,6 @@ if _descriptor._USE_C_DESCRIPTORS == False:
21
21
 
22
22
  DESCRIPTOR._options = None
23
23
  DESCRIPTOR._serialized_options = b'\n\034com.snowflake.apps.streamlitB\014AppPageProto'
24
- _APPPAGE._serialized_start=33
25
- _APPPAGE._serialized_end=101
24
+ _APPPAGE._serialized_start=34
25
+ _APPPAGE._serialized_end=168
26
26
  # @@protoc_insertion_point(module_scope)
@@ -42,16 +42,26 @@ class AppPage(google.protobuf.message.Message):
42
42
  PAGE_SCRIPT_HASH_FIELD_NUMBER: builtins.int
43
43
  PAGE_NAME_FIELD_NUMBER: builtins.int
44
44
  ICON_FIELD_NUMBER: builtins.int
45
+ IS_DEFAULT_FIELD_NUMBER: builtins.int
46
+ SECTION_HEADER_FIELD_NUMBER: builtins.int
47
+ URL_PATHNAME_FIELD_NUMBER: builtins.int
45
48
  page_script_hash: builtins.str
46
49
  page_name: builtins.str
47
50
  icon: builtins.str
51
+ is_default: builtins.bool
52
+ """A feature for MPA v2 to inform the frontend what's the default page"""
53
+ section_header: builtins.str
54
+ url_pathname: builtins.str
48
55
  def __init__(
49
56
  self,
50
57
  *,
51
58
  page_script_hash: builtins.str = ...,
52
59
  page_name: builtins.str = ...,
53
60
  icon: builtins.str = ...,
61
+ is_default: builtins.bool = ...,
62
+ section_header: builtins.str = ...,
63
+ url_pathname: builtins.str = ...,
54
64
  ) -> None: ...
55
- def ClearField(self, field_name: typing_extensions.Literal["icon", b"icon", "page_name", b"page_name", "page_script_hash", b"page_script_hash"]) -> None: ...
65
+ def ClearField(self, field_name: typing_extensions.Literal["icon", b"icon", "is_default", b"is_default", "page_name", b"page_name", "page_script_hash", b"page_script_hash", "section_header", b"section_header", "url_pathname", b"url_pathname"]) -> None: ...
56
66
 
57
67
  global___AppPage = AppPage
@@ -16,6 +16,7 @@ from streamlit.proto import Common_pb2 as streamlit_dot_proto_dot_Common__pb2
16
16
  from streamlit.proto import Delta_pb2 as streamlit_dot_proto_dot_Delta__pb2
17
17
  from streamlit.proto import GitInfo_pb2 as streamlit_dot_proto_dot_GitInfo__pb2
18
18
  from streamlit.proto import Logo_pb2 as streamlit_dot_proto_dot_Logo__pb2
19
+ from streamlit.proto import Navigation_pb2 as streamlit_dot_proto_dot_Navigation__pb2
19
20
  from streamlit.proto import NewSession_pb2 as streamlit_dot_proto_dot_NewSession__pb2
20
21
  from streamlit.proto import PageConfig_pb2 as streamlit_dot_proto_dot_PageConfig__pb2
21
22
  from streamlit.proto import PageInfo_pb2 as streamlit_dot_proto_dot_PageInfo__pb2
@@ -27,7 +28,7 @@ from streamlit.proto import SessionEvent_pb2 as streamlit_dot_proto_dot_SessionE
27
28
  from streamlit.proto import SessionStatus_pb2 as streamlit_dot_proto_dot_SessionStatus__pb2
28
29
 
29
30
 
30
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/ForwardMsg.proto\x1a\x1fstreamlit/proto/AutoRerun.proto\x1a\x1cstreamlit/proto/Common.proto\x1a\x1bstreamlit/proto/Delta.proto\x1a\x1dstreamlit/proto/GitInfo.proto\x1a\x1astreamlit/proto/Logo.proto\x1a streamlit/proto/NewSession.proto\x1a streamlit/proto/PageConfig.proto\x1a\x1estreamlit/proto/PageInfo.proto\x1a!streamlit/proto/PageProfile.proto\x1a\"streamlit/proto/PageNotFound.proto\x1a\"streamlit/proto/PagesChanged.proto\x1a#streamlit/proto/ParentMessage.proto\x1a\"streamlit/proto/SessionEvent.proto\x1a#streamlit/proto/SessionStatus.proto\"\xfc\x06\n\nForwardMsg\x12\x0c\n\x04hash\x18\x01 \x01(\t\x12%\n\x08metadata\x18\x02 \x01(\x0b\x32\x13.ForwardMsgMetadata\x12\"\n\x0bnew_session\x18\x04 \x01(\x0b\x32\x0b.NewSessionH\x00\x12\x17\n\x05\x64\x65lta\x18\x05 \x01(\x0b\x32\x06.DeltaH\x00\x12&\n\x11page_info_changed\x18\x0c \x01(\x0b\x32\t.PageInfoH\x00\x12*\n\x13page_config_changed\x18\r \x01(\x0b\x32\x0b.PageConfigH\x00\x12;\n\x0fscript_finished\x18\x06 \x01(\x0e\x32 .ForwardMsg.ScriptFinishedStatusH\x00\x12$\n\x10git_info_changed\x18\x0e \x01(\x0b\x32\x08.GitInfoH\x00\x12$\n\x0cpage_profile\x18\x12 \x01(\x0b\x32\x0c.PageProfileH\x00\x12\x30\n\x16session_status_changed\x18\t \x01(\x0b\x32\x0e.SessionStatusH\x00\x12&\n\rsession_event\x18\n \x01(\x0b\x32\r.SessionEventH\x00\x12\'\n\x0epage_not_found\x18\x0f \x01(\x0b\x32\r.PageNotFoundH\x00\x12&\n\rpages_changed\x18\x10 \x01(\x0b\x32\r.PagesChangedH\x00\x12/\n\x12\x66ile_urls_response\x18\x13 \x01(\x0b\x32\x11.FileURLsResponseH\x00\x12 \n\nauto_rerun\x18\x15 \x01(\x0b\x32\n.AutoRerunH\x00\x12\x15\n\x04logo\x18\x16 \x01(\x0b\x32\x05.LogoH\x00\x12(\n\x0eparent_message\x18\x14 \x01(\x0b\x32\x0e.ParentMessageH\x00\x12\x12\n\x08ref_hash\x18\x0b \x01(\tH\x00\x12\x1d\n\x15\x64\x65\x62ug_last_backmsg_id\x18\x11 \x01(\t\"\x98\x01\n\x14ScriptFinishedStatus\x12\x19\n\x15\x46INISHED_SUCCESSFULLY\x10\x00\x12\x1f\n\x1b\x46INISHED_WITH_COMPILE_ERROR\x10\x01\x12\x1c\n\x18\x46INISHED_EARLY_FOR_RERUN\x10\x02\x12&\n\"FINISHED_FRAGMENT_RUN_SUCCESSFULLY\x10\x03\x42\x06\n\x04typeJ\x04\x08\x07\x10\x08J\x04\x08\x08\x10\t\"r\n\x12\x46orwardMsgMetadata\x12\x11\n\tcacheable\x18\x01 \x01(\x08\x12\x12\n\ndelta_path\x18\x02 \x03(\r\x12\x35\n\x16\x65lement_dimension_spec\x18\x03 \x01(\x0b\x32\x15.ElementDimensionSpec\"5\n\x14\x45lementDimensionSpec\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\rB/\n\x1c\x63om.snowflake.apps.streamlitB\x0f\x46orwardMsgProtob\x06proto3')
31
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/ForwardMsg.proto\x1a\x1fstreamlit/proto/AutoRerun.proto\x1a\x1cstreamlit/proto/Common.proto\x1a\x1bstreamlit/proto/Delta.proto\x1a\x1dstreamlit/proto/GitInfo.proto\x1a\x1astreamlit/proto/Logo.proto\x1a streamlit/proto/Navigation.proto\x1a streamlit/proto/NewSession.proto\x1a streamlit/proto/PageConfig.proto\x1a\x1estreamlit/proto/PageInfo.proto\x1a!streamlit/proto/PageProfile.proto\x1a\"streamlit/proto/PageNotFound.proto\x1a\"streamlit/proto/PagesChanged.proto\x1a#streamlit/proto/ParentMessage.proto\x1a\"streamlit/proto/SessionEvent.proto\x1a#streamlit/proto/SessionStatus.proto\"\x9f\x07\n\nForwardMsg\x12\x0c\n\x04hash\x18\x01 \x01(\t\x12%\n\x08metadata\x18\x02 \x01(\x0b\x32\x13.ForwardMsgMetadata\x12\"\n\x0bnew_session\x18\x04 \x01(\x0b\x32\x0b.NewSessionH\x00\x12\x17\n\x05\x64\x65lta\x18\x05 \x01(\x0b\x32\x06.DeltaH\x00\x12&\n\x11page_info_changed\x18\x0c \x01(\x0b\x32\t.PageInfoH\x00\x12*\n\x13page_config_changed\x18\r \x01(\x0b\x32\x0b.PageConfigH\x00\x12;\n\x0fscript_finished\x18\x06 \x01(\x0e\x32 .ForwardMsg.ScriptFinishedStatusH\x00\x12$\n\x10git_info_changed\x18\x0e \x01(\x0b\x32\x08.GitInfoH\x00\x12$\n\x0cpage_profile\x18\x12 \x01(\x0b\x32\x0c.PageProfileH\x00\x12\x30\n\x16session_status_changed\x18\t \x01(\x0b\x32\x0e.SessionStatusH\x00\x12&\n\rsession_event\x18\n \x01(\x0b\x32\r.SessionEventH\x00\x12!\n\nnavigation\x18\x17 \x01(\x0b\x32\x0b.NavigationH\x00\x12\'\n\x0epage_not_found\x18\x0f \x01(\x0b\x32\r.PageNotFoundH\x00\x12&\n\rpages_changed\x18\x10 \x01(\x0b\x32\r.PagesChangedH\x00\x12/\n\x12\x66ile_urls_response\x18\x13 \x01(\x0b\x32\x11.FileURLsResponseH\x00\x12 \n\nauto_rerun\x18\x15 \x01(\x0b\x32\n.AutoRerunH\x00\x12\x15\n\x04logo\x18\x16 \x01(\x0b\x32\x05.LogoH\x00\x12(\n\x0eparent_message\x18\x14 \x01(\x0b\x32\x0e.ParentMessageH\x00\x12\x12\n\x08ref_hash\x18\x0b \x01(\tH\x00\x12\x1d\n\x15\x64\x65\x62ug_last_backmsg_id\x18\x11 \x01(\t\"\x98\x01\n\x14ScriptFinishedStatus\x12\x19\n\x15\x46INISHED_SUCCESSFULLY\x10\x00\x12\x1f\n\x1b\x46INISHED_WITH_COMPILE_ERROR\x10\x01\x12\x1c\n\x18\x46INISHED_EARLY_FOR_RERUN\x10\x02\x12&\n\"FINISHED_FRAGMENT_RUN_SUCCESSFULLY\x10\x03\x42\x06\n\x04typeJ\x04\x08\x07\x10\x08J\x04\x08\x08\x10\t\"\x8e\x01\n\x12\x46orwardMsgMetadata\x12\x11\n\tcacheable\x18\x01 \x01(\x08\x12\x12\n\ndelta_path\x18\x02 \x03(\r\x12\x35\n\x16\x65lement_dimension_spec\x18\x03 \x01(\x0b\x32\x15.ElementDimensionSpec\x12\x1a\n\x12\x61\x63tive_script_hash\x18\x04 \x01(\t\"5\n\x14\x45lementDimensionSpec\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\rB/\n\x1c\x63om.snowflake.apps.streamlitB\x0f\x46orwardMsgProtob\x06proto3')
31
32
 
32
33
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
33
34
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.ForwardMsg_pb2', globals())
@@ -35,12 +36,12 @@ if _descriptor._USE_C_DESCRIPTORS == False:
35
36
 
36
37
  DESCRIPTOR._options = None
37
38
  DESCRIPTOR._serialized_options = b'\n\034com.snowflake.apps.streamlitB\017ForwardMsgProto'
38
- _FORWARDMSG._serialized_start=505
39
- _FORWARDMSG._serialized_end=1397
40
- _FORWARDMSG_SCRIPTFINISHEDSTATUS._serialized_start=1225
41
- _FORWARDMSG_SCRIPTFINISHEDSTATUS._serialized_end=1377
42
- _FORWARDMSGMETADATA._serialized_start=1399
43
- _FORWARDMSGMETADATA._serialized_end=1513
44
- _ELEMENTDIMENSIONSPEC._serialized_start=1515
45
- _ELEMENTDIMENSIONSPEC._serialized_end=1568
39
+ _FORWARDMSG._serialized_start=539
40
+ _FORWARDMSG._serialized_end=1466
41
+ _FORWARDMSG_SCRIPTFINISHEDSTATUS._serialized_start=1294
42
+ _FORWARDMSG_SCRIPTFINISHEDSTATUS._serialized_end=1446
43
+ _FORWARDMSGMETADATA._serialized_start=1469
44
+ _FORWARDMSGMETADATA._serialized_end=1611
45
+ _ELEMENTDIMENSIONSPEC._serialized_start=1613
46
+ _ELEMENTDIMENSIONSPEC._serialized_end=1666
46
47
  # @@protoc_insertion_point(module_scope)
@@ -27,6 +27,7 @@ import streamlit.proto.Common_pb2
27
27
  import streamlit.proto.Delta_pb2
28
28
  import streamlit.proto.GitInfo_pb2
29
29
  import streamlit.proto.Logo_pb2
30
+ import streamlit.proto.Navigation_pb2
30
31
  import streamlit.proto.NewSession_pb2
31
32
  import streamlit.proto.PageConfig_pb2
32
33
  import streamlit.proto.PageInfo_pb2
@@ -89,6 +90,7 @@ class ForwardMsg(google.protobuf.message.Message):
89
90
  PAGE_PROFILE_FIELD_NUMBER: builtins.int
90
91
  SESSION_STATUS_CHANGED_FIELD_NUMBER: builtins.int
91
92
  SESSION_EVENT_FIELD_NUMBER: builtins.int
93
+ NAVIGATION_FIELD_NUMBER: builtins.int
92
94
  PAGE_NOT_FOUND_FIELD_NUMBER: builtins.int
93
95
  PAGES_CHANGED_FIELD_NUMBER: builtins.int
94
96
  FILE_URLS_RESPONSE_FIELD_NUMBER: builtins.int
@@ -124,9 +126,11 @@ class ForwardMsg(google.protobuf.message.Message):
124
126
  @property
125
127
  def session_event(self) -> streamlit.proto.SessionEvent_pb2.SessionEvent: ...
126
128
  @property
127
- def page_not_found(self) -> streamlit.proto.PageNotFound_pb2.PageNotFound:
129
+ def navigation(self) -> streamlit.proto.Navigation_pb2.Navigation:
128
130
  """Other messages."""
129
131
  @property
132
+ def page_not_found(self) -> streamlit.proto.PageNotFound_pb2.PageNotFound: ...
133
+ @property
130
134
  def pages_changed(self) -> streamlit.proto.PagesChanged_pb2.PagesChanged: ...
131
135
  @property
132
136
  def file_urls_response(self) -> streamlit.proto.Common_pb2.FileURLsResponse: ...
@@ -163,6 +167,7 @@ class ForwardMsg(google.protobuf.message.Message):
163
167
  page_profile: streamlit.proto.PageProfile_pb2.PageProfile | None = ...,
164
168
  session_status_changed: streamlit.proto.SessionStatus_pb2.SessionStatus | None = ...,
165
169
  session_event: streamlit.proto.SessionEvent_pb2.SessionEvent | None = ...,
170
+ navigation: streamlit.proto.Navigation_pb2.Navigation | None = ...,
166
171
  page_not_found: streamlit.proto.PageNotFound_pb2.PageNotFound | None = ...,
167
172
  pages_changed: streamlit.proto.PagesChanged_pb2.PagesChanged | None = ...,
168
173
  file_urls_response: streamlit.proto.Common_pb2.FileURLsResponse | None = ...,
@@ -172,9 +177,9 @@ class ForwardMsg(google.protobuf.message.Message):
172
177
  ref_hash: builtins.str = ...,
173
178
  debug_last_backmsg_id: builtins.str = ...,
174
179
  ) -> None: ...
175
- def HasField(self, field_name: typing_extensions.Literal["auto_rerun", b"auto_rerun", "delta", b"delta", "file_urls_response", b"file_urls_response", "git_info_changed", b"git_info_changed", "logo", b"logo", "metadata", b"metadata", "new_session", b"new_session", "page_config_changed", b"page_config_changed", "page_info_changed", b"page_info_changed", "page_not_found", b"page_not_found", "page_profile", b"page_profile", "pages_changed", b"pages_changed", "parent_message", b"parent_message", "ref_hash", b"ref_hash", "script_finished", b"script_finished", "session_event", b"session_event", "session_status_changed", b"session_status_changed", "type", b"type"]) -> builtins.bool: ...
176
- def ClearField(self, field_name: typing_extensions.Literal["auto_rerun", b"auto_rerun", "debug_last_backmsg_id", b"debug_last_backmsg_id", "delta", b"delta", "file_urls_response", b"file_urls_response", "git_info_changed", b"git_info_changed", "hash", b"hash", "logo", b"logo", "metadata", b"metadata", "new_session", b"new_session", "page_config_changed", b"page_config_changed", "page_info_changed", b"page_info_changed", "page_not_found", b"page_not_found", "page_profile", b"page_profile", "pages_changed", b"pages_changed", "parent_message", b"parent_message", "ref_hash", b"ref_hash", "script_finished", b"script_finished", "session_event", b"session_event", "session_status_changed", b"session_status_changed", "type", b"type"]) -> None: ...
177
- def WhichOneof(self, oneof_group: typing_extensions.Literal["type", b"type"]) -> typing_extensions.Literal["new_session", "delta", "page_info_changed", "page_config_changed", "script_finished", "git_info_changed", "page_profile", "session_status_changed", "session_event", "page_not_found", "pages_changed", "file_urls_response", "auto_rerun", "logo", "parent_message", "ref_hash"] | None: ...
180
+ def HasField(self, field_name: typing_extensions.Literal["auto_rerun", b"auto_rerun", "delta", b"delta", "file_urls_response", b"file_urls_response", "git_info_changed", b"git_info_changed", "logo", b"logo", "metadata", b"metadata", "navigation", b"navigation", "new_session", b"new_session", "page_config_changed", b"page_config_changed", "page_info_changed", b"page_info_changed", "page_not_found", b"page_not_found", "page_profile", b"page_profile", "pages_changed", b"pages_changed", "parent_message", b"parent_message", "ref_hash", b"ref_hash", "script_finished", b"script_finished", "session_event", b"session_event", "session_status_changed", b"session_status_changed", "type", b"type"]) -> builtins.bool: ...
181
+ def ClearField(self, field_name: typing_extensions.Literal["auto_rerun", b"auto_rerun", "debug_last_backmsg_id", b"debug_last_backmsg_id", "delta", b"delta", "file_urls_response", b"file_urls_response", "git_info_changed", b"git_info_changed", "hash", b"hash", "logo", b"logo", "metadata", b"metadata", "navigation", b"navigation", "new_session", b"new_session", "page_config_changed", b"page_config_changed", "page_info_changed", b"page_info_changed", "page_not_found", b"page_not_found", "page_profile", b"page_profile", "pages_changed", b"pages_changed", "parent_message", b"parent_message", "ref_hash", b"ref_hash", "script_finished", b"script_finished", "session_event", b"session_event", "session_status_changed", b"session_status_changed", "type", b"type"]) -> None: ...
182
+ def WhichOneof(self, oneof_group: typing_extensions.Literal["type", b"type"]) -> typing_extensions.Literal["new_session", "delta", "page_info_changed", "page_config_changed", "script_finished", "git_info_changed", "page_profile", "session_status_changed", "session_event", "navigation", "page_not_found", "pages_changed", "file_urls_response", "auto_rerun", "logo", "parent_message", "ref_hash"] | None: ...
178
183
 
179
184
  global___ForwardMsg = ForwardMsg
180
185
 
@@ -191,6 +196,7 @@ class ForwardMsgMetadata(google.protobuf.message.Message):
191
196
  CACHEABLE_FIELD_NUMBER: builtins.int
192
197
  DELTA_PATH_FIELD_NUMBER: builtins.int
193
198
  ELEMENT_DIMENSION_SPEC_FIELD_NUMBER: builtins.int
199
+ ACTIVE_SCRIPT_HASH_FIELD_NUMBER: builtins.int
194
200
  cacheable: builtins.bool
195
201
  """If this is set, the server will have cached this message,
196
202
  and a client that receives it should do the same.
@@ -203,15 +209,21 @@ class ForwardMsgMetadata(google.protobuf.message.Message):
203
209
  @property
204
210
  def element_dimension_spec(self) -> global___ElementDimensionSpec:
205
211
  """DEPRECATED: This is not used anymore."""
212
+ active_script_hash: builtins.str
213
+ """active_script_hash the forward message is associated from.
214
+ For multipage apps v1, this will always be the page file running
215
+ For multipage apps v2, this can be the main script or the page script
216
+ """
206
217
  def __init__(
207
218
  self,
208
219
  *,
209
220
  cacheable: builtins.bool = ...,
210
221
  delta_path: collections.abc.Iterable[builtins.int] | None = ...,
211
222
  element_dimension_spec: global___ElementDimensionSpec | None = ...,
223
+ active_script_hash: builtins.str = ...,
212
224
  ) -> None: ...
213
225
  def HasField(self, field_name: typing_extensions.Literal["element_dimension_spec", b"element_dimension_spec"]) -> builtins.bool: ...
214
- def ClearField(self, field_name: typing_extensions.Literal["cacheable", b"cacheable", "delta_path", b"delta_path", "element_dimension_spec", b"element_dimension_spec"]) -> None: ...
226
+ def ClearField(self, field_name: typing_extensions.Literal["active_script_hash", b"active_script_hash", "cacheable", b"cacheable", "delta_path", b"delta_path", "element_dimension_spec", b"element_dimension_spec"]) -> None: ...
215
227
 
216
228
  global___ForwardMsgMetadata = ForwardMsgMetadata
217
229
 
@@ -0,0 +1,29 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: streamlit/proto/Navigation.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+ from streamlit.proto import AppPage_pb2 as streamlit_dot_proto_dot_AppPage__pb2
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/Navigation.proto\x1a\x1dstreamlit/proto/AppPage.proto\"\xa2\x01\n\nNavigation\x12\x10\n\x08sections\x18\x01 \x03(\t\x12\x1b\n\tapp_pages\x18\x02 \x03(\x0b\x32\x08.AppPage\x12&\n\x08position\x18\x03 \x01(\x0e\x32\x14.Navigation.Position\x12\x18\n\x10page_script_hash\x18\x04 \x01(\t\"#\n\x08Position\x12\n\n\x06HIDDEN\x10\x00\x12\x0b\n\x07SIDEBAR\x10\x01\x42\x1e\n\x1c\x63om.snowflake.apps.streamlitb\x06proto3')
18
+
19
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
20
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Navigation_pb2', globals())
21
+ if _descriptor._USE_C_DESCRIPTORS == False:
22
+
23
+ DESCRIPTOR._options = None
24
+ DESCRIPTOR._serialized_options = b'\n\034com.snowflake.apps.streamlit'
25
+ _NAVIGATION._serialized_start=68
26
+ _NAVIGATION._serialized_end=230
27
+ _NAVIGATION_POSITION._serialized_start=195
28
+ _NAVIGATION_POSITION._serialized_end=230
29
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,79 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ *!
5
+ Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+ """
19
+ import builtins
20
+ import collections.abc
21
+ import google.protobuf.descriptor
22
+ import google.protobuf.internal.containers
23
+ import google.protobuf.internal.enum_type_wrapper
24
+ import google.protobuf.message
25
+ import streamlit.proto.AppPage_pb2
26
+ import sys
27
+ import typing
28
+
29
+ if sys.version_info >= (3, 10):
30
+ import typing as typing_extensions
31
+ else:
32
+ import typing_extensions
33
+
34
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
35
+
36
+ class Navigation(google.protobuf.message.Message):
37
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
38
+
39
+ class _Position:
40
+ ValueType = typing.NewType("ValueType", builtins.int)
41
+ V: typing_extensions.TypeAlias = ValueType
42
+
43
+ class _PositionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Navigation._Position.ValueType], builtins.type): # noqa: F821
44
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
45
+ HIDDEN: Navigation._Position.ValueType # 0
46
+ """do not display the navigation"""
47
+ SIDEBAR: Navigation._Position.ValueType # 1
48
+ """display navigation in the sidebar"""
49
+
50
+ class Position(_Position, metaclass=_PositionEnumTypeWrapper):
51
+ """Position of the Navigation"""
52
+
53
+ HIDDEN: Navigation.Position.ValueType # 0
54
+ """do not display the navigation"""
55
+ SIDEBAR: Navigation.Position.ValueType # 1
56
+ """display navigation in the sidebar"""
57
+
58
+ SECTIONS_FIELD_NUMBER: builtins.int
59
+ APP_PAGES_FIELD_NUMBER: builtins.int
60
+ POSITION_FIELD_NUMBER: builtins.int
61
+ PAGE_SCRIPT_HASH_FIELD_NUMBER: builtins.int
62
+ @property
63
+ def sections(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
64
+ @property
65
+ def app_pages(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[streamlit.proto.AppPage_pb2.AppPage]: ...
66
+ position: global___Navigation.Position.ValueType
67
+ page_script_hash: builtins.str
68
+ """The script hash for the page identified by st.navigation"""
69
+ def __init__(
70
+ self,
71
+ *,
72
+ sections: collections.abc.Iterable[builtins.str] | None = ...,
73
+ app_pages: collections.abc.Iterable[streamlit.proto.AppPage_pb2.AppPage] | None = ...,
74
+ position: global___Navigation.Position.ValueType = ...,
75
+ page_script_hash: builtins.str = ...,
76
+ ) -> None: ...
77
+ def ClearField(self, field_name: typing_extensions.Literal["app_pages", b"app_pages", "page_script_hash", b"page_script_hash", "position", b"position", "sections", b"sections"]) -> None: ...
78
+
79
+ global___Navigation = Navigation
@@ -15,7 +15,7 @@ from streamlit.proto import AppPage_pb2 as streamlit_dot_proto_dot_AppPage__pb2
15
15
  from streamlit.proto import SessionStatus_pb2 as streamlit_dot_proto_dot_SessionStatus__pb2
16
16
 
17
17
 
18
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\x8b\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\x8c\x04\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\"F\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x0e\n\x06weight\x18\x03 \x01(\x05\x12\r\n\x05style\x18\x04 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"E\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\tJ\x04\x08\x02\x10\x03\"D\n\x0f\x45nvironmentInfo\x12\x19\n\x11streamlit_version\x18\x01 \x01(\t\x12\x16\n\x0epython_version\x18\x02 \x01(\tB/\n\x1c\x63om.snowflake.apps.streamlitB\x0fNewSessionProtob\x06proto3')
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\x8c\x04\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\"F\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x0e\n\x06weight\x18\x03 \x01(\x05\x12\r\n\x05style\x18\x04 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"E\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\tJ\x04\x08\x02\x10\x03\"D\n\x0f\x45nvironmentInfo\x12\x19\n\x11streamlit_version\x18\x01 \x01(\t\x12\x16\n\x0epython_version\x18\x02 \x01(\tB/\n\x1c\x63om.snowflake.apps.streamlitB\x0fNewSessionProtob\x06proto3')
19
19
 
20
20
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
21
21
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.NewSession_pb2', globals())
@@ -24,27 +24,27 @@ if _descriptor._USE_C_DESCRIPTORS == False:
24
24
  DESCRIPTOR._options = None
25
25
  DESCRIPTOR._serialized_options = b'\n\034com.snowflake.apps.streamlitB\017NewSessionProto'
26
26
  _NEWSESSION._serialized_start=105
27
- _NEWSESSION._serialized_end=372
28
- _INITIALIZE._serialized_start=375
29
- _INITIALIZE._serialized_end=561
30
- _CONFIG._serialized_start=564
31
- _CONFIG._serialized_end=843
32
- _CONFIG_TOOLBARMODE._serialized_start=774
33
- _CONFIG_TOOLBARMODE._serialized_end=837
34
- _CUSTOMTHEMECONFIG._serialized_start=846
35
- _CUSTOMTHEMECONFIG._serialized_end=1370
36
- _CUSTOMTHEMECONFIG_BASETHEME._serialized_start=1282
37
- _CUSTOMTHEMECONFIG_BASETHEME._serialized_end=1314
38
- _CUSTOMTHEMECONFIG_FONTFAMILY._serialized_start=1316
39
- _CUSTOMTHEMECONFIG_FONTFAMILY._serialized_end=1370
40
- _FONTFACE._serialized_start=1372
41
- _FONTFACE._serialized_end=1442
42
- _RADII._serialized_start=1444
43
- _RADII._serialized_end=1504
44
- _FONTSIZES._serialized_start=1506
45
- _FONTSIZES._serialized_end=1590
46
- _USERINFO._serialized_start=1592
47
- _USERINFO._serialized_end=1661
48
- _ENVIRONMENTINFO._serialized_start=1663
49
- _ENVIRONMENTINFO._serialized_end=1731
27
+ _NEWSESSION._serialized_end=398
28
+ _INITIALIZE._serialized_start=401
29
+ _INITIALIZE._serialized_end=587
30
+ _CONFIG._serialized_start=590
31
+ _CONFIG._serialized_end=869
32
+ _CONFIG_TOOLBARMODE._serialized_start=800
33
+ _CONFIG_TOOLBARMODE._serialized_end=863
34
+ _CUSTOMTHEMECONFIG._serialized_start=872
35
+ _CUSTOMTHEMECONFIG._serialized_end=1396
36
+ _CUSTOMTHEMECONFIG_BASETHEME._serialized_start=1308
37
+ _CUSTOMTHEMECONFIG_BASETHEME._serialized_end=1340
38
+ _CUSTOMTHEMECONFIG_FONTFAMILY._serialized_start=1342
39
+ _CUSTOMTHEMECONFIG_FONTFAMILY._serialized_end=1396
40
+ _FONTFACE._serialized_start=1398
41
+ _FONTFACE._serialized_end=1468
42
+ _RADII._serialized_start=1470
43
+ _RADII._serialized_end=1530
44
+ _FONTSIZES._serialized_start=1532
45
+ _FONTSIZES._serialized_end=1616
46
+ _USERINFO._serialized_start=1618
47
+ _USERINFO._serialized_end=1687
48
+ _ENVIRONMENTINFO._serialized_start=1689
49
+ _ENVIRONMENTINFO._serialized_end=1757
50
50
  # @@protoc_insertion_point(module_scope)
@@ -53,6 +53,7 @@ class NewSession(google.protobuf.message.Message):
53
53
  APP_PAGES_FIELD_NUMBER: builtins.int
54
54
  PAGE_SCRIPT_HASH_FIELD_NUMBER: builtins.int
55
55
  FRAGMENT_IDS_THIS_RUN_FIELD_NUMBER: builtins.int
56
+ MAIN_SCRIPT_HASH_FIELD_NUMBER: builtins.int
56
57
  @property
57
58
  def initialize(self) -> global___Initialize:
58
59
  """Initialization data. This data does *not* change from rerun to rerun,
@@ -88,6 +89,8 @@ class NewSession(google.protobuf.message.Message):
88
89
  """The fragment IDs being run in this session if it corresponds to a fragment
89
90
  script run.
90
91
  """
92
+ main_script_hash: builtins.str
93
+ """Hash of the main script running (ie streamlit run main_script.py)"""
91
94
  def __init__(
92
95
  self,
93
96
  *,
@@ -100,9 +103,10 @@ class NewSession(google.protobuf.message.Message):
100
103
  app_pages: collections.abc.Iterable[streamlit.proto.AppPage_pb2.AppPage] | None = ...,
101
104
  page_script_hash: builtins.str = ...,
102
105
  fragment_ids_this_run: collections.abc.Iterable[builtins.str] | None = ...,
106
+ main_script_hash: builtins.str = ...,
103
107
  ) -> None: ...
104
108
  def HasField(self, field_name: typing_extensions.Literal["config", b"config", "custom_theme", b"custom_theme", "initialize", b"initialize"]) -> builtins.bool: ...
105
- def ClearField(self, field_name: typing_extensions.Literal["app_pages", b"app_pages", "config", b"config", "custom_theme", b"custom_theme", "fragment_ids_this_run", b"fragment_ids_this_run", "initialize", b"initialize", "main_script_path", b"main_script_path", "name", b"name", "page_script_hash", b"page_script_hash", "script_run_id", b"script_run_id"]) -> None: ...
109
+ def ClearField(self, field_name: typing_extensions.Literal["app_pages", b"app_pages", "config", b"config", "custom_theme", b"custom_theme", "fragment_ids_this_run", b"fragment_ids_this_run", "initialize", b"initialize", "main_script_hash", b"main_script_hash", "main_script_path", b"main_script_path", "name", b"name", "page_script_hash", b"page_script_hash", "script_run_id", b"script_run_id"]) -> None: ...
106
110
 
107
111
  global___NewSession = NewSession
108
112