YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
- π PakEco AI
- Pakistan Environmental Pollution Monitoring & City Comparison
- Architecture
- Features
- Data sources
- Important limitation
- 1. Run locally
- 2. Add Gemini API key
- 3. Run Gradio frontend
- 4. Run Streamlit dashboard
- 5. GitHub deployment
- 6. Streamlit deployment
- 7. Gradio deployment options
- Hackathon submission
- Responsible AI
- Attribution
- Pakistan Environmental Pollution Monitoring & City Comparison
π PakEco AI
Pakistan Environmental Pollution Monitoring & City Comparison
PakEco AI is a hackathon-ready environmental application with two frontends and a shared Python backend:
- Gradio frontend β
gradio_app.py - Streamlit dashboard β
streamlit_app.py - Shared backend β
backend.py - Gemini AI assistant
- Open-Meteo air-quality + weather APIs
Gradio is used as the interactive AI/demo frontend, while Streamlit provides the richer dashboard experience.
Architecture
βββββββββββββββββββββββ
β User / Browser β
ββββββββββββ¬βββββββββββ
β
ββββββββββββ΄βββββββββββ
β β
Gradio Frontend Streamlit Dashboard
gradio_app.py streamlit_app.py
β β
ββββββββββββ¬βββββββββββ
β
backend.py
β
ββββββββββββββββΌβββββββββββββββ
β β β
Open-Meteo Open-Meteo Gemini API
Air Quality Weather AI
Features
- Pakistani city selector
- US AQI and European AQI
- PM2.5 and PM10
- Temperature, humidity and wind
- Hourly particulate-matter charts
- Multi-city comparison
- AQI ranking chart
- Gemini Environmental Assistant
- Shared backend for both UIs
- Graceful API/AI errors
- No Open-Meteo API key required for the standard MVP request
Data sources
Open-Meteo Air Quality API: https://open-meteo.com/en/docs/air-quality-api
Open-Meteo Weather API: https://open-meteo.com/en/docs
Gemini API: https://ai.google.dev/gemini-api/docs
The air-quality API documents PM2.5, PM10, European AQI and US AQI variables and explains that the forecast is based on CAMS atmospheric-composition forecast data.
Important limitation
The pollution values are model-based and tied to selected coordinates. They should not be described as official ground-monitoring station measurements.
1. Run locally
Python 3.10+ is recommended because current Gradio documentation requires Python 3.10 or higher.
python -m venv .venv
Windows:
.venv\Scripts\activate
macOS/Linux:
source .venv/bin/activate
Install:
pip install -r requirements.txt
2. Add Gemini API key
Get a key from Google AI Studio.
Windows PowerShell:
$env:GEMINI_API_KEY="YOUR_KEY"
macOS/Linux:
export GEMINI_API_KEY="YOUR_KEY"
Never upload the key to GitHub.
3. Run Gradio frontend
python gradio_app.py
Gradio normally opens a local web interface.
4. Run Streamlit dashboard
Open another terminal in the same folder:
streamlit run streamlit_app.py
5. GitHub deployment
Upload these files:
PakEco-AI/
βββ backend.py
βββ gradio_app.py
βββ streamlit_app.py
βββ requirements.txt
βββ README.md
βββ PRD.md
βββ DEMO_SCRIPT.md
βββ .gitignore
βββ .env.example
βββ project.json
βββ data/
βββ sample_data.csv
Do NOT upload .env, API keys, or secrets.toml.
6. Streamlit deployment
- Create a GitHub repository.
- Upload the project.
- Open Streamlit Community Cloud.
- Choose your repository.
- Set the main file to
streamlit_app.py. - Deploy.
- Open Settings β Secrets.
- Add:
GEMINI_API_KEY = "YOUR_REAL_KEY"
- Save and reboot the app.
7. Gradio deployment options
For the Gradio frontend, the easiest portfolio/hackathon hosting route is a Hugging Face Space using the Gradio SDK.
Upload:
backend.py
gradio_app.py
requirements.txt
README.md
If the platform expects app.py, either rename gradio_app.py to app.py or configure the entry point according to the host's current instructions.
Add GEMINI_API_KEY as a secret/environment variable in the hosting platform.
Hackathon submission
Recommended submission package:
- Project name: PakEco AI
- GitHub URL
- Streamlit demo URL
- Gradio demo URL
- PRD
- 2β3 minute demo video
- Presentation
- Technology list
- Data-source/AI limitations
Responsible AI
PakEco AI:
- identifies its data sources;
- distinguishes model data from station observations;
- does not intentionally generate pollution measurements;
- avoids medical diagnosis;
- explains uncertainty;
- keeps API keys outside source control.
Attribution
Follow the current Open-Meteo attribution requirements when publishing the application or redistributing its data. See the Open-Meteo documentation for current CAMS/Open-Meteo acknowledgement language.