A Streamlit-based web app for exploring and forecasting CO₂ emissions per capita.
- Case Studies: Historical trends for Wyoming (WY), North Dakota (ND), and Alaska (AK).
- Prediction: Interactive forecasting based on coal & natural gas production, per capita income, urbanization, and renewable energy usage.
- HASS Reflection: Social and ethical analysis on environmental justice and responsibility.
LAST_DTP/
├── app.py
├── case_service.py # Load & filter merged data for case studies
├── data_service.py # Fit & apply state-specific regression models
├── assets/
│ ├── All main data (1998 to 2023).xlsx # Input data for charts & models
├── pages/ # Streamlit multipage directory
│ ├── 02_case_studies.py # Case studies page
│ ├── 03_prediction.py # Prediction interface
│ └── 04_hass_reflection.py # Qualitative reflection page
├── tests/
│ ├── test_data_service.py
│ └── test_case_service.py
├── requirements.txt
├── README.md
└── .gitignoregit clone https://github.com/Kopi-O-Kosong-Beng/DTP-MU-Project/tree/main
cd LAST_DTP# Install virtualenv (to your user site)
pip3 install --user virtualenv
# Create the env
~/.local/bin/virtualenv .venv
# Activate it
source .venv/bin/activatepip install --upgrade pip
pip install -r requirements.txtstreamlit run app.pyOpen your browser at the URL printed (usually http://localhost:8501).
Run unit tests with pytest:
pytest- Home: Intro & navigation.
- Case Studies: View historical CO₂ trends for WY, ND, AK.
- Prediction: Input your parameters and click Run Prediction.
- HASS Reflection: Explore environmental justice themes.
- Suitable for platforms supporting Python & Streamlit (Heroku, Streamlit Cloud, Azure).
- Ensure
assets/and.env(if any secrets) are included in deployment.
Contributions and improvements are welcome:
- Fork the repo
- Create a feature branch (
git checkout -b feature-name) - Commit your changes (
git commit -m "Add new feature") - Push to branch (
git push origin feature-name) - Open a Pull Request