🌍 Carbon Footprint Analyzer
A Streamlit web app that estimates your household's carbon emissions from
electricity usage, vehicle travel, and food habits — then uses
a small regression model to project your yearly impact, benchmarks you
against national/global averages, and gives a ranked improvement plan.
✨ Features
- Emission breakdown (pie chart) across electricity / travel / food
- Benchmark comparison vs. Average Indian, Global Average, Paris Agreement target
- AI trend projection: a scikit-learn regression model (trained on synthetic
data generated at runtime) projects your footprint 1–10 years ahead, factoring
in gradual grid decarbonisation
- Eco Score (A–F grade)
- Ranked, personalised improvement tips
- "What-if" simulator — drag sliders to see the impact of behaviour changes
- Downloadable plain-text report
No external dataset download is required. All emission factors are
well-established public constants (see app.py), and the "AI" trend model
trains itself on synthetically generated data each time the app starts
(see model.py).
🗂️ Project Structure
carbon-footprint-analyzer/
├── app.py # Streamlit UI + calculations
├── model.py # Synthetic-data regression model (the "AI" part)
├── requirements.txt # Python dependencies
├── .gitignore
└── README.md
🖥️ Running it locally in VS Code
Yes — this project runs perfectly in VS Code. Steps:
-
Install prerequisites
- Python 3.9+
- VS Code with the official Python extension installed.
-
Open the project folder in VS Code
File → Open Folder… → select carbon-footprint-analyzer.
-
Create a virtual environment (open a VS Code terminal: Ctrl+`)
python -m venv venv
Activate it:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
VS Code will usually prompt "Select this environment" — click yes.
-
Install dependencies
pip install -r requirements.txt
-
Run the app
streamlit run app.py
It opens automatically at http://localhost:8501.
⬆️ Uploading this project to GitHub
Checklist of what a project needs before pushing (all already included here):
README.md, .gitignore, requirements.txt, and cle