A comprehensive analytics dashboard for grocery store data analysis built with Streamlit and Python. This dashboard provides real-time insights into sales patterns, customer behavior, marketing effectiveness, and operational efficiency.
- Daily sales trends and transaction volume
- Product category performance
- Store location comparisons
- Payment method distribution
- Discount impact analysis
- Promotional effectiveness
- Customer segment response
- Holiday performance tracking
- Purchase frequency patterns
- Customer recency analysis
- Churn risk identification
- High-value customer tracking
- Regional product preferences
- Urban vs suburban behavior
- Store location performance
- Payment method variations by region
- Product category margins
- Discount impact on profitability
- Volume vs margin analysis
- Daily profit trends
- Unusual transaction patterns
- Price anomalies
- Quantity outliers
- High-value transaction monitoring
- Python 3.8+
- pip
- Clone the repository
git clone https://github.com/imzeeshaan/grocery-analytics.git
cd grocery-analytics- Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install required packages
pip install streamlit pandas plotly numpy- Generate sample data
python grocery_data_generator.py- Launch the dashboard
streamlit run grocery_analysis_app.py- Fork this repository
- Go to Streamlit Cloud
- Create a new app
- Select your forked repository
- Set the main file path as:
grocery_analysis_app.py - Deploy!
The application uses transaction data with the following schema:
{
'transaction_id': str, # Unique transaction identifier
'transaction_datetime': datetime,# Date and time of transaction
'store_location': str, # Store location (Downtown, Suburb North, etc.)
'customer_id': str, # Unique customer identifier
'product_id': str, # Unique product identifier
'product_name': str, # Product name
'product_category': str, # Product category
'quantity': int, # Number of items purchased
'unit_price': float, # Price per unit
'total_price': float, # Total transaction amount
'payment_method': str, # Payment method used
'loyalty_member': bool, # Customer loyalty status
'discount_applied': float # Discount percentage (0-1)
}- Streamlit - Web application framework
- Plotly - Interactive visualization library
- Pandas - Data manipulation library
- NumPy - Numerical computing library
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/NewAnalysis) - Commit your changes (
git commit -m 'Add new analysis feature') - Push to the branch (
git push origin feature/NewAnalysis) - Open a Pull Request
Project Link: https://github.com/imzeeshaan/grocery-analytics
- Inspired by real-world retail analytics needs
- Streamlit community for excellent documentation and examples
- Contributors who help improve this project