streamlitrunner 0.0.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.
- streamlitrunner/__init__.py +1 -0
- streamlitrunner/streamlitrunner.py +214 -0
- streamlitrunner/streamlitrunner.pyi +151 -0
- streamlitrunner-0.0.0.dist-info/METADATA +52 -0
- streamlitrunner-0.0.0.dist-info/RECORD +7 -0
- streamlitrunner-0.0.0.dist-info/WHEEL +4 -0
- streamlitrunner-0.0.0.dist-info/licenses/LICENSE.txt +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .streamlitrunner import *
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Literal, TypedDict, overload
|
|
5
|
+
from threading import Thread
|
|
6
|
+
|
|
7
|
+
import webview
|
|
8
|
+
from streamlit import session_state
|
|
9
|
+
from streamlit.runtime.scriptrunner import get_script_run_ctx
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class SessionState:
|
|
13
|
+
def __contains__(self, name: str) -> bool:
|
|
14
|
+
return hasattr(self, name)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
gettrace = getattr(sys, "gettrace", None)
|
|
18
|
+
debugging = gettrace is not None and gettrace()
|
|
19
|
+
interactively_debugging = sys.flags.interactive or sys.flags.quiet or debugging
|
|
20
|
+
inside_streamlit_app = get_script_run_ctx()
|
|
21
|
+
|
|
22
|
+
session = SessionState()
|
|
23
|
+
if inside_streamlit_app:
|
|
24
|
+
session = session_state
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class RuntimeConfig(TypedDict, total=False):
|
|
28
|
+
CLOSE_OPENED_WINDOW: bool
|
|
29
|
+
OPEN_AS_APP: bool
|
|
30
|
+
BROWSER: Literal["chrome", "msedge"]
|
|
31
|
+
PRINT_COMMAND: bool
|
|
32
|
+
STREAMLIT_GLOBAL_DISABLE_WATCHDOG_WARNING: bool
|
|
33
|
+
STREAMLIT_GLOBAL_DISABLE_WIDGET_STATE_DUPLICATION_WARNING: bool
|
|
34
|
+
STREAMLIT_GLOBAL_SHOW_WARNING_ON_DIRECT_EXECUTION: bool
|
|
35
|
+
STREAMLIT_GLOBAL_DEVELOPMENT_MODE: bool
|
|
36
|
+
STREAMLIT_GLOBAL_LOG_LEVEL: Literal["error", "warning", "info", "debug"]
|
|
37
|
+
STREAMLIT_GLOBAL_UNIT_TEST: bool
|
|
38
|
+
STREAMLIT_GLOBAL_APP_TEST: bool
|
|
39
|
+
STREAMLIT_GLOBAL_SUPPRESS_DEPRECATION_WARNINGS: bool
|
|
40
|
+
STREAMLIT_GLOBAL_MIN_CACHED_MESSAGE_SIZE: float
|
|
41
|
+
STREAMLIT_GLOBAL_MAX_CACHED_MESSAGE_AGE: int
|
|
42
|
+
STREAMLIT_GLOBAL_STORE_CACHED_FORWARD_MESSAGES_IN_MEMORY: bool
|
|
43
|
+
STREAMLIT_GLOBAL_DATA_FRAME_SERIALIZATION: Literal["legacy", "arrow"]
|
|
44
|
+
STREAMLIT_LOGGER_LEVEL: Literal["error", "warning", "info", "debug"]
|
|
45
|
+
STREAMLIT_LOGGER_MESSAGE_FORMAT: str
|
|
46
|
+
STREAMLIT_LOGGER_ENABLE_RICH: bool
|
|
47
|
+
STREAMLIT_CLIENT_CACHING: bool
|
|
48
|
+
STREAMLIT_CLIENT_DISPLAY_ENABLED: bool
|
|
49
|
+
STREAMLIT_CLIENT_SHOW_ERROR_DETAILS: bool
|
|
50
|
+
STREAMLIT_CLIENT_TOOLBAR_MODE: Literal["auto", "developer", "viewer", "minimal"]
|
|
51
|
+
STREAMLIT_CLIENT_SHOW_SIDEBAR_NAVIGATION: bool
|
|
52
|
+
STREAMLIT_RUNNER_MAGIC_ENABLED: bool
|
|
53
|
+
STREAMLIT_RUNNER_INSTALL_TRACER: bool
|
|
54
|
+
STREAMLIT_RUNNER_FIX_MATPLOTLIB: bool
|
|
55
|
+
STREAMLIT_RUNNER_POST_SCRIPT_GC: bool
|
|
56
|
+
STREAMLIT_RUNNER_FAST_RERUNS: bool
|
|
57
|
+
STREAMLIT_RUNNER_ENFORCE_SERIALIZABLE_SESSION_STATE: bool
|
|
58
|
+
STREAMLIT_RUNNER_ENUM_COERCION: Literal["off", "nameOnly", "nameAndValue"]
|
|
59
|
+
STREAMLIT_SERVER_FOLDER_WATCH_BLACKLIST: str
|
|
60
|
+
STREAMLIT_SERVER_FILE_WATCHER_TYPE: Literal["auto", "watchdog", "poll", "none"]
|
|
61
|
+
STREAMLIT_SERVER_HEADLESS: bool
|
|
62
|
+
STREAMLIT_SERVER_RUN_ON_SAVE: bool
|
|
63
|
+
STREAMLIT_SERVER_ALLOW_RUN_ON_SAVE: bool
|
|
64
|
+
STREAMLIT_SERVER_ADDRESS: str
|
|
65
|
+
STREAMLIT_SERVER_PORT: int
|
|
66
|
+
STREAMLIT_SERVER_SCRIPT_HEALTH_CHECK_ENABLED: bool
|
|
67
|
+
STREAMLIT_SERVER_BASE_URL_PATH: str
|
|
68
|
+
STREAMLIT_SERVER_ENABLE_CORS: bool
|
|
69
|
+
STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION: bool
|
|
70
|
+
STREAMLIT_SERVER_MAX_UPLOAD_SIZE: int
|
|
71
|
+
STREAMLIT_SERVER_MAX_MESSAGE_SIZE: int
|
|
72
|
+
STREAMLIT_SERVER_ENABLE_ARROW_TRUNCATION: bool
|
|
73
|
+
STREAMLIT_SERVER_ENABLE_WEBSOCKET_COMPRESSION: bool
|
|
74
|
+
STREAMLIT_SERVER_ENABLE_STATIC_SERVING: bool
|
|
75
|
+
STREAMLIT_BROWSER_SERVER_ADDRESS: str
|
|
76
|
+
STREAMLIT_BROWSER_GATHER_USAGE_STATS: bool
|
|
77
|
+
STREAMLIT_BROWSER_SERVER_PORT: int
|
|
78
|
+
STREAMLIT_SERVER_SSL_CERT_FILE: str
|
|
79
|
+
STREAMLIT_SERVER_SSL_KEY_FILE: str
|
|
80
|
+
STREAMLIT_UI_HIDE_TOP_BAR: bool
|
|
81
|
+
STREAMLIT_UI_HIDE_SIDEBAR_NAV: bool
|
|
82
|
+
STREAMLIT_MAGIC_DISPLAY_ROOT_DOC_STRING: bool
|
|
83
|
+
STREAMLIT_MAGIC_DISPLAY_LAST_EXPR_IF_NO_SEMICOLON: bool
|
|
84
|
+
STREAMLIT_DEPRECATION_SHOWFILE_UPLOADER_ENCODING: bool
|
|
85
|
+
STREAMLIT_DEPRECATION_SHOW_IMAGE_FORMAT: bool
|
|
86
|
+
STREAMLIT_DEPRECATION_SHOW_PYPLOT_GLOBAL_USE: bool
|
|
87
|
+
STREAMLIT_THEME_BASE: Literal["dark", "light"]
|
|
88
|
+
STREAMLIT_THEME_PRIMARY_COLOR: str
|
|
89
|
+
STREAMLIT_THEME_BACKGROUND_COLOR: str
|
|
90
|
+
STREAMLIT_THEME_SECONDARY_BACKGROUND_COLOR: str
|
|
91
|
+
STREAMLIT_THEME_TEXT_COLOR: str
|
|
92
|
+
STREAMLIT_THEME_FONT: Literal["sans serif", "serif", "monospace"]
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
rc: RuntimeConfig = {
|
|
96
|
+
"OPEN_AS_APP": True,
|
|
97
|
+
"BROWSER": "msedge",
|
|
98
|
+
"CLOSE_OPENED_WINDOW": True,
|
|
99
|
+
"PRINT_COMMAND": True,
|
|
100
|
+
"STREAMLIT_CLIENT_TOOLBAR_MODE": "minimal",
|
|
101
|
+
"STREAMLIT_SERVER_RUN_ON_SAVE": True,
|
|
102
|
+
"STREAMLIT_SERVER_PORT": 8501,
|
|
103
|
+
"STREAMLIT_THEME_BASE": "light",
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
for key in rc:
|
|
107
|
+
if key.startswith("STREAMLIT_") and key in os.environ:
|
|
108
|
+
rc[key] = os.environ[key]
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@overload
|
|
112
|
+
def run(
|
|
113
|
+
*,
|
|
114
|
+
title: str = "Streamlit runner app",
|
|
115
|
+
maximized: bool = True,
|
|
116
|
+
open_as_app: bool = True,
|
|
117
|
+
print_command: bool = True,
|
|
118
|
+
**kwargs,
|
|
119
|
+
): ...
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
@overload
|
|
123
|
+
def run(**kwargs): ...
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def run(
|
|
127
|
+
**kwargs,
|
|
128
|
+
):
|
|
129
|
+
"""Run the script file as a streamlit app and exits.
|
|
130
|
+
|
|
131
|
+
Executes the command `streamlit run <script.py>` before exit the program.
|
|
132
|
+
|
|
133
|
+
The parameters of this function have preference over the runtime config variable `streamlitrunner.rc`
|
|
134
|
+
|
|
135
|
+
Parameters
|
|
136
|
+
----------
|
|
137
|
+
- `title` (`str`, optional): Defaults to `"Streamlit runner app"`.
|
|
138
|
+
The title of the new window.
|
|
139
|
+
|
|
140
|
+
- `maximized` (`bool`, optional): Defaults to `True`.
|
|
141
|
+
Whether or not to start the window maximized.
|
|
142
|
+
|
|
143
|
+
- `open_as_app` (`bool`, optional): Defaults to `True`.
|
|
144
|
+
Whether to open the chromium based browser launching the url in "application mode" with `--app=` argument (separate window).
|
|
145
|
+
If `True`, the option `STREAMLIT_SERVER_HEADLESS` is set to `True`.
|
|
146
|
+
|
|
147
|
+
- `print_command` (`bool`, optional): Defaults to `True`.
|
|
148
|
+
Whether to print the command executed by this function.
|
|
149
|
+
|
|
150
|
+
- `**kwargs`: Additional keyword arguments passed as options to the `streamlit run` command.
|
|
151
|
+
These keyword arguments have the same names as the environment variables, but passed with
|
|
152
|
+
lower case and without the prefix `streamlit_`. Use `streamlit run --help` to get a list.
|
|
153
|
+
|
|
154
|
+
Some values are predefined, if not given. Namely:
|
|
155
|
+
|
|
156
|
+
+ `client_toolbar_mode` (`STREAMLIT_CLIENT_TOOLBAR_MODE`) = `"minimal"`
|
|
157
|
+
|
|
158
|
+
+ `server_headless` (`STREAMLIT_SERVER_HEADLESS`): `True` if `open_as_app=True`
|
|
159
|
+
|
|
160
|
+
+ `server_run_on_save` (`STREAMLIT_SERVER_RUN_ON_SAVE`) = `True`
|
|
161
|
+
|
|
162
|
+
+ `server_port` (`STREAMLIT_SERVER_PORT`) = `8501`
|
|
163
|
+
|
|
164
|
+
+ `theme_base` (`STREAMLIT_THEME_BASE`) = `"light"`
|
|
165
|
+
"""
|
|
166
|
+
if not inside_streamlit_app and not interactively_debugging:
|
|
167
|
+
|
|
168
|
+
if "STREAMLIT_SERVER_HEADLESS" not in rc:
|
|
169
|
+
if "STREAMLIT_SERVER_HEADLESS" in os.environ:
|
|
170
|
+
rc["STREAMLIT_SERVER_HEADLESS"] = bool(os.environ["STREAMLIT_SERVER_HEADLESS"])
|
|
171
|
+
else:
|
|
172
|
+
if kwargs.get("open_as_app", True):
|
|
173
|
+
rc["STREAMLIT_SERVER_HEADLESS"] = True
|
|
174
|
+
else:
|
|
175
|
+
rc["STREAMLIT_SERVER_HEADLESS"] = False
|
|
176
|
+
|
|
177
|
+
spec_args = ["open_as_app", "print_command", "title", "maximized"]
|
|
178
|
+
|
|
179
|
+
for key in kwargs:
|
|
180
|
+
rc[(key if key in spec_args else f"streamlit_{key}").upper()] = kwargs[key]
|
|
181
|
+
|
|
182
|
+
for option in rc:
|
|
183
|
+
if option.startswith("STREAMLIT_"):
|
|
184
|
+
os.environ[option] = str(rc[option])
|
|
185
|
+
|
|
186
|
+
server_headless: bool = rc["STREAMLIT_SERVER_HEADLESS"]
|
|
187
|
+
print_command: bool = rc.get("PRINT_COMMAND", True)
|
|
188
|
+
open_as_app: bool = rc.get("OPEN_AS_APP", True)
|
|
189
|
+
server_port: int = rc.get("STREAMLIT_SERVER_PORT", 8501)
|
|
190
|
+
maximized: bool = rc.get("MAXIMIZED", True)
|
|
191
|
+
title: str = rc.get("TITLE", "Streamlit runner app")
|
|
192
|
+
|
|
193
|
+
def run_streamlit():
|
|
194
|
+
streamlit = Path(sys.executable).resolve().parent / "streamlit.exe"
|
|
195
|
+
if not streamlit.exists():
|
|
196
|
+
streamlit = "streamlit"
|
|
197
|
+
command = f'{streamlit} run --server.headless {server_headless} --server.port {server_port} {sys.argv[0]} -- {" ".join(sys.argv[1:])}'
|
|
198
|
+
if print_command:
|
|
199
|
+
print(command)
|
|
200
|
+
os.system(command)
|
|
201
|
+
|
|
202
|
+
try:
|
|
203
|
+
if open_as_app:
|
|
204
|
+
thread = Thread(target=run_streamlit)
|
|
205
|
+
thread.daemon = True
|
|
206
|
+
thread.start()
|
|
207
|
+
webview.create_window(title, f"http://localhost:{server_port}/", maximized=maximized)
|
|
208
|
+
webview.start()
|
|
209
|
+
else:
|
|
210
|
+
run_streamlit()
|
|
211
|
+
|
|
212
|
+
except KeyboardInterrupt:
|
|
213
|
+
sys.exit()
|
|
214
|
+
sys.exit()
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Literal, TypedDict, overload
|
|
5
|
+
|
|
6
|
+
from streamlit.runtime.scriptrunner import get_script_run_ctx
|
|
7
|
+
|
|
8
|
+
class RuntimeConfig(TypedDict, total=False):
|
|
9
|
+
CLOSE_OPENED_WINDOW: bool
|
|
10
|
+
OPEN_AS_APP: bool
|
|
11
|
+
BROWSER: Literal["chrome", "msedge"]
|
|
12
|
+
PRINT_COMMAND: bool
|
|
13
|
+
STREAMLIT_GLOBAL_DISABLE_WATCHDOG_WARNING: bool
|
|
14
|
+
STREAMLIT_GLOBAL_DISABLE_WIDGET_STATE_DUPLICATION_WARNING: bool
|
|
15
|
+
STREAMLIT_GLOBAL_SHOW_WARNING_ON_DIRECT_EXECUTION: bool
|
|
16
|
+
STREAMLIT_GLOBAL_DEVELOPMENT_MODE: bool
|
|
17
|
+
STREAMLIT_GLOBAL_LOG_LEVEL: Literal["error", "warning", "info", "debug"]
|
|
18
|
+
STREAMLIT_GLOBAL_UNIT_TEST: bool
|
|
19
|
+
STREAMLIT_GLOBAL_APP_TEST: bool
|
|
20
|
+
STREAMLIT_GLOBAL_SUPPRESS_DEPRECATION_WARNINGS: bool
|
|
21
|
+
STREAMLIT_GLOBAL_MIN_CACHED_MESSAGE_SIZE: float
|
|
22
|
+
STREAMLIT_GLOBAL_MAX_CACHED_MESSAGE_AGE: int
|
|
23
|
+
STREAMLIT_GLOBAL_STORE_CACHED_FORWARD_MESSAGES_IN_MEMORY: bool
|
|
24
|
+
STREAMLIT_GLOBAL_DATA_FRAME_SERIALIZATION: Literal["legacy", "arrow"]
|
|
25
|
+
STREAMLIT_LOGGER_LEVEL: Literal["error", "warning", "info", "debug"]
|
|
26
|
+
STREAMLIT_LOGGER_MESSAGE_FORMAT: str
|
|
27
|
+
STREAMLIT_LOGGER_ENABLE_RICH: bool
|
|
28
|
+
STREAMLIT_CLIENT_CACHING: bool
|
|
29
|
+
STREAMLIT_CLIENT_DISPLAY_ENABLED: bool
|
|
30
|
+
STREAMLIT_CLIENT_SHOW_ERROR_DETAILS: bool
|
|
31
|
+
STREAMLIT_CLIENT_TOOLBAR_MODE: Literal["auto", "developer", "viewer", "minimal"]
|
|
32
|
+
STREAMLIT_CLIENT_SHOW_SIDEBAR_NAVIGATION: bool
|
|
33
|
+
STREAMLIT_RUNNER_MAGIC_ENABLED: bool
|
|
34
|
+
STREAMLIT_RUNNER_INSTALL_TRACER: bool
|
|
35
|
+
STREAMLIT_RUNNER_FIX_MATPLOTLIB: bool
|
|
36
|
+
STREAMLIT_RUNNER_POST_SCRIPT_GC: bool
|
|
37
|
+
STREAMLIT_RUNNER_FAST_RERUNS: bool
|
|
38
|
+
STREAMLIT_RUNNER_ENFORCE_SERIALIZABLE_SESSION_STATE: bool
|
|
39
|
+
STREAMLIT_RUNNER_ENUM_COERCION: Literal["off", "nameOnly", "nameAndValue"]
|
|
40
|
+
STREAMLIT_SERVER_FOLDER_WATCH_BLACKLIST: str
|
|
41
|
+
STREAMLIT_SERVER_FILE_WATCHER_TYPE: Literal["auto", "watchdog", "poll", "none"]
|
|
42
|
+
STREAMLIT_SERVER_HEADLESS: bool
|
|
43
|
+
STREAMLIT_SERVER_RUN_ON_SAVE: bool
|
|
44
|
+
STREAMLIT_SERVER_ALLOW_RUN_ON_SAVE: bool
|
|
45
|
+
STREAMLIT_SERVER_ADDRESS: str
|
|
46
|
+
STREAMLIT_SERVER_PORT: int
|
|
47
|
+
STREAMLIT_SERVER_SCRIPT_HEALTH_CHECK_ENABLED: bool
|
|
48
|
+
STREAMLIT_SERVER_BASE_URL_PATH: str
|
|
49
|
+
STREAMLIT_SERVER_ENABLE_CORS: bool
|
|
50
|
+
STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION: bool
|
|
51
|
+
STREAMLIT_SERVER_MAX_UPLOAD_SIZE: int
|
|
52
|
+
STREAMLIT_SERVER_MAX_MESSAGE_SIZE: int
|
|
53
|
+
STREAMLIT_SERVER_ENABLE_ARROW_TRUNCATION: bool
|
|
54
|
+
STREAMLIT_SERVER_ENABLE_WEBSOCKET_COMPRESSION: bool
|
|
55
|
+
STREAMLIT_SERVER_ENABLE_STATIC_SERVING: bool
|
|
56
|
+
STREAMLIT_BROWSER_SERVER_ADDRESS: str
|
|
57
|
+
STREAMLIT_BROWSER_GATHER_USAGE_STATS: bool
|
|
58
|
+
STREAMLIT_BROWSER_SERVER_PORT: int
|
|
59
|
+
STREAMLIT_SERVER_SSL_CERT_FILE: str
|
|
60
|
+
STREAMLIT_SERVER_SSL_KEY_FILE: str
|
|
61
|
+
STREAMLIT_UI_HIDE_TOP_BAR: bool
|
|
62
|
+
STREAMLIT_UI_HIDE_SIDEBAR_NAV: bool
|
|
63
|
+
STREAMLIT_MAGIC_DISPLAY_ROOT_DOC_STRING: bool
|
|
64
|
+
STREAMLIT_MAGIC_DISPLAY_LAST_EXPR_IF_NO_SEMICOLON: bool
|
|
65
|
+
STREAMLIT_DEPRECATION_SHOWFILE_UPLOADER_ENCODING: bool
|
|
66
|
+
STREAMLIT_DEPRECATION_SHOW_IMAGE_FORMAT: bool
|
|
67
|
+
STREAMLIT_DEPRECATION_SHOW_PYPLOT_GLOBAL_USE: bool
|
|
68
|
+
STREAMLIT_THEME_BASE: Literal["dark", "light"]
|
|
69
|
+
STREAMLIT_THEME_PRIMARY_COLOR: str
|
|
70
|
+
STREAMLIT_THEME_BACKGROUND_COLOR: str
|
|
71
|
+
STREAMLIT_THEME_SECONDARY_BACKGROUND_COLOR: str
|
|
72
|
+
STREAMLIT_THEME_TEXT_COLOR: str
|
|
73
|
+
STREAMLIT_THEME_FONT: Literal["sans serif", "serif", "monospace"]
|
|
74
|
+
|
|
75
|
+
rc: RuntimeConfig = {
|
|
76
|
+
"OPEN_AS_APP": True,
|
|
77
|
+
"BROWSER": "msedge",
|
|
78
|
+
"CLOSE_OPENED_WINDOW": True,
|
|
79
|
+
"PRINT_COMMAND": True,
|
|
80
|
+
"STREAMLIT_CLIENT_TOOLBAR_MODE": "minimal",
|
|
81
|
+
"STREAMLIT_SERVER_RUN_ON_SAVE": True,
|
|
82
|
+
"STREAMLIT_SERVER_PORT": 8501,
|
|
83
|
+
"STREAMLIT_THEME_BASE": "light",
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
def run(
|
|
87
|
+
*,
|
|
88
|
+
open_as_app: bool = True,
|
|
89
|
+
print_command: bool = True,
|
|
90
|
+
client_toolbar_mode: Literal["auto", "developer", "viewer", "minimal"] = "minimal",
|
|
91
|
+
theme_base: Literal["dark", "light"] = "light",
|
|
92
|
+
server_port: int = 8501,
|
|
93
|
+
server_run_on_save: bool = True,
|
|
94
|
+
server_headless: bool = ...,
|
|
95
|
+
global_disable_watchdog_warning: bool = ...,
|
|
96
|
+
global_disable_widget_state_duplication_warning: bool = ...,
|
|
97
|
+
global_show_warning_on_direct_execution: bool = ...,
|
|
98
|
+
global_development_mode: bool = ...,
|
|
99
|
+
global_log_level: Literal["error", "warning", "info", "debug"] = ...,
|
|
100
|
+
global_unit_test: bool = ...,
|
|
101
|
+
global_app_test: bool = ...,
|
|
102
|
+
global_suppress_deprecation_warnings: bool = ...,
|
|
103
|
+
global_min_cached_message_size: float = ...,
|
|
104
|
+
global_max_cached_message_age: int = ...,
|
|
105
|
+
global_store_cached_forward_messages_in_memory: bool = ...,
|
|
106
|
+
global_data_frame_serialization: Literal["legacy", "arrow"] = ...,
|
|
107
|
+
logger_level: Literal["error", "warning", "info", "debug"] = ...,
|
|
108
|
+
logger_message_format: str = ...,
|
|
109
|
+
logger_enable_rich: bool = ...,
|
|
110
|
+
client_caching: bool = ...,
|
|
111
|
+
client_display_enabled: bool = ...,
|
|
112
|
+
client_show_error_details: bool = ...,
|
|
113
|
+
client_show_sidebar_navigation: bool = ...,
|
|
114
|
+
runner_magic_enabled: bool = ...,
|
|
115
|
+
runner_install_tracer: bool = ...,
|
|
116
|
+
runner_fix_matplotlib: bool = ...,
|
|
117
|
+
runner_post_script_gc: bool = ...,
|
|
118
|
+
runner_fast_reruns: bool = ...,
|
|
119
|
+
runner_enforce_serializable_session_state: bool = ...,
|
|
120
|
+
runner_enum_coercion: Literal["off", "nameOnly", "nameAndValue"] = ...,
|
|
121
|
+
server_folder_watch_blacklist: str = ...,
|
|
122
|
+
server_file_watcher_type: Literal["auto", "watchdog", "poll", "none"] = ...,
|
|
123
|
+
server_allow_run_on_save: bool = ...,
|
|
124
|
+
server_address: str = ...,
|
|
125
|
+
server_script_health_check_enabled: bool = ...,
|
|
126
|
+
server_base_url_path: str = ...,
|
|
127
|
+
server_enable_cors: bool = ...,
|
|
128
|
+
server_enable_xsrf_protection: bool = ...,
|
|
129
|
+
server_max_upload_size: int = ...,
|
|
130
|
+
server_max_message_size: int = ...,
|
|
131
|
+
server_enable_arrow_truncation: bool = ...,
|
|
132
|
+
server_enable_websocket_compression: bool = ...,
|
|
133
|
+
server_enable_static_serving: bool = ...,
|
|
134
|
+
browser_server_address: str = ...,
|
|
135
|
+
browser_gather_usage_stats: bool = ...,
|
|
136
|
+
browser_server_port: int = ...,
|
|
137
|
+
server_ssl_cert_file: str = ...,
|
|
138
|
+
server_ssl_key_file: str = ...,
|
|
139
|
+
ui_hide_top_bar: bool = ...,
|
|
140
|
+
ui_hide_sidebar_nav: bool = ...,
|
|
141
|
+
magic_display_root_doc_string: bool = ...,
|
|
142
|
+
magic_display_last_expr_if_no_semicolon: bool = ...,
|
|
143
|
+
deprecation_showfile_uploader_encoding: bool = ...,
|
|
144
|
+
deprecation_show_image_format: bool = ...,
|
|
145
|
+
deprecation_show_pyplot_global_use: bool = ...,
|
|
146
|
+
theme_primary_color: str = ...,
|
|
147
|
+
theme_background_color: str = ...,
|
|
148
|
+
theme_secondary_background_color: str = ...,
|
|
149
|
+
theme_text_color: str = ...,
|
|
150
|
+
theme_font: Literal["sans serif", "serif", "monospace"] = ...,
|
|
151
|
+
) -> None: ...
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: streamlitrunner
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: A module to run streamlit apps as local apps
|
|
5
|
+
Project-URL: Documentation, https://github.com/diogo-rossi/streamlitrunner
|
|
6
|
+
Project-URL: Issues, https://github.com/diogo-rossi/streamlitrunner/issues
|
|
7
|
+
Project-URL: Source, https://github.com/diogo-rossi/streamlitrunner
|
|
8
|
+
Author-email: Diogo Rossi <rossi.diogo@gmail.com>
|
|
9
|
+
License-File: LICENSE.txt
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
12
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: pywebview>=6.1
|
|
15
|
+
Requires-Dist: streamlit>=1.52.2
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# Streamlit Runner
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
A simple way to run Streamlit app as a desktop app
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
pip install streamlitrunner
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
Import `streamlitrunner` and call `run()`
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
# my_app.py
|
|
36
|
+
import streamlitrunner as sr
|
|
37
|
+
import streamlit as st
|
|
38
|
+
|
|
39
|
+
st.title("Hello World!")
|
|
40
|
+
st.write("This is a simple text example.")
|
|
41
|
+
|
|
42
|
+
if __name__ == '__main__':
|
|
43
|
+
sr.run()
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Now you can only call `python my_app.py` and it will work as a desktop app!
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
## Documentation:
|
|
51
|
+
|
|
52
|
+
[https://streamlitrunner.readthedocs.io/en/latest/](https://streamlitrunner.readthedocs.io/en/latest/)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
streamlitrunner/__init__.py,sha256=VoIF9Z4WkReJVaW1pXxkHi4Puf43dZ51ueDlxfDdsME,32
|
|
2
|
+
streamlitrunner/streamlitrunner.py,sha256=vgSzfhb31AivzlnQD4-tGS_V-4mcFI9gUcwz7akVxgU,8318
|
|
3
|
+
streamlitrunner/streamlitrunner.pyi,sha256=lUTYNG4NGQyyu4ewqp3J9dIC5jheCYSdwd-zhJMWejI,6737
|
|
4
|
+
streamlitrunner-0.0.0.dist-info/METADATA,sha256=ryOqpSE4_HBF7TS2VgMku8ELw5PjQ-O8GCB_eIIqDQk,1371
|
|
5
|
+
streamlitrunner-0.0.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
6
|
+
streamlitrunner-0.0.0.dist-info/licenses/LICENSE.txt,sha256=-6OpZxsEbYbcRSz-G2Akv04hShqmiOPbqx1RRh-WZrY,1062
|
|
7
|
+
streamlitrunner-0.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Diogo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|