Skip to main content

streamlit-hotfix

A command line tool to provide advanced features (CDN, etc) for streamlit by apply patch to the installed packages.

Get started

pip install streamlit-hotfix
st-hotfix --help

For developer,

cd streamlit-hotfix
poetry install

python -m st_hotfix --help

Note that you have to install this tool in the same environment as streamlit and streamlit components you want to patch. Otherwise, the patch may not work as expected.

Examples

Load streamlit assets from CDN

# dump assets to a folder
st-hotfix cdn dump streamit ./path/to/streamlit-assets

# now you can distribut streamlit-assets with CDN, for example jsDelivr 
# e.g: https://cdn.jsdelivr.net/gh/link89/assets@0.1.0/cdn/streamlit/

# then you can patch streamlit to load assets from CDN
st-hotfix cdn patch streamlit --cdn_url https://cdn.jsdelivr.net/gh/link89/assets@0.1.0/cdn/streamlit/

Now when you run your streamlit app, it will load assets from the CDN.

Note that the CDN tool makes use of the on-the-fly mode of webpack publicPath. Since streamlit 1.36.0, the publicPath of streamlit frontend can be override in runtime by setting window.____WEBPACK_PUBLIC_PATH_OVERRIDE.

If the components are not allow to change the publicPath on-the-fly, you have to patch them first by yourself before using this tool to patch it with CDN URL. For example: https://github.com/mik-laj/streamlit-ketcher/pull/120/files

You can always revert the patch by running

st-hotfix cdn restore streamlit

Metadata

Release files for streamlit-hotfix 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-hotfix 0.1.1
File Size Uploaded
streamlit_hotfix-0.1.1.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-hotfix 0.1.1
File Interpreter ABI Platform
streamlit_hotfix-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.9 kB

Release files / streamlit_hotfix-0.1.1.tar.gz

Download URL streamlit_hotfix-0.1.1.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
64912b79952bbc10204d21f78e198aff30a0f18f3111d1f2f0e17c3239a86e6a
BLAKE2b-256 checksum
How to use checksums
1a63f514e14faeda6b8bdc5f85efaf7c2c432ed90faccecc18f2456c74a8366e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.12 Linux/5.15.153.1-microsoft-standard-WSL2

Release files / streamlit_hotfix-0.1.1-py3-none-any.whl

Download URL streamlit_hotfix-0.1.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f12d8c220d0dbe238b33cddbfc65e3ca71c67c2855e6fdc86cb3f62da56f9631
BLAKE2b-256 checksum
How to use checksums
cc69055712292ebb1e538572b83c3fa4edbc65f0bc0ddddd7d0abed4f4de5a2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.12 Linux/5.15.153.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page