You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Generate self-contained HTML dashboard (no additional deps needed)
python dashboard/html_dashboard.py
# Launch Plotly Dash app (requires: pip install dash plotly)
python cli.py dashboard --port 8050
# OR
python dashboard/app.py
Library API
fromecotrackimportDatabase, EcoScraper, Analytics# Connect (creates DB if not exists)db=Database("myproject.db")
# Scrape all sourcesscraper=EcoScraper(db)
results=scraper.scrape_all(years=range(2015, 2024))
# Query — returns pandas DataFramesleaderboard=db.get_recycling_leaderboard(year=2023)
trends=db.get_waste_trend("DEU")
materials=db.get_material_breakdown(year=2023)
countries=db.get_countries()
# Run arbitrary SQL (DuckDB-style)df=db.query_df(""" SELECT country_code, year, ROUND(AVG(overall_rate) OVER (PARTITION BY country_code), 2) as rolling_avg FROM recycling_rates ORDER BY country_code, year""")
# Analyticsana=Analytics(db)
scores=ana.recycling_efficiency_score(2023)
improvers=ana.top_improvers(n=10)
circular=ana.circular_economy_index(2023)
mat_comp=ana.material_composition_global(2023)
db.close()
Dashboard Features
Tab
Visualisations
Overview
KPI cards, region radar, country donut, material generation bar, top improvers table
Leaderboard
Year-selector, sortable table with medals, horizontal bar chart
Country Trends
Dual-panel: waste time series + recycling rate lines
Materials
Per-material recycling rates by country + fate donut
Heatmap
Country × material colour-coded rate grid
Analytics
Efficiency scores, GDP vs waste scatter, global trend bands
Data Model
country_profiles — 30 countries, region, population, GDP
waste_metrics — annual kg/capita, MSW, industrial, e-waste, food waste
recycling_rates — overall + per-material rates (plastic/paper/glass/metal/organic/e-waste)
material_flows — generated/recycled/landfilled/incinerated/composted by material
data_sources — provenance tracking
scrape_log — audit trail of all scrape runs
About
Sustainability Monitoring and Analysis for Public Data