streamlit

Build interactive data dashboards and web apps with Streamlit in Python.

1|Updated Dec 6, 2024
One-click install
npx skills add https://github.com/freightCognition/streamlit-network --skill streamlit-freightcognition
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: streamlit
Source: https://github.com/freightCognition/streamlit-network/tree/main/.claude/skills/streamlit
Command: npx skills add https://github.com/freightCognition/streamlit-network --skill streamlit-freightcognition

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building data dashboards and ML/AI app interfaces in Python often requires frontend expertise and slow development cycles. This Skill provides comprehensive Streamlit guidance so you can create interactive web apps, visualizations, and chat interfaces using only Python. ## Core Features & Use Cases - Interactive Dashboards: Create data apps with widgets, charts, maps (st.map, st.pydeck_chart, st.plotly_chart), and layouts like columns, tabs, and sidebars. - State & Performance Management: Use session state, caching (@st.cache_data, @st.cache_resource), and fragments to build responsive multi-page apps. - Deployment & Testing: Deploy to Streamlit Community Cloud, configure themes and secrets, add OpenID Connect authentication, and test apps with the AppTest framework. - Use Case: Build a freight network dashboard that displays an interactive map of cities and lanes, lets users select a hub city, and highlights connected routes using PyDeck layers. ## Quick Start Ask the AI to create a Streamlit dashboard that loads a CSV file, displays it in a dataframe with sidebar filters, and shows a line chart of the data.

Frequently Asked Questions about streamlit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a map visualization in Streamlit?

Streamlit offers three map approaches: st.map for quick scatterplot maps with lat/lon columns, st.pydeck_chart for multi-layer 3D visualizations like ArcLayer networks, and st.plotly_chart for geographic charts with scatter_geo or scatter_map. Choose based on interactivity and layer needs.

How do I manage state in a Streamlit app?

Use st.session_state to persist data across script reruns, since Streamlit reruns the entire script on every interaction. Initialize keys at the top of your script, and use widget callbacks or the key parameter to sync widget values with session state.

What is the difference between st.cache_data and st.cache_resource?

st.cache_data caches data operations like loaded DataFrames and recomputes when inputs change. st.cache_resource caches expensive resources like ML models or database connections that should persist across reruns without being recreated.

Does Streamlit support user authentication?

Yes, Streamlit supports OpenID Connect authentication through st.login, st.logout, and st.user. Configure your provider credentials in .streamlit/secrets.toml with client_id, client_secret, and server_metadata_url to enable login flows.

How do I test a Streamlit app with pytest?

Use the AppTest framework from streamlit.testing.v1 to simulate your app headlessly. Load the app with AppTest.from_file, run it, then interact with widgets like buttons and inputs programmatically and assert on output values.

Why is my Streamlit app slow with large datasets?

Slow performance usually comes from uncached data loading or full-script reruns. Wrap data loading in @st.cache_data, use @st.fragment for partial reruns of expensive sections, and limit PyDeck charts to avoid WebGL context limits.