Streamlit Lottie
Integrate Lottie animations inside your Streamlit app!
Install
pip install streamlit-lottie
Usage
- Basic usage
import streamlit as st
from streamlit_lottie import st_lottie
with st.echo():
st_lottie("https://assets5.lottiefiles.com/packages/lf20_V9t630.json")
- Basic usage (with monkey patched
st.lottiefunction)
import streamlit as st
import streamlit_lottie
with st.echo():
st.lottie("https://assets5.lottiefiles.com/packages/lf20_V9t630.json")
- Context manager usage, using
withnotation
import time
import streamlit as st
from streamlit_lottie import st_lottie
with st_lottie("https://assets5.lottiefiles.com/packages/lf20_V9t630.json"):
time.sleep(5)
- Download lottie manually example
import time
import requests
import streamlit as st
from streamlit_lottie import st_lottie
from streamlit_lottie import st_lottie_spinner
def load_lottieurl(url: str):
r = requests.get(url)
if r.status_code != 200:
return None
return r.json()
lottie_url_hello = "https://assets5.lottiefiles.com/packages/lf20_V9t630.json"
lottie_url_download = "https://assets4.lottiefiles.com/private_files/lf30_t26law.json"
lottie_hello = load_lottieurl(lottie_url_hello)
lottie_download = load_lottieurl(lottie_url_download)
st_lottie(lottie_hello, key="hello")
if st.button("Download"):
with st_lottie_spinner(lottie_download, key="download"):
time.sleep(5)
st.balloons()
Development
Install
- JS side
cd frontend
npm install
- Python side
conda create -n streamlit-lottie python=3.7
conda activate streamlit-lottie
pip install -e .
Run
Both webpack dev server and Streamlit need to run for development mode.
- JS side
cd frontend
npm run start
- Python side
streamlit run app.py
References
- Lottie-web (Official)
- react-lottie (chenqingspring)
- lottie-react-web (felippenardi)
- lottie-react (gamote)
- lottie-react (LottieFiles)
- react-lottie-player (mifi)
- lottie-interactivity
Support me
Metadata
Release files for streamlit-lottie 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| streamlit-lottie-0.0.5.tar.gz | 792.6 kB | Without provenance | Details for streamlit-lottie-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| streamlit_lottie-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for streamlit_lottie-0.0.5-py3-none-any.whl |
Total release size: 1.6 MB
Release files / streamlit-lottie-0.0.5.tar.gz
| Download URL | streamlit-lottie-0.0.5.tar.gz |
|---|---|
| Size | 792.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c61589fb92bdf1dd5bd0a2ea75315d92e3383f46059b3704515d096a1e953d79
|
|
BLAKE2b-256 checksum How to use checksums |
4bd4e13ac9bde5b81b308d061092a420008af78c8b08547739423195596452d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Release files / streamlit_lottie-0.0.5-py3-none-any.whl
| Download URL | streamlit_lottie-0.0.5-py3-none-any.whl |
|---|---|
| Size | 802.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98656d6f1cc99c5d96fb8329bafbcdbb65709ad0a05176dffdf4755f6fc04cff
|
|
BLAKE2b-256 checksum How to use checksums |
52b58ad7fa3101ec5baed712107a4cf304f174261f2ed2bebe063ad1fbedfe88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Security for streamlit-lottie 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.