{"id":6896,"library":"stqdm","title":"stqdm","description":"stqdm provides an easy-to-use progress bar for Streamlit applications, integrating the functionality of the popular `tqdm` library with Streamlit's `st.progress`. The current version is 0.0.5, released in January 2023, and the library is actively maintained for compatibility with newer Python, Streamlit, and tqdm versions, though with an irregular release cadence.","status":"active","version":"0.0.5","language":"en","source_language":"en","source_url":"https://github.com/Wirg/stqdm","tags":["streamlit","progress-bar","tqdm","ui"],"install":[{"cmd":"pip install stqdm","lang":"bash","label":"Install stqdm"}],"dependencies":[{"reason":"Core dependency for Streamlit integration.","package":"streamlit","optional":false},{"reason":"Core dependency for tqdm functionality and API.","package":"tqdm","optional":false}],"imports":[{"note":"While stqdm inherits from tqdm, directly importing tqdm.tqdm will not provide Streamlit integration.","wrong":"from tqdm import tqdm","symbol":"stqdm","correct":"from stqdm import stqdm"},{"note":"Enables progress bars for pandas DataFrame and Series operations, similar to tqdm.pandas().","symbol":"stqdm.pandas","correct":"from stqdm import stqdm\nstqdm.pandas()"}],"quickstart":{"code":"import streamlit as st\nimport time\nfrom stqdm import stqdm\n\nst.title('stqdm Demo')\n\nif st.button('Start Progress Bar'):\n    for i in stqdm(range(50), desc=\"Processing items\"):\n        time.sleep(0.1)\n    st.success(\"Processing complete!\")\n\nif st.button('Start Progress Bar in Sidebar'):\n    with st.sidebar:\n        for i in stqdm(range(20), desc=\"Sidebar progress\"):\n            time.sleep(0.2)\n        st.success(\"Sidebar processing complete!\")","lang":"python","description":"This example demonstrates how to use `stqdm` for a loop in the main Streamlit area and within the sidebar. Run this with `streamlit run your_script.py`."},"warnings":[{"fix":"As a workaround, you can explicitly set a lock for stqdm, especially when using `stqdm.pandas()`. Add `from threading import RLock; stqdm.set_lock(RLock())` at the top of your script. This helps prevent the app from entering an infinite loop.","message":"Stopping a Streamlit app (e.g., via the 'Stop' button in the UI) while an `stqdm` loop is active can cause the app to freeze or the progress bar to become unresponsive on subsequent reruns. A full console restart is often required to recover.","severity":"gotcha","affected_versions":"All versions, particularly when using `progress_apply` with `stqdm.pandas()`"},{"fix":"Update to `stqdm` version 0.0.5 or newer, which properly provides time updates even for iterators without a length.","message":"In versions prior to 0.0.5, `stqdm` had issues with iterators that did not provide a predefined length or total, such as generators. The progress bar might not display correctly or update as expected.","severity":"deprecated","affected_versions":"<0.0.5"},{"fix":"Monitor GitHub issues for official fixes. Consider refactoring to use a single `stqdm` instance where possible, or explore alternative Streamlit native progress handling if encountering this specific issue until a resolution is provided.","message":"Using multiple `stqdm` instances in an application, particularly across reruns, might lead to issues where Streamlit fails to reload. This has been reported as an issue related to a `last_print_t` attribute.","severity":"gotcha","affected_versions":"0.0.5 (as reported in April 2024), possibly earlier versions."},{"fix":"Ensure that `stqdm` updates happen within the main Streamlit script context. If using background threads, you might need to manually manage `streamlit.scriptrunner.add_script_run_ctx` or similar context propagation, or consider alternative methods for updating the Streamlit UI from threads.","message":"There are reported limitations and 'weird interactions' when using `stqdm` in conjunction with multithreading within a Streamlit application. Direct `tqdm` (and by extension `stqdm`) updates from non-Streamlit threads might not propagate correctly.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}