streamlit-nightly 1.31.2.dev20240212__py2.py3-none-any.whl → 1.31.2.dev20240214__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.
- streamlit/case_converters.py +9 -4
- streamlit/cli_util.py +2 -0
- streamlit/code_util.py +5 -2
- streamlit/color_util.py +2 -0
- streamlit/column_config.py +2 -0
- streamlit/commands/execution_control.py +4 -2
- streamlit/commands/experimental_query_params.py +7 -4
- streamlit/commands/page_config.py +11 -9
- streamlit/components/v1/components.py +23 -16
- streamlit/config.py +3 -5
- streamlit/config_option.py +12 -11
- streamlit/connections/base_connection.py +4 -2
- streamlit/connections/snowflake_connection.py +4 -4
- streamlit/connections/snowpark_connection.py +3 -3
- streamlit/connections/sql_connection.py +6 -6
- streamlit/connections/util.py +8 -5
- streamlit/constants.py +2 -0
- streamlit/cursor.py +16 -14
- streamlit/delta_generator.py +10 -13
- streamlit/deprecation_util.py +4 -3
- streamlit/echo.py +5 -3
- streamlit/elements/alert.py +16 -14
- streamlit/elements/altair_utils.py +8 -6
- streamlit/elements/arrow.py +4 -4
- streamlit/elements/arrow_altair.py +24 -34
- streamlit/elements/arrow_vega_lite.py +9 -14
- streamlit/elements/balloons.py +4 -2
- streamlit/elements/bokeh_chart.py +7 -7
- streamlit/elements/code.py +6 -4
- streamlit/elements/deck_gl_json_chart.py +8 -8
- streamlit/elements/doc_string.py +5 -9
- streamlit/elements/empty.py +4 -2
- streamlit/elements/exception.py +10 -10
- streamlit/elements/form.py +1 -3
- streamlit/elements/graphviz_chart.py +5 -6
- streamlit/elements/heading.py +16 -14
- streamlit/elements/iframe.py +14 -12
- streamlit/elements/image.py +8 -8
- streamlit/elements/json.py +6 -4
- streamlit/elements/layouts.py +12 -10
- streamlit/elements/lib/column_config_utils.py +2 -2
- streamlit/elements/lib/column_types.py +23 -23
- streamlit/elements/lib/dicttools.py +10 -6
- streamlit/elements/lib/mutable_status_container.py +7 -7
- streamlit/elements/lib/pandas_styler_utils.py +6 -6
- streamlit/elements/lib/streamlit_plotly_theme.py +2 -0
- streamlit/elements/map.py +11 -22
- streamlit/elements/markdown.py +16 -14
- streamlit/elements/media.py +16 -16
- streamlit/elements/metric.py +9 -7
- streamlit/elements/plotly_chart.py +5 -5
- streamlit/elements/progress.py +6 -6
- streamlit/elements/pyplot.py +10 -13
- streamlit/elements/snow.py +4 -2
- streamlit/elements/spinner.py +2 -0
- streamlit/elements/text.py +7 -5
- streamlit/elements/toast.py +6 -4
- streamlit/elements/utils.py +15 -28
- streamlit/elements/widgets/button.py +39 -39
- streamlit/elements/widgets/camera_input.py +21 -17
- streamlit/elements/widgets/chat.py +6 -7
- streamlit/elements/widgets/checkbox.py +21 -19
- streamlit/elements/widgets/color_picker.py +18 -16
- streamlit/elements/widgets/data_editor.py +7 -7
- streamlit/elements/widgets/file_uploader.py +59 -55
- streamlit/elements/widgets/multiselect.py +33 -42
- streamlit/elements/widgets/number_input.py +10 -5
- streamlit/elements/widgets/radio.py +1 -1
- streamlit/elements/widgets/select_slider.py +25 -34
- streamlit/elements/widgets/selectbox.py +1 -1
- streamlit/elements/widgets/slider.py +28 -36
- streamlit/elements/widgets/text_widgets.py +6 -6
- streamlit/elements/widgets/time_widgets.py +13 -13
- streamlit/elements/write.py +21 -29
- streamlit/env_util.py +5 -3
- streamlit/error_util.py +7 -3
- streamlit/errors.py +3 -1
- streamlit/external/langchain/streamlit_callback_handler.py +26 -24
- streamlit/file_util.py +18 -14
- streamlit/folder_black_list.py +3 -1
- streamlit/git_util.py +5 -3
- streamlit/js_number.py +10 -13
- streamlit/logger.py +5 -5
- streamlit/net_util.py +14 -11
- streamlit/platform.py +2 -0
- streamlit/runtime/__init__.py +2 -0
- streamlit/runtime/app_session.py +42 -42
- streamlit/runtime/caching/__init__.py +4 -4
- streamlit/runtime/caching/cache_data_api.py +3 -3
- streamlit/runtime/caching/cache_errors.py +5 -3
- streamlit/runtime/caching/cache_type.py +2 -0
- streamlit/runtime/caching/cache_utils.py +2 -4
- streamlit/runtime/caching/cached_message_replay.py +12 -5
- streamlit/runtime/caching/hashing.py +29 -21
- streamlit/runtime/caching/storage/cache_storage_protocol.py +1 -2
- streamlit/runtime/caching/storage/local_disk_cache_storage.py +6 -5
- streamlit/runtime/connection_factory.py +8 -8
- streamlit/runtime/forward_msg_cache.py +20 -18
- streamlit/runtime/forward_msg_queue.py +8 -9
- streamlit/runtime/legacy_caching/caching.py +32 -42
- streamlit/runtime/legacy_caching/hashing.py +29 -25
- streamlit/runtime/media_file_manager.py +16 -14
- streamlit/runtime/media_file_storage.py +8 -8
- streamlit/runtime/memory_media_file_storage.py +12 -14
- streamlit/runtime/memory_session_storage.py +4 -3
- streamlit/runtime/memory_uploaded_file_manager.py +9 -10
- streamlit/runtime/metrics_util.py +20 -20
- streamlit/runtime/runtime.py +25 -27
- streamlit/runtime/runtime_util.py +5 -3
- streamlit/runtime/script_data.py +2 -0
- streamlit/runtime/scriptrunner/magic.py +17 -11
- streamlit/runtime/scriptrunner/magic_funcs.py +2 -0
- streamlit/runtime/scriptrunner/script_requests.py +6 -4
- streamlit/runtime/scriptrunner/script_run_context.py +17 -17
- streamlit/runtime/scriptrunner/script_runner.py +7 -5
- streamlit/runtime/secrets.py +4 -6
- streamlit/runtime/session_manager.py +14 -14
- streamlit/runtime/state/common.py +5 -4
- streamlit/runtime/state/query_params.py +8 -6
- streamlit/runtime/state/query_params_proxy.py +7 -5
- streamlit/runtime/state/safe_session_state.py +7 -5
- streamlit/runtime/state/session_state.py +3 -4
- streamlit/runtime/state/session_state_proxy.py +5 -5
- streamlit/runtime/state/widgets.py +20 -18
- streamlit/runtime/stats.py +13 -15
- streamlit/runtime/uploaded_file_manager.py +6 -5
- streamlit/runtime/websocket_session_manager.py +14 -14
- streamlit/source_util.py +13 -11
- streamlit/static/asset-manifest.json +13 -13
- streamlit/static/index.html +1 -1
- streamlit/static/static/css/2411.8b8f33d6.chunk.css +1 -0
- streamlit/static/static/css/43.e3b876c5.chunk.css +1 -0
- streamlit/static/static/css/6692.65519639.chunk.css +1 -0
- streamlit/static/static/js/{3075.76725a14.chunk.js → 2411.714d213e.chunk.js} +2 -2
- streamlit/static/static/js/4185.21ca0590.chunk.js +1 -0
- streamlit/static/static/js/43.36939bb1.chunk.js +1 -0
- streamlit/static/static/js/{5117.6a701db1.chunk.js → 5117.04bfe5d3.chunk.js} +1 -1
- streamlit/static/static/js/{5791.30b01ee8.chunk.js → 5791.c5138157.chunk.js} +1 -1
- streamlit/static/static/js/656.8c998bc8.chunk.js +2 -0
- streamlit/static/static/js/{6692.6ac4ea6f.chunk.js → 6692.6496cbc2.chunk.js} +1 -1
- streamlit/static/static/js/7142.400eefdd.chunk.js +1 -0
- streamlit/static/static/js/main.2737c0f9.js +2 -0
- streamlit/static/static/js/{main.043d802e.js.LICENSE.txt → main.2737c0f9.js.LICENSE.txt} +23 -25
- streamlit/string_util.py +13 -9
- streamlit/temporary_directory.py +3 -1
- streamlit/testing/v1/element_tree.py +1 -2
- streamlit/testing/v1/util.py +7 -3
- streamlit/type_util.py +30 -25
- streamlit/url_util.py +6 -4
- streamlit/user_info.py +8 -6
- streamlit/util.py +23 -37
- streamlit/version.py +16 -9
- streamlit/watcher/event_based_path_watcher.py +10 -10
- streamlit/watcher/local_sources_watcher.py +15 -13
- streamlit/watcher/path_watcher.py +0 -3
- streamlit/watcher/polling_path_watcher.py +9 -8
- streamlit/watcher/util.py +3 -2
- streamlit/web/cache_storage_manager_config.py +2 -0
- streamlit/web/server/app_static_file_handler.py +6 -5
- streamlit/web/server/browser_websocket_handler.py +10 -8
- streamlit/web/server/component_request_handler.py +7 -4
- streamlit/web/server/media_file_handler.py +5 -4
- streamlit/web/server/routes.py +6 -3
- streamlit/web/server/server.py +41 -34
- streamlit/web/server/server_util.py +8 -3
- streamlit/web/server/stats_request_handler.py +14 -5
- streamlit/web/server/upload_file_request_handler.py +7 -8
- streamlit/web/server/websocket_headers.py +2 -2
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/RECORD +176 -176
- streamlit/static/static/css/3075.81b3d18f.chunk.css +0 -1
- streamlit/static/static/css/43.c24b25fa.chunk.css +0 -1
- streamlit/static/static/css/6692.bb444a79.chunk.css +0 -1
- streamlit/static/static/js/1215.baf3721f.chunk.js +0 -2
- streamlit/static/static/js/4185.90e929dc.chunk.js +0 -1
- streamlit/static/static/js/43.8ca4bc8a.chunk.js +0 -1
- streamlit/static/static/js/7142.a359ed63.chunk.js +0 -1
- streamlit/static/static/js/main.043d802e.js +0 -2
- /streamlit/static/static/js/{3075.76725a14.chunk.js.LICENSE.txt → 2411.714d213e.chunk.js.LICENSE.txt} +0 -0
- /streamlit/static/static/js/{1215.baf3721f.chunk.js.LICENSE.txt → 656.8c998bc8.chunk.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.31.2.dev20240212.data → streamlit_nightly-1.31.2.dev20240214.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.31.2.dev20240212.dist-info → streamlit_nightly-1.31.2.dev20240214.dist-info}/top_level.txt +0 -0
@@ -14,13 +14,18 @@
|
|
14
14
|
|
15
15
|
"""Server related utility functions"""
|
16
16
|
|
17
|
-
from
|
17
|
+
from __future__ import annotations
|
18
|
+
|
19
|
+
from typing import Final
|
18
20
|
from urllib.parse import urljoin
|
19
21
|
|
20
22
|
import tornado.web
|
21
23
|
|
22
24
|
from streamlit import config, net_util, url_util
|
23
25
|
|
26
|
+
# The port reserved for internal development.
|
27
|
+
DEVELOPMENT_PORT: Final = 3000
|
28
|
+
|
24
29
|
|
25
30
|
def is_url_from_allowed_origins(url: str) -> bool:
|
26
31
|
"""Return True if URL is from allowed origins (for CORS purpose).
|
@@ -64,7 +69,7 @@ def is_url_from_allowed_origins(url: str) -> bool:
|
|
64
69
|
return False
|
65
70
|
|
66
71
|
|
67
|
-
def _get_server_address_if_manually_set() ->
|
72
|
+
def _get_server_address_if_manually_set() -> str | None:
|
68
73
|
if config.is_manually_set("browser.serverAddress"):
|
69
74
|
return url_util.get_hostname(config.get_option("browser.serverAddress"))
|
70
75
|
return None
|
@@ -111,7 +116,7 @@ def _get_browser_address_bar_port() -> int:
|
|
111
116
|
|
112
117
|
"""
|
113
118
|
if config.get_option("global.developmentMode"):
|
114
|
-
return
|
119
|
+
return DEVELOPMENT_PORT
|
115
120
|
return int(config.get_option("browser.serverPort"))
|
116
121
|
|
117
122
|
|
@@ -12,15 +12,18 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
from
|
15
|
+
from __future__ import annotations
|
16
|
+
|
17
|
+
from typing import TYPE_CHECKING
|
16
18
|
|
17
19
|
import tornado.web
|
18
20
|
|
19
|
-
from streamlit.proto.openmetrics_data_model_pb2 import GAUGE
|
20
|
-
from streamlit.proto.openmetrics_data_model_pb2 import MetricSet as MetricSetProto
|
21
21
|
from streamlit.runtime.stats import CacheStat, StatsManager
|
22
22
|
from streamlit.web.server.server_util import emit_endpoint_deprecation_notice
|
23
23
|
|
24
|
+
if TYPE_CHECKING:
|
25
|
+
from streamlit.proto.openmetrics_data_model_pb2 import MetricSet as MetricSetProto
|
26
|
+
|
24
27
|
|
25
28
|
class StatsRequestHandler(tornado.web.RequestHandler):
|
26
29
|
def initialize(self, stats_manager: StatsManager) -> None:
|
@@ -56,7 +59,7 @@ class StatsRequestHandler(tornado.web.RequestHandler):
|
|
56
59
|
self.set_status(200)
|
57
60
|
|
58
61
|
@staticmethod
|
59
|
-
def _stats_to_text(stats:
|
62
|
+
def _stats_to_text(stats: list[CacheStat]) -> str:
|
60
63
|
metric_type = "# TYPE cache_memory_bytes gauge"
|
61
64
|
metric_unit = "# UNIT cache_memory_bytes bytes"
|
62
65
|
metric_help = "# HELP Total memory consumed by a cache."
|
@@ -70,7 +73,13 @@ class StatsRequestHandler(tornado.web.RequestHandler):
|
|
70
73
|
return "\n".join(result)
|
71
74
|
|
72
75
|
@staticmethod
|
73
|
-
def _stats_to_proto(stats:
|
76
|
+
def _stats_to_proto(stats: list[CacheStat]) -> MetricSetProto:
|
77
|
+
# Lazy load the import of this proto message for better performance:
|
78
|
+
from streamlit.proto.openmetrics_data_model_pb2 import GAUGE
|
79
|
+
from streamlit.proto.openmetrics_data_model_pb2 import (
|
80
|
+
MetricSet as MetricSetProto,
|
81
|
+
)
|
82
|
+
|
74
83
|
metric_set = MetricSetProto()
|
75
84
|
|
76
85
|
metric_family = metric_set.metric_families.add()
|
@@ -12,19 +12,18 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
from
|
15
|
+
from __future__ import annotations
|
16
|
+
|
17
|
+
from typing import Any, Callable
|
16
18
|
|
17
19
|
import tornado.httputil
|
18
20
|
import tornado.web
|
19
21
|
|
20
22
|
from streamlit import config
|
21
|
-
from streamlit.logger import get_logger
|
22
23
|
from streamlit.runtime.memory_uploaded_file_manager import MemoryUploadedFileManager
|
23
|
-
from streamlit.runtime.uploaded_file_manager import
|
24
|
+
from streamlit.runtime.uploaded_file_manager import UploadedFileRec
|
24
25
|
from streamlit.web.server import routes, server_util
|
25
26
|
|
26
|
-
LOGGER = get_logger(__name__)
|
27
|
-
|
28
27
|
|
29
28
|
class UploadFileRequestHandler(tornado.web.RequestHandler):
|
30
29
|
"""Implements the POST /upload_file endpoint."""
|
@@ -84,8 +83,8 @@ class UploadFileRequestHandler(tornado.web.RequestHandler):
|
|
84
83
|
def put(self, **kwargs):
|
85
84
|
"""Receive an uploaded file and add it to our UploadedFileManager."""
|
86
85
|
|
87
|
-
args:
|
88
|
-
files:
|
86
|
+
args: dict[str, list[bytes]] = {}
|
87
|
+
files: dict[str, list[Any]] = {}
|
89
88
|
|
90
89
|
session_id = self.path_kwargs["session_id"]
|
91
90
|
file_id = self.path_kwargs["file_id"]
|
@@ -104,7 +103,7 @@ class UploadFileRequestHandler(tornado.web.RequestHandler):
|
|
104
103
|
self.send_error(400, reason=str(e))
|
105
104
|
return
|
106
105
|
|
107
|
-
uploaded_files:
|
106
|
+
uploaded_files: list[UploadedFileRec] = []
|
108
107
|
|
109
108
|
for _, flist in files.items():
|
110
109
|
for file in flist:
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
from
|
15
|
+
from __future__ import annotations
|
16
16
|
|
17
17
|
from streamlit import runtime
|
18
18
|
from streamlit.runtime.metrics_util import gather_metrics
|
@@ -21,7 +21,7 @@ from streamlit.web.server.browser_websocket_handler import BrowserWebSocketHandl
|
|
21
21
|
|
22
22
|
|
23
23
|
@gather_metrics("_get_websocket_headers")
|
24
|
-
def _get_websocket_headers() ->
|
24
|
+
def _get_websocket_headers() -> dict[str, str] | None:
|
25
25
|
"""Return a copy of the HTTP request headers for the current session's
|
26
26
|
WebSocket connection. If there's no active session, return None instead.
|
27
27
|
|