id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
178,330
from __future__ import annotations import collections import dataclasses import datetime import functools import hashlib import inspect import io import os import pickle import sys import tempfile import threading import uuid import weakref from enum import Enum from typing import Any, Callable, Dict, Final, Pattern, T...
null
178,331
from __future__ import annotations import collections import dataclasses import datetime import functools import hashlib import inspect import io import os import pickle import sys import tempfile import threading import uuid import weakref from enum import Enum from typing import Any, Callable, Dict, Final, Pattern, T...
Return key for memoization.
178,332
from __future__ import annotations import math import threading import types from datetime import timedelta from typing import Any, Callable, Final, TypeVar, cast, overload from cachetools import TTLCache from typing_extensions import TypeAlias import streamlit as st from streamlit.deprecation_util import show_deprecat...
True if the two validate functions are equal for the purposes of determining whether a given function cache needs to be recreated.
178,333
from __future__ import annotations import math import threading import types from datetime import timedelta from typing import Any, Callable, Final, TypeVar, cast, overload from cachetools import TTLCache from typing_extensions import TypeAlias import streamlit as st from streamlit.deprecation_util import show_deprecat...
Return the StatsProvider for all @st.cache_resource functions.
178,334
from __future__ import annotations import math import os import shutil from typing import Final from streamlit import util from streamlit.file_util import get_streamlit_file_path, streamlit_read, streamlit_write from streamlit.logger import get_logger from streamlit.runtime.caching.storage.cache_storage_protocol import...
null
178,335
from __future__ import annotations import contextlib import hashlib import threading import types from dataclasses import dataclass from typing import ( TYPE_CHECKING, Any, Final, Iterator, Protocol, Union, runtime_checkable, ) from google.protobuf.message import Message import streamlit as ...
Replay the st element function calls that happened when executing a cache-decorated function. When a cache function is executed, we record the element and block messages produced, and use those to reproduce the DeltaGenerator calls, so the elements will appear in the web app even when execution of the function is skipp...
178,336
from __future__ import annotations import contextlib import hashlib import threading import types from dataclasses import dataclass from typing import ( TYPE_CHECKING, Any, Final, Iterator, Protocol, Union, runtime_checkable, ) from google.protobuf.message import Message import streamlit as ...
Generate a key for the given list of widgets used in a cache-decorated function. Keys are generated by hashing the IDs and values of the widgets in the given list.
178,337
from __future__ import annotations from typing import Any, Final, Iterator, MutableMapping from streamlit import logger as _logger from streamlit import runtime from streamlit.runtime.metrics_util import gather_metrics from streamlit.runtime.state.common import require_valid_user_key from streamlit.runtime.state.safe_s...
Get the SessionState object for the current session. Note that in streamlit scripts, this function should not be called directly. Instead, SessionState objects should be accessed via st.session_state.
178,338
from __future__ import annotations from typing import Any, Final, Iterator, MutableMapping from streamlit import logger as _logger from streamlit import runtime from streamlit.runtime.metrics_util import gather_metrics from streamlit.runtime.state.common import require_valid_user_key from streamlit.runtime.state.safe_s...
null
178,339
from __future__ import annotations import json import pickle from copy import deepcopy from dataclasses import dataclass, field, replace from typing import ( TYPE_CHECKING, Any, Final, Iterator, KeysView, List, MutableMapping, Union, cast, ) from typing_extensions import TypeAlias im...
null
178,340
from __future__ import annotations import json import pickle from copy import deepcopy from dataclasses import dataclass, field, replace from typing import ( TYPE_CHECKING, Any, Final, Iterator, KeysView, List, MutableMapping, Union, cast, ) from typing_extensions import TypeAlias im...
null
178,341
from __future__ import annotations import textwrap from types import MappingProxyType from typing import TYPE_CHECKING, Final, Mapping from typing_extensions import TypeAlias from streamlit.errors import DuplicateWidgetID from streamlit.proto.WidgetStates_pb2 import WidgetState, WidgetStates from streamlit.runtime.stat...
Coalesce an older WidgetStates into a newer one, and return a new WidgetStates containing the result. For most widget values, we just take the latest version. However, any trigger_values (which are set by buttons) that are True in `old_states` will be set to True in the coalesced result, so that button presses don't go...
178,342
from __future__ import annotations import hashlib from dataclasses import dataclass, field from datetime import date, datetime, time, timedelta from typing import ( TYPE_CHECKING, Any, Callable, Dict, Final, Generic, Sequence, Tuple, TypeVar, Union, ) from google.protobuf.message...
Compute the widget id for the given widget. This id is stable: a given set of inputs to this function will always produce the same widget id output. Only stable, deterministic values should be used to compute widget ids. Using nondeterministic values as inputs can cause the resulting widget id to change between runs. T...
178,343
from __future__ import annotations import hashlib from dataclasses import dataclass, field from datetime import date, datetime, time, timedelta from typing import ( TYPE_CHECKING, Any, Callable, Dict, Final, Generic, Sequence, Tuple, TypeVar, Union, ) from google.protobuf.message...
True if the given session_state key has the structure of a widget ID with a user_key.
178,344
from __future__ import annotations import hashlib from dataclasses import dataclass, field from datetime import date, datetime, time, timedelta from typing import ( TYPE_CHECKING, Any, Callable, Dict, Final, Generic, Sequence, Tuple, TypeVar, Union, ) from google.protobuf.message...
Raise an Exception if the given user_key is invalid.
178,345
from __future__ import annotations import hashlib from dataclasses import dataclass, field from datetime import date, datetime, time, timedelta from typing import ( TYPE_CHECKING, Any, Callable, Dict, Final, Generic, Sequence, Tuple, TypeVar, Union, ) from google.protobuf.message...
null
178,346
from __future__ import annotations from dataclasses import dataclass, field from typing import TYPE_CHECKING, Iterable, Iterator, MutableMapping from urllib import parse from streamlit.constants import EMBED_QUERY_PARAMS_KEYS from streamlit.errors import StreamlitAPIException from streamlit.proto.ForwardMsg_pb2 import ...
null
178,347
from __future__ import annotations import contextlib import hashlib import mimetypes import os.path from typing import Final, NamedTuple from streamlit.logger import get_logger from streamlit.runtime.media_file_storage import ( MediaFileKind, MediaFileStorage, MediaFileStorageError, ) from streamlit.runtime...
Hash data, mimetype, and an optional filename to generate a stable file ID. Parameters ---------- data Content of in-memory file in bytes. Other types will throw TypeError. mimetype Any string. Will be converted to bytes and used to compute a hash. filename Any string. Will be converted to bytes and used to compute a h...
178,348
from __future__ import annotations import contextlib import hashlib import mimetypes import os.path from typing import Final, NamedTuple from streamlit.logger import get_logger from streamlit.runtime.media_file_storage import ( MediaFileKind, MediaFileStorage, MediaFileStorageError, ) from streamlit.runtime...
null
178,349
from __future__ import annotations import os import threading from copy import deepcopy from typing import ( Any, Final, ItemsView, Iterator, KeysView, Mapping, NoReturn, ValuesView, ) from blinker import Signal import streamlit as st import streamlit.watcher.path_watcher from streamlit ...
null
178,350
from __future__ import annotations import os import threading from copy import deepcopy from typing import ( Any, Final, ItemsView, Iterator, KeysView, Mapping, NoReturn, ValuesView, ) from blinker import Signal import streamlit as st import streamlit.watcher.path_watcher from streamlit ...
null
178,351
from __future__ import annotations from typing import Any from streamlit.proto.Delta_pb2 import Delta from streamlit.proto.ForwardMsg_pb2 import ForwardMsg The provided code snippet includes necessary dependencies for implementing the `_is_composable_message` function. Write a Python function `def _is_composable_messa...
True if the ForwardMsg is potentially composable with other ForwardMsgs.
178,352
from __future__ import annotations from typing import Any from streamlit.proto.Delta_pb2 import Delta from streamlit.proto.ForwardMsg_pb2 import ForwardMsg The provided code snippet includes necessary dependencies for implementing the `_maybe_compose_deltas` function. Write a Python function `def _maybe_compose_deltas...
Combines new_delta onto old_delta if possible. If the combination takes place, the function returns a new Delta that should replace old_delta in the queue. If the new_delta is incompatible with old_delta, the function returns None. In this case, the new_delta should just be appended to the queue as normal.
178,353
from __future__ import annotations import re from typing import Any, Callable The provided code snippet includes necessary dependencies for implementing the `to_upper_camel_case` function. Write a Python function `def to_upper_camel_case(snake_case_str: str) -> str` to solve the following problem: Converts snake_case ...
Converts snake_case to UpperCamelCase. Example ------- foo_bar -> FooBar
178,354
from __future__ import annotations import re from typing import Any, Callable The provided code snippet includes necessary dependencies for implementing the `to_lower_camel_case` function. Write a Python function `def to_lower_camel_case(snake_case_str: str) -> str` to solve the following problem: Converts snake_case ...
Converts snake_case to lowerCamelCase. Example ------- foo_bar -> fooBar fooBar -> foobar
178,355
from __future__ import annotations import re from typing import Any, Callable The provided code snippet includes necessary dependencies for implementing the `convert_dict_keys` function. Write a Python function `def convert_dict_keys( func: Callable[[str], str], in_dict: dict[Any, Any] ) -> dict[Any, Any]` to solv...
Apply a conversion function to all keys in a dict. Parameters ---------- func : callable The function to apply. Takes a str and returns a str. in_dict : dict The dictionary to convert. If some value in this dict is itself a dict, it also gets recursively converted. Returns ------- dict A new dict with all the contents ...
178,356
from __future__ import annotations import dataclasses import functools import hashlib import os import subprocess import sys from typing import Any, Callable, Final, Iterable, Mapping, TypeVar from streamlit import env_util The provided code snippet includes necessary dependencies for implementing the `memoize` functi...
Decorator to memoize the result of a no-args func.
178,357
from __future__ import annotations import dataclasses import functools import hashlib import os import subprocess import sys from typing import Any, Callable, Final, Iterable, Mapping, TypeVar from streamlit import env_util The provided code snippet includes necessary dependencies for implementing the `repr_` function...
A clean repr for a class, excluding both values that are likely defaults, and those explicitly default for dataclasses.
178,358
from __future__ import annotations import dataclasses import functools import hashlib import os import subprocess import sys from typing import Any, Callable, Final, Iterable, Mapping, TypeVar from streamlit import env_util FLOAT_EQUALITY_EPSILON: Final[float] = 0.000000000005 _Value = TypeVar("_Value") The provided c...
Return zero-based index of the first item whose value is equal to x. Raises a ValueError if there is no such item. We need a custom implementation instead of the built-in list .index() to be compatible with NumPy array and Pandas Series. Parameters ---------- iterable : list, tuple, numpy.ndarray, pandas.Series x : Any...
178,359
from __future__ import annotations import copy import hashlib import json from typing import TYPE_CHECKING, Any, Collection, Dict, Final, Iterable, Union, cast from typing_extensions import TypeAlias import streamlit.elements.deck_gl_json_chart as deck_gl_json_chart from streamlit import config, type_util from streamli...
null
178,360
from __future__ import annotations import copy import hashlib import json from typing import TYPE_CHECKING, Any, Collection, Dict, Final, Iterable, Union, cast from typing_extensions import TypeAlias import streamlit.elements.deck_gl_json_chart as deck_gl_json_chart from streamlit import config, type_util from streamli...
null
178,361
from __future__ import annotations import json from typing import TYPE_CHECKING, Any, cast from streamlit.proto.Json_pb2 import Json as JsonProto from streamlit.runtime.metrics_util import gather_metrics from streamlit.runtime.state import QueryParamsProxy, SessionStateProxy from streamlit.user_info import UserInfoProx...
A repr function for json.dumps default arg, which tries to serialize sets as lists
178,362
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
null
178,363
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
null
178,364
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
Returns one of LabelVisibilityMessage enum constants.py based on string value.
178,365
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
null
178,366
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
null
178,367
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
Maybe Coerce a RegisterWidgetResult with an Enum member value to RegisterWidgetResult[option] if option is an EnumType, otherwise just return the original RegisterWidgetResult.
178,368
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
null
178,369
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
null
178,370
from __future__ import annotations from enum import Enum, EnumMeta from typing import TYPE_CHECKING, Any, Hashable, Iterable, Sequence, cast, overload import streamlit from streamlit import config, runtime, type_util from streamlit.elements.form import is_in_form from streamlit.errors import StreamlitAPIException from ...
Maybe Coerce a RegisterWidgetResult with a sequence of Enum members as value to RegisterWidgetResult[Sequence[option]] if option is an EnumType, otherwise just return the original RegisterWidgetResult.
178,371
from __future__ import annotations import json from typing import TYPE_CHECKING, Any, Literal, cast import streamlit.elements.lib.dicttools as dicttools from streamlit.elements import arrow from streamlit.elements.arrow import Data from streamlit.errors import StreamlitAPIException from streamlit.proto.ArrowVegaLiteCha...
Construct a Vega-Lite chart object. See DeltaGenerator.vega_lite_chart for docs.
178,372
from __future__ import annotations import io import re from pathlib import Path from typing import TYPE_CHECKING, Dict, Final, Union, cast from typing_extensions import TypeAlias import streamlit as st from streamlit import runtime, type_util, url_util from streamlit.elements.lib.subtitle_utils import process_subtitle_...
Marshalls a video proto, using url processors as needed. Parameters ---------- coordinates : str proto : the proto to fill. Must have a string field called "data". data : str, bytes, BytesIO, numpy.ndarray, or file opened with io.open(). Raw video data or a string with a URL pointing to the video to load. Includes supp...
178,373
from __future__ import annotations import io import re from pathlib import Path from typing import TYPE_CHECKING, Dict, Final, Union, cast from typing_extensions import TypeAlias import streamlit as st from streamlit import runtime, type_util, url_util from streamlit.elements.lib.subtitle_utils import process_subtitle_...
Marshalls an audio proto, using data and url processors as needed. Parameters ---------- coordinates : str proto : The proto to fill. Must have a string field called "url". data : str, bytes, BytesIO, numpy.ndarray, or file opened with io.open() Raw audio data or a string with a URL pointing to the file to load. If pas...
178,374
from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Union, cast from typing_extensions import TypeAlias from streamlit import type_util from streamlit.elements.lib.column_config_utils import ( INDEX_IDENTIFIER, ColumnConfigMappingInput, apply_data_specific_configs...
Marshall pandas.DataFrame into an Arrow proto. Parameters ---------- proto : proto.Arrow Output. The protobuf for Streamlit Arrow proto. data : pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, Iterable, dict, or None Something that is or can be converte...
178,375
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class ColumnConfig(TypedDict, total=False): "...
Configure a generic column in ``st.dataframe`` or ``st.data_editor``. The type of the column will be automatically inferred from the data type. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. To change the type of the column and enable type-specific configurat...
178,376
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class NumberColumnConfig(TypedDict): type: Li...
Configure a number column in ``st.dataframe`` or ``st.data_editor``. This is the default column type for integer and float values. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled with a numeric input w...
178,377
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class TextColumnConfig(TypedDict): type: Lite...
r"""Configure a text column in ``st.dataframe`` or ``st.data_editor``. This is the default column type for string values. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled with a text input widget. Param...
178,378
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class LinkColumnConfig(TypedDict): type: Lite...
Configure a link column in ``st.dataframe`` or ``st.data_editor``. The cell values need to be string and will be shown as clickable links. This command needs to be used in the column_config parameter of ``st.dataframe`` or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled with a text input ...
178,379
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class CheckboxColumnConfig(TypedDict): type: ...
Configure a checkbox column in ``st.dataframe`` or ``st.data_editor``. This is the default column type for boolean values. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled with a checkbox widget. Parame...
178,380
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class SelectboxColumnConfig(TypedDict): type:...
Configure a selectbox column in ``st.dataframe`` or ``st.data_editor``. This is the default column type for Pandas categorical values. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled with a selectbox w...
178,381
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class BarChartColumnConfig(TypedDict): type: ...
Configure a bar chart column in ``st.dataframe`` or ``st.data_editor``. Cells need to contain a list of numbers. Chart columns are not editable at the moment. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. Parameters ---------- label: str or None The label sh...
178,382
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class LineChartColumnConfig(TypedDict): type:...
Configure a line chart column in ``st.dataframe`` or ``st.data_editor``. Cells need to contain a list of numbers. Chart columns are not editable at the moment. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. Parameters ---------- label: str or None The label s...
178,383
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class AreaChartColumnConfig(TypedDict): type:...
Configure an area chart column in ``st.dataframe`` or ``st.data_editor``. Cells need to contain a list of numbers. Chart columns are not editable at the moment. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. Parameters ---------- label: str or None The label ...
178,384
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class ImageColumnConfig(TypedDict): type: Lit...
Configure an image column in ``st.dataframe`` or ``st.data_editor``. The cell values need to be one of: * A URL to fetch the image from. This can also be a relative URL of an image deployed via `static file serving <https://docs.streamlit.io/library/advanced-features/static-file-serving>`_. Note that you can NOT use an...
178,385
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class ListColumnConfig(TypedDict): type: Lite...
Configure a list column in ``st.dataframe`` or ``st.data_editor``. This is the default column type for list-like values. List columns are not editable at the moment. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. Parameters ---------- label: str or None The l...
178,386
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class DatetimeColumnConfig(TypedDict): type: ...
Configure a datetime column in ``st.dataframe`` or ``st.data_editor``. This is the default column type for datetime values. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled with a datetime picker widget...
178,387
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class TimeColumnConfig(TypedDict): type: Lite...
Configure a time column in ``st.dataframe`` or ``st.data_editor``. This is the default column type for time values. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled with a time picker widget. Parameters...
178,388
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class DateColumnConfig(TypedDict): type: Lite...
Configure a date column in ``st.dataframe`` or ``st.data_editor``. This is the default column type for date values. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. When used with ``st.data_editor``, editing will be enabled with a date picker widget. Parameters...
178,389
from __future__ import annotations import datetime from typing import Iterable, Literal, TypedDict from typing_extensions import NotRequired, TypeAlias from streamlit.runtime.metrics_util import gather_metrics ColumnWidth: TypeAlias = Literal["small", "medium", "large"] class ProgressColumnConfig(TypedDict): type: ...
Configure a progress column in ``st.dataframe`` or ``st.data_editor``. Cells need to contain a number. Progress columns are not editable at the moment. This command needs to be used in the ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``. Parameters ---------- label : str or None The label shown at...
178,390
from __future__ import annotations import json from enum import Enum from typing import TYPE_CHECKING, Dict, Final, Literal, Mapping, Union from typing_extensions import TypeAlias from streamlit.elements.lib.column_types import ColumnConfig, ColumnType from streamlit.elements.lib.dicttools import remove_none_values fro...
Determine the schema of a dataframe. Parameters ---------- data_df : pd.DataFrame The dataframe to determine the schema of. arrow_schema : pa.Schema The Arrow schema of the dataframe. Returns ------- DataframeSchema A mapping that contains the detected data type for the index and columns. The key is the column name in ...
178,391
from __future__ import annotations import json from enum import Enum from typing import TYPE_CHECKING, Dict, Final, Literal, Mapping, Union from typing_extensions import TypeAlias from streamlit.elements.lib.column_types import ColumnConfig, ColumnType from streamlit.elements.lib.dicttools import remove_none_values fro...
Transforms a user-provided column config mapping into a valid column config mapping that can be used by the frontend. Parameters ---------- column_config: dict or None The user-provided column config mapping. Returns ------- dict The transformed column config mapping.
178,392
from __future__ import annotations import json from enum import Enum from typing import TYPE_CHECKING, Dict, Final, Literal, Mapping, Union from typing_extensions import TypeAlias from streamlit.elements.lib.column_types import ColumnConfig, ColumnType from streamlit.elements.lib.dicttools import remove_none_values fro...
Apply data specific configurations to the provided dataframe. This will apply inplace changes to the dataframe and the column configurations depending on the data format. Parameters ---------- columns_config : ColumnConfigMapping A mapping of column names/ids to column configurations. data_df : pd.DataFrame The datafra...
178,393
from __future__ import annotations import json from enum import Enum from typing import TYPE_CHECKING, Dict, Final, Literal, Mapping, Union from typing_extensions import TypeAlias from streamlit.elements.lib.column_types import ColumnConfig, ColumnType from streamlit.elements.lib.dicttools import remove_none_values fro...
Marshall the column config into the Arrow proto. Parameters ---------- proto : ArrowProto The proto to marshall into. column_config_mapping : ColumnConfigMapping The column config to marshall.
178,394
from __future__ import annotations import contextlib The provided code snippet includes necessary dependencies for implementing the `configure_streamlit_plotly_theme` function. Write a Python function `def configure_streamlit_plotly_theme() -> None` to solve the following problem: Configure the Streamlit chart theme f...
Configure the Streamlit chart theme for Plotly. The theme is only configured if Plotly is installed.
178,395
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast, overload from streamlit.elements.form import current_form_id from streamlit.elements.utils import ( check_callback_rules, check_session_state...
null
178,396
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast, overload from streamlit.elements.form import current_form_id from streamlit.elements.utils import ( check_callback_rules, check_session_state...
null
178,397
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast, overload from streamlit.elements.form import current_form_id from streamlit.elements.utils import ( check_callback_rules, check_session_state...
Perform validation checks and return indices based on the default values.
178,398
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast, overload from streamlit.elements.form import current_form_id from streamlit.elements.utils import ( check_callback_rules, check_session_state...
null
178,399
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast, overload from streamlit.elements.form import current_form_id from streamlit.elements.utils import ( check_callback_rules, check_session_state...
null
178,400
from __future__ import annotations from dataclasses import dataclass from enum import Enum from typing import TYPE_CHECKING, Literal, cast from streamlit import runtime from streamlit.elements.form import is_in_form from streamlit.elements.image import AtomicImage, WidthBehaviour, image_to_url from streamlit.elements.u...
Detects the avatar type and prepares the avatar data for the frontend. Parameters ---------- avatar : The avatar that was provided by the user. delta_path : str The delta path is used as media ID when a local image is served via the media file manager. Returns ------- Tuple[AvatarType, str] The detected avatar type and...
178,401
from __future__ import annotations import json from dataclasses import dataclass from decimal import Decimal from typing import ( TYPE_CHECKING, Any, Dict, Final, Iterable, List, Literal, Mapping, Set, Tuple, TypedDict, TypeVar, Union, cast, overload, ) from t...
Apply edits to the provided dataframe (inplace). This includes cell edits, row additions and row deletions. Parameters ---------- df : pd.DataFrame The dataframe to apply the edits to. data_editor_state : EditingState The editing state of the data editor component. dataframe_schema: DataframeSchema The schema of the da...
178,402
from __future__ import annotations import json from dataclasses import dataclass from decimal import Decimal from typing import ( TYPE_CHECKING, Any, Dict, Final, Iterable, List, Literal, Mapping, Set, Tuple, TypedDict, TypeVar, Union, cast, overload, ) from t...
Check if the index is supported by the data editor component. Parameters ---------- df_index : pd.Index The index to check. Returns ------- bool True if the index is supported, False otherwise.
178,403
from __future__ import annotations import json from dataclasses import dataclass from decimal import Decimal from typing import ( TYPE_CHECKING, Any, Dict, Final, Iterable, List, Literal, Mapping, Set, Tuple, TypedDict, TypeVar, Union, cast, overload, ) from t...
Fix the column headers of the provided dataframe inplace to work correctly for data editing.
178,404
from __future__ import annotations import json from dataclasses import dataclass from decimal import Decimal from typing import ( TYPE_CHECKING, Any, Dict, Final, Iterable, List, Literal, Mapping, Set, Tuple, TypedDict, TypeVar, Union, cast, overload, ) from t...
Check if the column names in the provided dataframe are valid. It's not allowed to have duplicate column names or column names that are named ``_index``. If the column names are not valid, a ``StreamlitAPIException`` is raised.
178,405
from __future__ import annotations import json from dataclasses import dataclass from decimal import Decimal from typing import ( TYPE_CHECKING, Any, Dict, Final, Iterable, List, Literal, Mapping, Set, Tuple, TypedDict, TypeVar, Union, cast, overload, ) from t...
Check column type to data type compatibility. Iterates the index and all columns of the dataframe to check if the configured column types are compatible with the underlying data types. Parameters ---------- data_df : pd.DataFrame The dataframe to check the type compatibilities for. columns_config : ColumnConfigMapping ...
178,406
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, List, Literal, Sequence, Union, cast, overload from typing_extensions import TypeAlias from streamlit import config from streamlit.elements.form import current_form_id from streamlit.elemen...
null
178,407
from __future__ import annotations import io import os from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, BinaryIO, Final, Literal, TextIO, Union, cast from typing_extensions import TypeAlias from streamlit import runtime, source_util from streamlit.elements.form import curr...
null
178,408
from __future__ import annotations import re from dataclasses import dataclass from datetime import date, datetime, time, timedelta from textwrap import dedent from typing import ( TYPE_CHECKING, Any, Final, Literal, Sequence, Tuple, Union, cast, overload, ) from typing_extensions im...
null
178,409
from __future__ import annotations import re from dataclasses import dataclass from datetime import date, datetime, time, timedelta from textwrap import dedent from typing import ( TYPE_CHECKING, Any, Final, Literal, Sequence, Tuple, Union, cast, overload, ) from typing_extensions im...
null
178,410
from __future__ import annotations import re from dataclasses import dataclass from datetime import date, datetime, time, timedelta from textwrap import dedent from typing import ( TYPE_CHECKING, Any, Final, Literal, Sequence, Tuple, Union, cast, overload, ) from typing_extensions im...
null
178,411
from __future__ import annotations from dataclasses import dataclass from datetime import date, datetime, time, timedelta, timezone, tzinfo from numbers import Integral, Real from textwrap import dedent from typing import TYPE_CHECKING, Any, Final, Sequence, Tuple, TypeVar, Union, cast from typing_extensions import Typ...
null
178,412
from __future__ import annotations from dataclasses import dataclass from datetime import date, datetime, time, timedelta, timezone, tzinfo from numbers import Integral, Real from textwrap import dedent from typing import TYPE_CHECKING, Any, Final, Sequence, Tuple, TypeVar, Union, cast from typing_extensions import Typ...
null
178,413
from __future__ import annotations from dataclasses import dataclass from datetime import date, datetime, time, timedelta, timezone, tzinfo from numbers import Integral, Real from textwrap import dedent from typing import TYPE_CHECKING, Any, Final, Sequence, Tuple, TypeVar, Union, cast from typing_extensions import Typ...
null
178,414
from __future__ import annotations from dataclasses import dataclass from datetime import date, datetime, time, timedelta, timezone, tzinfo from numbers import Integral, Real from textwrap import dedent from typing import TYPE_CHECKING, Any, Final, Sequence, Tuple, TypeVar, Union, cast from typing_extensions import Typ...
Restore times/datetimes to original timezone (dates are always naive)
178,415
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, Tuple, cast from typing_extensions import TypeGuard from streamlit.elements.form import current_form_id from streamlit.elements.utils import ( check_ca...
null
178,416
from __future__ import annotations import ast import contextlib import inspect import re import types from typing import TYPE_CHECKING, Any, Final, cast import streamlit from streamlit.proto.DocString_pb2 import DocString as DocStringProto from streamlit.proto.DocString_pb2 import Member as MemberProto from streamlit.r...
Construct a DocString object. See DeltaGenerator.help for docs.
178,417
from __future__ import annotations from contextlib import nullcontext from datetime import date from enum import Enum from typing import TYPE_CHECKING, Any, Collection, Literal, Sequence, cast import streamlit.elements.arrow_vega_lite as arrow_vega_lite from streamlit import type_util from streamlit.color_util import (...
Function to use the chart's type, data columns and indices to figure out the chart's spec.
178,418
from __future__ import annotations from contextlib import nullcontext from datetime import date from enum import Enum from typing import TYPE_CHECKING, Any, Collection, Literal, Sequence, cast import streamlit.elements.arrow_vega_lite as arrow_vega_lite from streamlit import type_util from streamlit.color_util import (...
Marshall chart's data into proto.
178,419
from __future__ import annotations import io from typing import TYPE_CHECKING, Any, cast import streamlit.elements.image as image_utils from streamlit import config from streamlit.errors import StreamlitDeprecationWarning from streamlit.proto.Image_pb2 import ImageList as ImageListProto from streamlit.runtime.metrics_u...
null
178,420
from __future__ import annotations import json import urllib.parse from typing import TYPE_CHECKING, Any, Dict, List, Literal, Union, cast from typing_extensions import TypeAlias from streamlit import type_util from streamlit.elements.lib.streamlit_plotly_theme import ( configure_streamlit_plotly_theme, ) from stre...
Marshall a proto with a Plotly spec. See DeltaGenerator.plotly_chart for docs.
178,421
from __future__ import annotations import textwrap from typing import TYPE_CHECKING, Literal, NamedTuple, cast from streamlit import runtime from streamlit.errors import StreamlitAPIException from streamlit.proto import Block_pb2 from streamlit.runtime.metrics_util import gather_metrics from streamlit.runtime.scriptrun...
null
178,422
from __future__ import annotations from typing import TYPE_CHECKING, cast from streamlit.errors import StreamlitAPIException from streamlit.proto.Toast_pb2 import Toast as ToastProto from streamlit.runtime.metrics_util import gather_metrics from streamlit.string_util import clean_text, validate_emoji from streamlit.typ...
null
178,423
from __future__ import annotations from typing import TYPE_CHECKING, cast from streamlit.proto.IFrame_pb2 import IFrame as IFrameProto from streamlit.runtime.metrics_util import gather_metrics The provided code snippet includes necessary dependencies for implementing the `marshall` function. Write a Python function `d...
Marshalls data into an IFrame proto. These parameters correspond directly to <iframe> attributes, which are described in more detail at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe. Parameters ---------- proto : IFrame protobuf The protobuf object to marshall data into. src : str The URL of the page...
178,424
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Literal, Union, cast from typing_extensions import TypeAlias from streamlit.elements.utils import get_label_visibility_proto_value from streamlit.errors import StreamlitAPIException from st...
null
178,425
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Literal, Union, cast from typing_extensions import TypeAlias from streamlit.elements.utils import get_label_visibility_proto_value from streamlit.errors import StreamlitAPIException from st...
null
178,426
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Literal, Union, cast from typing_extensions import TypeAlias from streamlit.elements.utils import get_label_visibility_proto_value from streamlit.errors import StreamlitAPIException from st...
null
178,427
from __future__ import annotations from dataclasses import dataclass from textwrap import dedent from typing import TYPE_CHECKING, Literal, Union, cast from typing_extensions import TypeAlias from streamlit.elements.utils import get_label_visibility_proto_value from streamlit.errors import StreamlitAPIException from st...
null
178,428
from __future__ import annotations import hashlib from typing import TYPE_CHECKING, Union, cast from typing_extensions import TypeAlias from streamlit import type_util from streamlit.errors import StreamlitAPIException from streamlit.proto.GraphVizChart_pb2 import GraphVizChart as GraphVizChartProto from streamlit.runt...
Construct a GraphViz chart object. See DeltaGenerator.graphviz_chart for docs.
178,429
from __future__ import annotations import hashlib import json from typing import TYPE_CHECKING, Any, Final, Mapping, cast from streamlit import config from streamlit.proto.DeckGlJsonChart_pb2 import DeckGlJsonChart as PydeckProto from streamlit.runtime.metrics_util import gather_metrics from streamlit.util import HASHL...
null