This Streamlit-based dashboard provides comprehensive analytics and insights into California's cannabis retail market. The application combines dispensary data with social media sentiment analysis to offer a multi-faceted view of the market landscape.
- Key market metrics and trends
- Overall market health indicators
- Quick navigation to detailed analysis sections
- Year-over-year market growth analysis
- Regional distribution of dispensaries
- License type breakdown by county
- Interactive filters for custom analysis
- Interactive choropleth map of California counties
- Population-adjusted retailer density metrics
- Regional market concentration analysis
- County-level license distribution
- Social media sentiment analysis by region
- Temporal sentiment trends
- Correlation between market density and public sentiment
- County-level sentiment distribution
The dashboard utilizes three main data sources:
Dispensaries.csv
: Contains detailed information about cannabis retailersTweet_Sentiment.csv
: Social media sentiment data related to cannabisCalifornia_County_Boundaries.geojson
: Geographic boundaries for visualization
- Python: >= 3.10
- Key Dependencies:
- Streamlit: Web application framework
- Pandas: Data manipulation and analysis
- Plotly: Interactive visualizations
- Transformers: Sentiment analysis models
- Clone the repository:
git clone https://github.com/your-username/california-cannabis-analytics.git
cd california-cannabis-analytics
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies using Poetry:
poetry install
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
- Run the application:
streamlit run app/Home.py
├── app/
│ ├── Home.py # Main dashboard entry point
│ ├── pages/ # Dashboard pages
│ ├── plots/ # Visualization components
│ ├── utils/ # Utility functions
│ └── style.css # Custom styling
├── data/ # Data files
├── config/ # Configuration files
└── public/ # Static assets
The project uses Poetry for dependency management and includes development tools:
- Black: Code formatting
- isort: Import sorting
- flake8: Code linting
- pytest: Testing
Run tests:
poetry run pytest
Format code:
poetry run black .
poetry run isort .
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request