A modular Business Intelligence (BI) and Decision Support System developed in Python as part of my Software Engineering Internship at KivaCRM.
The system analyzes synthetic CRM sales data, validates data quality and referential integrity, calculates key business performance indicators (KPIs), performs customer segment analysis, generates revenue forecasts, produces automated business recommendations, and provides bilingual HTML and Streamlit reporting in English and Turkish.
The core pipeline runs locally and requires no paid APIs. An optional Streamlit interface can also be deployed as a public demo.
- Synthetic CRM dataset generator
- Automated data validation
- Dataset health report
- CSV-based data pipeline
- Duplicate and missing-value detection
- Invalid data validation (dates, quantities, statuses, revenue)
Automatically calculates business metrics including:
- Total Revenue
- Average Order Value
- Month-over-Month (MoM) Revenue Growth
- Win Rate
- Churned-Order Rate
- Product Performance
- Regional Performance
- Sales Performance
- Revenue Trend Analysis
Compares customer segments using:
- Total Revenue
- Share of Selected Revenue
- Revenue per Active Customer
- Average Order Value
- Win Rate
- Churned-Order Rate
- Active Customers
- Best Performing Product
Forecasts the next three months using Linear Regression (NumPy Polyfit).
The forecast includes:
- Historical monthly revenue
- Trend line
- Forecast values
- Monthly slope
- RΒ² (coefficient of determination)
- Forecast reliability classification
- Forecast assumptions
A rule-based decision support engine automatically evaluates KPI results and generates business recommendations.
The engine identifies situations such as:
- Revenue decline
- High churned-order status
- Sales performance
- Regional performance
- Product concentration
- Business trend
Each insight contains:
- Severity level
- Business explanation
- Recommended action
The system automatically generates:
- Interactive bilingual HTML Dashboard
- Interactive bilingual Streamlit Dashboard
- Fully bilingual Excel KPI workbook
- Bilingual Decision Support insights
- Console Summary
The HTML dashboard, Streamlit dashboard, charts, and decision-support insights are available in:
- π¬π§ English
- πΉπ· Turkish
The Excel workbook is bilingual as well: fixed analytical sheet names, titles, headers, metric labels, forecast metadata, and forecast assumptions are rendered as English / Turkish labels, while the insights sheet keeps separate English and Turkish insight records.
All user-facing translations are loaded from:
locales/en.json
locales/tr.json
The loader rejects duplicate JSON keys and verifies English/Turkish key parity at startup.
The included data is synthetic. Local Streamlit development is loopback-only and keeps CORS/XSRF protections enabled. Real CRM data must be deployed behind a proper authentication/authorization layer rather than a simple password inside the Streamlit script.
See SECURITY.md and deploy/README.md for the local and hosted deployment profiles.
- Python
- Pandas
- NumPy
- Matplotlib
- Plotly
- OpenPyXL
- HTML
- CSS
Python-BI-Reporting-System/
β
βββ data/
β βββ customers.csv
β βββ orders.csv
β βββ generate_data.py
β
βββ modules/
β βββ __init__.py
β βββ decision_support.py
β βββ domain.py
β βββ excel_exporter.py
β βββ forecast.py
β βββ i18n.py
β βββ kpi_engine.py
β βββ report_generator.py
β βββ segment_analysis.py
β βββ theme.py
β βββ visualizer.py
β
βββ tests/
βββ reports/
βββ screenshots/
βββ .streamlit/
β βββ config.toml
β
βββ dashboard.py
βββ data_analysis.py
βββ main.py
βββ requirements.txt
βββ README.md
Clone the repository:
git clone https://github.com/salfayoumi/python-bi-reporting-system.gitInstall the required packages:
pip install -r requirements.txt(Optional) Regenerate the synthetic CRM dataset:
python data/generate_data.pyRun the complete pipeline:
python main.pyRun the interactive Streamlit dashboard:
streamlit run dashboard.pyRun automated tests:
python -m pytestThe application executes the following pipeline:
Load CRM Data
β
βΌ
Validate Dataset
β
βΌ
Compute KPIs
β
βΌ
Customer Segment Analysis
β
βΌ
Revenue Forecasting
β
βΌ
Generate Charts
β
βΌ
Evaluate Decision-Support Rules Once
β
ββββΊ Localize English Insights
ββββΊ Localize Turkish Insights
β
βΌ
Generate HTML Dashboard
β
βΌ
Generate Excel Report
Running the project automatically creates:
reports/
β
βββ dashboard_<analysis-scope>.html
βββ kpi_report_<analysis-scope>.xlsx
βββ charts/
The HTML dashboard contains:
- Executive KPI Overview
- Monthly Revenue Analysis
- Regional Performance
- Product Performance
- Customer Segment Analysis
- Revenue Forecast
- Decision Support Insights
The repository is a demo/portfolio BI system built around synthetic CRM data.
- No real customer or confidential CRM data is included.
- The public Streamlit demo does not implement application authentication because the exposed dataset is synthetic.
- Streamlit CORS/XSRF protections are not disabled.
- Dynamic values inserted into custom HTML are escaped.
.streamlit/secrets.tomlis excluded from Git.- Missing or invalid data files are converted into user-facing errors rather than exposing raw tracebacks.
If this project is connected to real CRM data, it should be placed behind a proper authentication/access-control layer (for example an authenticated reverse proxy or organization platform) rather than relying on a simple password inside the Streamlit script.
Possible future extensions include:
- Database integration
- REST API
- Authenticated production deployment for real CRM data
- PDF report generation
- More advanced forecasting models
- CI checks for tests, translation parity, formatting, and linting
- Real-time CRM integration
This project was developed during my Software Engineering Internship at KivaCRM.
The original internship roadmap is available in:
Internship_Build_Plan.md
The final implementation extends the original roadmap with several additional features, including:
- Customer Segment Analysis
- Revenue Forecasting
- Excel Report Export
- Bilingual Reporting (English & Turkish)
- Data Validation Module
- Enhanced Dashboard Design
- Interactive Plotly Visualizations
Salsabeel Alfayoumi
Computer Engineer
Software Engineering β’ Python β’ Data Analysis β’ Business Intelligence β’ Decision Support Systems
pip install -r requirements.txt
python -m pytestMetric note:
churned_order_rate_pctis the percentage of order records labelledChurned. It is not a customer-level subscription churn metric.





