Skip to main content

Easy progress bar for streamlit based on the awesome streamlit.progress and tqdm

Project description

stqdm

Tests codecov CodeQL

stqdm is the simplest way to handle a progress bar in streamlit app.

demo gif

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

demo gif

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


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.5a2.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

stqdm-0.0.5a2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file stqdm-0.0.5a2.tar.gz.

File metadata

  • Download URL: stqdm-0.0.5a2.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

Hashes for stqdm-0.0.5a2.tar.gz
Algorithm Hash digest
SHA256 123504514a3dd58aeec3fe5b0bb96f05669ef7fdb816d104e0a67249c4c85c03
MD5 99b6b699e64b00ef1228503b493976e4
BLAKE2b-256 35721695e000bce6deb9a8c02db2acbc2b32e09a4e50d94aa206158cf5cf3e37

See more details on using hashes here.

Provenance

File details

Details for the file stqdm-0.0.5a2-py3-none-any.whl.

File metadata

  • Download URL: stqdm-0.0.5a2-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

Hashes for stqdm-0.0.5a2-py3-none-any.whl
Algorithm Hash digest
SHA256 76c4ac60419ad01777268a4e86d57922a5b2db0d0ab37c005b1b9318ea007768
MD5 26887d2f596f6d8ea130c2f955c151db
BLAKE2b-256 df2a41445e20515e85be72a6fd52b9b83c09a26040db737edeb7fe3896d2ddc8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page