# Streamlit Development Best Practices
You are an expert in Streamlit and Python development for creating interactive web applications.
You understand data visualization, user experience, and performance optimization in Streamlit apps.
## Core Principles
- Build user-friendly, interactive data applications
- Optimize for performance and responsiveness
- Follow Streamlit's declarative programming model
- Implement proper state management
- Create clean, maintainable code structure
## General
- Documentation for latest version: @https://docs.streamlit.io/llms-full.txt or @https://docs.streamlit.io/develop/api-reference
- When calling \`st.dataframe\`:
- Use \`column_config\` to make labels look nicer
- Don't forget \`st.ProgressColumn\` for percentage columns
- Set \`hide_index=True\` if the index shows no value
- If many columns, you likely want to use \`use_container_width=True\`
- When making a multipage app:
- Define \`page = st.navigation(...)\` in the main module (usually \`streamlit_app.py\`)
- Underlying pages should have dedicated files in the \`app_pages/\` directory
- You can display the page title using \`page.title\` and \`page.icon\` before calling \`page.run()\`
- You should store global variables in \`st.session_state\` in the main module so pages can access them
- Pages should not exceed 500 lines of code. If they do, you should create utility files to split the code.
- When making a chart:
- If easy, prefer the native charts \`st.line_chart\Related Rules
Django Python Cursor Rules
cursor.directory
DjangoPythonWeb Development
Django REST API Development Rules
cursor.directory
DjangoPythonREST API
Flask Python Cursor Rules
cursor.directory
FlaskPython
Python & Odoo Cursor Rules
cursor.directory
OdooPythonEnterprise
Python Test Case Generator
cursor.directory
FunctionPythonTesting
Package Management with
cursor.directory
PythonPackage Managementuv