Easy progress bar for streamlit based on the awesome streamlit.progress and tqdm
Project description
stqdm
stqdm is the simplest way to handle a progress bar in streamlit app.
How to install
pip install stqdm
How to use
You can find some examples in examples/
Use stqdm in main
from time import sleep
from stqdm import stqdm
for _ in stqdm(range(50)):
sleep(0.5)
Use stqdm in sidebar
from time import sleep
import streamlit as st
from stqdm import stqdm
for _ in stqdm(range(50), st_container=st.sidebar):
sleep(0.5)
Customize the bar with tqdm parameters
from time import sleep
from stqdm import stqdm
for _ in stqdm(range(50), desc="This is a slow task", mininterval=1):
sleep(0.5)
Display a progress bar during pandas Dataframe & Series operations
STqdm inherits from tqdm, you can call stqdm.pandas() in a similar way. See tqdm docs.
from time import sleep
import pandas as pd
from stqdm import stqdm
stqdm.pandas()
pd.Series(range(50)).progress_map(lambda x: sleep(1))
pd.Dataframe({"a": range(50)}).progress_apply(lambda x: sleep(1), axis=1)
Display the progress bar only in the frontend or the backend
from time import sleep
from stqdm import stqdm
# Default to frontend only
for i in stqdm(range(50), backend=False, frontend=True):
sleep(0.5)
for i in stqdm(range(50), backend=True, frontend=False):
sleep(0.5)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stqdm-0.0.5a0.tar.gz
(7.4 kB
view details)
Built Distribution
stqdm-0.0.5a0-py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file stqdm-0.0.5a0.tar.gz
.
File metadata
- Download URL: stqdm-0.0.5a0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef59d4acbc123130762ae45945d1718f6e902d50d3a584c6a981b27e232607f8 |
|
MD5 | f1ccf35b18334a52fda7020c26047264 |
|
BLAKE2b-256 | b4a848fed293023e82c4819c44ea9c9b15dc6197e6f8f0771d5e1ed1a788a82c |
Provenance
File details
Details for the file stqdm-0.0.5a0-py3-none-any.whl
.
File metadata
- Download URL: stqdm-0.0.5a0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5844f20ee6b8f3e419ed5d4ef568d30ddf65360b0edd42b5e0b2e47d6f219c7 |
|
MD5 | fa5ec36e9289758d497263dd058fad53 |
|
BLAKE2b-256 | 6ff6144f5bb4ad7cd256f43026eca0bc363a69ca220345dfd8ecbae754b6e532 |