{"library":"streamlit-autorefresh","title":"Streamlit Autorefresh","type":"library","description":"Streamlit Autorefresh is a Python library that provides a simple way to automatically refresh Streamlit applications. It works by implementing a frontend-based timer that periodically pings the Streamlit server, triggering a rerun of the application script. This component helps in building dashboards or real-time applications that need to display regularly updated information without relying on problematic infinite loops in the backend. The current version is 1.0.1, with releases typically tied to bug fixes or minor enhancements.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install streamlit-autorefresh"],"cli":null},"imports":["from streamlit_autorefresh import st_autorefresh"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/kmcgrady/streamlit-autorefresh","docs":null,"changelog":null,"pypi":"https://pypi.org/project/streamlit-autorefresh/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import streamlit as st\nfrom streamlit_autorefresh import st_autorefresh\nimport datetime\n\nst.set_page_config(layout='centered', initial_sidebar_state='auto', page_title='Autorefresh Demo')\n\nst.title(\"Streamlit Autorefresh Demo\")\n\n# Run the autorefresh every 2000 milliseconds (2 seconds) and stop after 100 refreshes\ncount = st_autorefresh(interval=2000, limit=100, key=\"myautocounter\")\n\nif count == 0:\n    st.write(\"Count is zero\")\nelif count % 3 == 0 and count % 5 == 0:\n    st.write(\"FizzBuzz\")\nelif count % 3 == 0:\n    st.write(\"Fizz\")\nelif count % 5 == 0:\n    st.write(\"Buzz\")\nelse:\n    st.write(f\"Current Count: {count}\")\n\nst.write(f\"Last refreshed at: {datetime.datetime.now().strftime('%H:%M:%S')}\")","lang":"python","description":"This example demonstrates how to use `st_autorefresh` to trigger reruns of your Streamlit app at a specified interval (2 seconds) and limit the number of refreshes (100 times). It also shows how to use the returned count to display dynamic content.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"1.0.1","pypi_latest":"1.0.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":15.5,"avg_import_s":1.38,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.6,"mem_mb":24.6,"disk_size":"448.2M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":16.4,"import_time_s":0.63,"mem_mb":19.9,"disk_size":"417M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":2.04,"mem_mb":26.4,"disk_size":"468.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":15.3,"import_time_s":1.1,"mem_mb":21.8,"disk_size":"437M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":2,"mem_mb":26.1,"disk_size":"452.6M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":14.4,"import_time_s":1.28,"mem_mb":21.1,"disk_size":"421M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.95,"mem_mb":26.3,"disk_size":"451.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":14.3,"import_time_s":1.28,"mem_mb":21.8,"disk_size":"420M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.33,"mem_mb":19.7,"disk_size":"433.0M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"streamlit-autorefresh","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":17.3,"import_time_s":0.59,"mem_mb":15,"disk_size":"411M"}]}}