time_split.app#
Supporting functions for the Streamlit companion app.
Run pip install time-split[app] to install the rsundqvist/time-split-app, or run
pip install time-split-app==<version> to install the application directly.
Warning
The application API may change without a major version bump.
Once installed, the application will be available under the time_split_app namespace. Key parts of the API of the
application are documented in the reexport submodule.
Getting started#
To start the application directly from the command line, run
python -m time_split app start
in the terminal. To customize the application, run
python -m time_split app new
in the terminal, then modify the Dockerfile and my_extensions.py files to suit your needs.
Functions
|
Create an application URL. |
- create_explorer_link(host: str, data: Iterable[str | Timestamp | datetime | date | datetime64] | str | bytes | None = None, available: Iterable[str | Timestamp | datetime | date | datetime64] | str | bytes | None = None, *, show_removed: bool = True, skip_default: bool = False, **kwargs: Unpack[DatetimeIndexSplitterKwargs]) str[source]#
Create an application URL.
- Parameters:
host – Base address where the application is hosted.
data – Binds schedule to a range. Regular available arguments (as passed to e.g.
time_split.split()) are encoded as a date range to generate dummy data for. Pass astrto use a bundled dataset, orbytesto use a custom loader. Note that this will disable verification of the **kwargs.available – Alias of data.
skip_default – If
True, do not include default split params in the link.show_removed – If
True, splits removed by n_splits or step are included in the figure.kwargs – Keyword arguments for the
time_split.split()-function.
- Returns:
An encoded URL.
Examples
Getting the URL for a local host.
>>> create_explorer_link( ... host="http://localhost:8501", ... available=("2019-04-11 00:35:00", "2019-05-11 21:30:00"), ... schedule="0 0 * * MON,FRI", ... ) 'http://localhost:8501?data=1554942900-1557610200&schedule=0+0+%2A+%2A+MON%2CFRI&show_removed=True'
To start the application using locally using
Docker, run
docker run -p 8501:8501 rsundqvist/time-split
in the terminal.
Modules
Reexported members of the |