streamlit-autorefresh
Simple way to autorefresh your Streamlit apps
What it is and what it does
Streamlit Autorefresh is a custom Streamlit component that places a timer in the browser frontend to periodically trigger app reruns on a fixed interval. Instead of using an infinite loop in your script (which blocks the server and complicates shutdown), you call st_autorefresh() once with an interval in milliseconds and an optional refresh limit, and the browser handles the timing. The function returns a counter tracking how many times the refresh has fired, letting you conditionally execute different logic at different refresh counts.
The component is designed for dashboards and real-time stats applications where you want regular updates without tying up server resources. You can optionally debounce refreshes when users interact with the app, and you should use a unique key to maintain state across reruns. The trade-off is that it shifts timing work to the browser and relies on frontend timers, which are not perfectly precise.
Use it for:
- Building a live dashboard that updates metrics or stats at regular intervals without blocking the Streamlit server.
- Displaying real-time data feeds or sensor readings at regular intervals in a web app.
- Creating a monitoring application that polls for status changes without an infinite loop in the script.
- Refreshing a Streamlit app at a fixed cadence while allowing users to interact with controls between refreshes.
- Limiting the total number of refreshes to prevent unbounded resource consumption in long-running apps.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds a frontend timer to Streamlit apps that triggers periodic script reruns without blocking the server or requiring an infinite loop.
No—the package is abandoned (last release 2023-06-25, no commits since). While it has low install friction and no known vulnerabilities, the lack of maintenance means it may break with future Streamlit versions, and the unclear license creates legal ambiguity. For new projects, consider native Streamlit refresh patterns or actively maintained alternatives.
Install
streamlit-autorefresh on PyPI
pip
pip install streamlit-autorefreshuv
uv add streamlit-autorefreshpoetry
poetry add streamlit-autorefreshInstalling streamlit-autorefresh
Before you install
Low friction install with a single runtime dependency on streamlit. However, the package is abandoned—last release was 2023-06-25 with no commits since. No active maintenance or updates.
License in practice
License status is unclear; the package declares no SPDX license identifier. Before relying on this package in production or proprietary work, verify the actual license terms in the repository.
Quickstart
pip install streamlit-autorefresh
import streamlit as st
from streamlit_autorefresh import st_autorefresh
count = st_autorefresh(interval=2000, limit=100, key="mykey")
st.write(f"Refresh count: {count}")
Requires streamlit to be installed and running; the component runs on the frontend and relies on browser timers, which are not perfectly precise.
Verify before relying
- Whether the package works reliably with current Streamlit versions post-2023-06-25.
- Actual license terms, since the package declares no SPDX identifier.
- Whether the frontend timer remains accurate under heavy server load or network latency.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — streamlit |
| Maintenance | abandoned — 1,146 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 764,368/month — #5,123 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: streamlit_autorefresh-1.0.1-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
st-themeDetects and returns the active theme (light or…
permissive · top 15,000 on PyPI
streamlit-js-evalStreamlit-js-eval lets you run arbitrary…
unclear · top 15,000 on PyPI
streamlit-sortablesStreamlit Sortables adds drag-and-drop sortable…
permissive · top 15,000 on PyPI
streamlit-keyupAdds real-time text input to Streamlit apps…
unclear · top 15,000 on PyPI
streamlit-notifyStreamlit-Notify provides persistent status…
permissive · top 15,000 on PyPI
streamlit-plotly-eventsCaptures click, select, and hover events from…
unclear · top 15,000 on PyPI
extra-streamlit-componentsProvides additional UI components for Streamlit…
permissive · top 15,000 on PyPI
streamlit-pdfAdds a PDF viewer component to Streamlit apps…
permissive · top 15,000 on PyPI
streamlit-camera-input-liveProvides a Streamlit component that captures…
unclear · top 15,000 on PyPI
reprintBinds Python variables to multi-line terminal…
permissive · top 15,000 on PyPI