{"id":48364519,"url":"https://github.com/aykutsp/world-infrastructure-data-hub","last_synced_at":"2026-04-05T14:02:05.201Z","repository":{"id":349332714,"uuid":"1201968060","full_name":"aykutsp/world-infrastructure-data-hub","owner":"aykutsp","description":"Interactive world map of fuel prices, electricity, EV charging costs and CO2 emissions — daily-refreshed open data pipeline.","archived":false,"fork":false,"pushed_at":"2026-04-05T12:17:04.000Z","size":0,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-05T12:28:37.530Z","etag":null,"topics":["choropleth","climate-data","co2-emissions","data-visualization","electricity-prices","energy-data","ev-charging","fuel-prices","github-actions","leaflet","open-data","react","sustainability","typescript","vite","world-map"],"latest_commit_sha":null,"homepage":"https://aykutsp.github.io/world-infrastructure-data-hub/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aykutsp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["aykutsp"]}},"created_at":"2026-04-05T12:15:40.000Z","updated_at":"2026-04-05T12:16:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aykutsp/world-infrastructure-data-hub","commit_stats":null,"previous_names":["aykutsp/world-infrastructure-data-hub"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aykutsp/world-infrastructure-data-hub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykutsp%2Fworld-infrastructure-data-hub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykutsp%2Fworld-infrastructure-data-hub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykutsp%2Fworld-infrastructure-data-hub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykutsp%2Fworld-infrastructure-data-hub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aykutsp","download_url":"https://codeload.github.com/aykutsp/world-infrastructure-data-hub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykutsp%2Fworld-infrastructure-data-hub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31437927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T13:13:19.330Z","status":"ssl_error","status_checked_at":"2026-04-05T13:13:17.778Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["choropleth","climate-data","co2-emissions","data-visualization","electricity-prices","energy-data","ev-charging","fuel-prices","github-actions","leaflet","open-data","react","sustainability","typescript","vite","world-map"],"created_at":"2026-04-05T14:02:04.322Z","updated_at":"2026-04-05T14:02:05.192Z","avatar_url":"https://github.com/aykutsp.png","language":"TypeScript","funding_links":["https://github.com/sponsors/aykutsp"],"categories":[],"sub_categories":[],"readme":"# World Infrastructure Data Hub\n\nAn interactive world map for the real cost of *living* and *moving*: **retail fuel prices, household electricity prices, EV charging costs, CO₂ emissions and eight World Bank indicators** — all in one place, all from open government / inter-governmental sources, all refreshed on a daily cron.\n\n🌐 **Live demo:** [aykutsp.github.io/world-infrastructure-data-hub](https://aykutsp.github.io/world-infrastructure-data-hub/)\n\n![Deploy](https://github.com/aykutsp/world-infrastructure-data-hub/actions/workflows/deploy.yml/badge.svg)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n![React](https://img.shields.io/badge/React-19-61dafb.svg)\n![TypeScript](https://img.shields.io/badge/TypeScript-5-3178c6.svg)\n![Vite](https://img.shields.io/badge/Vite-8-646cff.svg)\n\n## 📸 Screenshots\n\n**Explore view — 15 metrics grouped into Cost / Energy / Society**\n\n![Explore — gasoline prices worldwide](docs/screenshots/explore-gasoline.png)\n\n**Grid CO₂ intensity** — new in v1.1, the carbon intensity of each country's electricity mix in gCO₂ per kWh:\n\n![Explore — grid carbon intensity](docs/screenshots/explore-grid-co2.png)\n\n**Compare view** — pick up to 5 countries and stack every metric side-by-side, with the best cell per row highlighted:\n\n![Compare view](docs/screenshots/compare.png)\n\n**Trip calculator** — routing via OSRM, five vehicle/fuel modes, up to 8 waypoints, per-refuel receipt:\n\n![Trip calculator — Istanbul → Berlin](docs/screenshots/trip-istanbul-berlin.png)\n\n**API Library** — click the button at the bottom of the sidebar for the full endpoint reference and copy-paste snippets in curl, JavaScript, Python, Go and PHP:\n\n![API library modal](docs/screenshots/api-library.png)\n\n## ✨ Features\n\n- 🗺 **Unified choropleth world map** with 14 metrics grouped into **Cost**, **Energy** and **Society** tabs\n- 🏷 **In-map country labels** with the selected metric shown per country, scaled to zoom\n- 🆚 **Country Compare** — pick up to 5 countries and stack every metric side-by-side in a colour-coded table with \"best\" cells highlighted\n- 🧭 **Trip calculator** — enter From / To (and up to 8 intermediate stops, or \"current location\"), pick your vehicle (**Gasoline, Diesel, LPG, EV home, EV fast**), hit Calculate. For fuel vehicles you get a real per-refuel receipt (tank topped up at 2 % reserve in whichever country you're in); for EVs you get a per-country electricity-cost breakdown with optional fast-charger markup.\n- 🔌 **API Library modal** — one click away from copy-paste usage snippets in curl, JavaScript, Python, Go and PHP, plus a field reference for every key in the dataset.\n- 📦 **Static open data endpoints** — `countries.json` (unified payload), `countries.geojson` (Natural Earth borders). Auth-free, rate-limit-free, refreshed daily.\n- 🌓 Light / dark / system theme with matching CARTO tiles\n- 🤖 **Self-updating** — a GitHub Actions cron job rebuilds and redeploys the site every morning\n\n## 📊 Metrics \u0026 sources\n\n| # | Metric | Group | Source | License |\n|---|---|---|---|---|\n| 1 | Gasoline (USD/L) | Cost | EU Weekly Oil Bulletin / World Bank Global Fuel Prices DB | CC BY 4.0 / ODbL |\n| 2 | Diesel (USD/L) | Cost | same | same |\n| 3 | LPG (USD/L) | Cost | same | same |\n| 4 | Household electricity (USD/kWh) | Cost | **Eurostat nrg_pc_204 (live)** for EU/EEA, static fallback for rest | CC BY 4.0 |\n| 5 | EV home charge (USD/100 km) | Cost | derived: electricity × 18 kWh/100 km | — |\n| 6 | EV fast charge (USD/100 km) | Cost | derived: home × 1.6 fast-charger markup | — |\n| 7 | CO₂ per capita (t/yr) | Energy | Our World in Data (Global Carbon Budget mirror) | CC BY 4.0 |\n| 8 | Renewable electricity share (%) | Energy | World Bank EG.ELC.RNEW.ZS | CC BY 4.0 |\n| 9 | GDP per capita (USD) | Society | World Bank NY.GDP.PCAP.CD | CC BY 4.0 |\n| 10 | Life expectancy (years) | Society | World Bank SP.DYN.LE00.IN | CC BY 4.0 |\n| 11 | Internet users (%) | Society | World Bank IT.NET.USER.ZS | CC BY 4.0 |\n| 12 | Gini index | Society | World Bank SI.POV.GINI | CC BY 4.0 |\n| 13 | Unemployment (%) | Society | World Bank SL.UEM.TOTL.ZS | CC BY 4.0 |\n| 14 | Inflation (CPI, % yoy) | Society | World Bank FP.CPI.TOTL.ZG | CC BY 4.0 |\n| — | Country borders | — | Natural Earth 110m admin_0 | CC0 |\n\nAll upstreams are fetched at build time by `scripts/generateData.js` and baked into `public/api/v1/countries.json`. The GitHub Actions workflow runs this daily, so the live site always reflects the most recent upstream numbers.\n\n## 🛠 Tech Stack\n\n| Layer | Choice |\n|---|---|\n| Framework | React 19 + Vite 8 |\n| Language | TypeScript 5 |\n| Mapping | Leaflet + react-leaflet (GeoJSON choropleth + Polyline routes) |\n| Routing | OSRM public demo server |\n| Geocoding | Nominatim (OpenStreetMap) |\n| Data pipeline | Node.js + SheetJS (`xlsx`) |\n| Hosting | GitHub Pages (via GitHub Actions) |\n\n## ⚙️ Installation\n\n```bash\ngit clone https://github.com/aykutsp/world-infrastructure-data-hub.git\ncd world-infrastructure-data-hub\nnpm install\n```\n\n## 🚀 Usage\n\n```bash\nnpm run generate-data   # pull every upstream feed once (~30 s)\nnpm run dev             # local dev server\nnpm run build           # prod: regenerate data + typecheck + bundle\nnpm run preview         # smoke-test the built output\n```\n\n## 🔌 Open Data API\n\nBase URL: `https://aykutsp.github.io/world-infrastructure-data-hub/api/v1/`\n\n| Endpoint | Description |\n|---|---|\n| [`countries.json`](https://aykutsp.github.io/world-infrastructure-data-hub/api/v1/countries.json) | Unified dataset — 14 metrics per country |\n| [`countries.geojson`](https://aykutsp.github.io/world-infrastructure-data-hub/api/v1/countries.geojson) | Natural Earth borders (CC0) |\n\n### Simplified JSON schema\n\n```jsonc\n{\n  \"lastUpdated\": \"2026-04-05T15:00:00.000Z\",\n  \"sources\": [ \"EU Weekly Oil Bulletin — CC BY 4.0\", \"…\" ],\n  \"coverage\": { \"fuel\": 130, \"electricity\": 89, \"ev\": 89, \"co2\": 167, \"worldBank\": 167 },\n  \"countries\": [\n    {\n      \"id\": \"DE\", \"iso3\": \"DEU\", \"name\": \"Germany\", \"lat\": 51.17, \"lng\": 10.45,\n      \"fuel\":        { \"gasoline\": 2.46, \"diesel\": 2.64, \"lpg\": 1.20, \"source\": \"EU Weekly Oil Bulletin\" },\n      \"electricity\": { \"household_usd_per_kwh\": 0.403, \"year\": 2025, \"period\": \"2025-S1\", \"source\": \"Eurostat nrg_pc_204 …\" },\n      \"ev\":          { \"home_usd_per_100km\": 7.25, \"public_fast_usd_per_100km\": 11.60, \"assumptions\": {...} },\n      \"co2\":         { \"year\": 2023, \"tonnes_per_capita\": 8.09, \"total_million_tonnes\": 673.22, \"source\": \"OWID/GCB\" },\n      \"worldBank\": {\n        \"gdp_per_capita_usd\":        { \"value\": 54290, \"year\": 2023, \"source\": \"World Bank\" },\n        \"life_expectancy_years\":     { \"value\": 80.7,  \"year\": 2022, \"source\": \"World Bank\" },\n        \"internet_users_pct\":        { \"value\": 91.8,  \"year\": 2023, \"source\": \"World Bank\" },\n        \"renewable_electricity_pct\": { \"value\": 51.2,  \"year\": 2022, \"source\": \"World Bank\" },\n        \"gini_index\":                { \"value\": 31.9,  \"year\": 2020, \"source\": \"World Bank\" },\n        \"unemployment_pct\":          { \"value\": 3.1,   \"year\": 2024, \"source\": \"World Bank\" },\n        \"inflation_pct\":             { \"value\": 5.9,   \"year\": 2023, \"source\": \"World Bank\" },\n        \"population\":                { \"value\": 83300000, \"year\": 2023, \"source\": \"World Bank\" }\n      }\n    }\n  ]\n}\n```\n\n### Usage examples\n\n**curl + jq** — top 10 cheapest gasoline markets:\n\n```bash\ncurl -s https://aykutsp.github.io/world-infrastructure-data-hub/api/v1/countries.json \\\n  | jq -r '.countries\n      | map(select(.fuel and .fuel.gasoline != null))\n      | sort_by(.fuel.gasoline)\n      | .[:10]\n      | .[] | \"\\(.id)\\t\\(.fuel.gasoline)\\t\\(.name)\"'\n```\n\n**JavaScript / TypeScript**:\n\n```ts\nconst { countries } = await fetch(\n  'https://aykutsp.github.io/world-infrastructure-data-hub/api/v1/countries.json'\n).then((r) =\u003e r.json());\n\nconst de = countries.find((c: any) =\u003e c.id === 'DE');\nconsole.log(`${de.name}: fuel $${de.fuel?.gasoline}/L, electricity $${de.electricity?.household_usd_per_kwh}/kWh, CO₂ ${de.co2?.tonnes_per_capita} t/cap`);\n```\n\n**Python**:\n\n```python\nimport urllib.request, json\n\nwith urllib.request.urlopen(\"https://aykutsp.github.io/world-infrastructure-data-hub/api/v1/countries.json\") as r:\n    data = json.load(r)\n\n# Top 10 countries by life expectancy\nby_life = sorted(\n    (c for c in data[\"countries\"]\n     if c[\"worldBank\"] and c[\"worldBank\"].get(\"life_expectancy_years\")),\n    key=lambda c: c[\"worldBank\"][\"life_expectancy_years\"][\"value\"],\n    reverse=True,\n)\nfor c in by_life[:10]:\n    v = c[\"worldBank\"][\"life_expectancy_years\"]\n    print(f\"{c['id']}\\t{v['value']:.1f} yrs ({v['year']})\\t{c['name']}\")\n```\n\n**Go, PHP, Rust, C#** — all work exactly the same way. Click the **API Library** button at the bottom of the live sidebar for ready-to-copy snippets.\n\n## 📁 Project Structure\n\n```\n.\n├── .github/workflows/deploy.yml     # Daily data refresh + GitHub Pages deploy\n├── public/api/v1/                   # Generated dataset (built in CI)\n├── scripts/generateData.js          # Unified pipeline (fuel + electricity + EV + CO2 + WB)\n├── src/\n│   ├── App.tsx\n│   ├── components/\n│   │   ├── Dashboard/\n│   │   │   ├── Sidebar.tsx          # Explore / Compare / Trip views + API Library button\n│   │   │   └── ApiLibraryModal.tsx  # Modal with API reference + snippets\n│   │   ├── Map/InfraMap.tsx         # Choropleth + labels + route polyline\n│   │   └── Trip/TripCalculator.tsx  # Multi-fuel + EV cost model\n│   ├── types.ts                     # Country / Dataset / DatasetSpec / Trip types\n│   ├── main.tsx\n│   └── index.css\n├── index.html\n├── package.json\n└── vite.config.ts\n```\n\n## 📌 Roadmap\n\n- [ ] Live global electricity feed (replace static fallback for non-EU)\n- [ ] CO₂ intensity of the local grid — so EV cost **and** EV CO₂ match the local mix\n- [ ] Pre-computed trip API endpoints under `/api/v1/trips/*.json`\n- [ ] Historical time-series per metric with sparklines\n- [ ] Cost-parity view: at what electricity price does an EV break even vs gasoline in each country?\n- [ ] Client libraries under `libraries/` (npm, PyPI, Go, Flutter, NuGet)\n- [ ] Charging-station point-of-interest layer (OpenChargeMap)\n- [ ] Water prices, air quality, mobile \u0026 broadband costs as future metrics\n\n## 📦 Client Libraries\n\nLanguage-specific wrappers live under [`libraries/`](./libraries/). All five expose the same surface (`getDataset`, `getCountry`, `rank`, `globalAverage`) and are ready to publish to their respective registries.\n\n| Language | Package | Install | Source |\n|---|---|---|---|\n| JavaScript / TypeScript | `world-infra-data` (npm) | `npm install world-infra-data` | [`libraries/typescript`](./libraries/typescript) |\n| Python 3.9+ | `world-infra-data` (PyPI) | `pip install world-infra-data` | [`libraries/python`](./libraries/python) |\n| Go 1.21+ | `github.com/aykutsp/world-infrastructure-data-hub/libraries/go` | `go get github.com/aykutsp/world-infrastructure-data-hub/libraries/go@latest` | [`libraries/go`](./libraries/go) |\n| Dart / Flutter | `world_infra_data` (pub.dev) | `dart pub add world_infra_data` | [`libraries/flutter`](./libraries/flutter) |\n| .NET 8+ | `WorldInfraData` (NuGet) | `dotnet add package WorldInfraData` | [`libraries/csharp`](./libraries/csharp) |\n\n## 📜 Changelog\n\n**v1.1.0** — Grid CO₂ intensity (gCO₂/kWh) from OWID/Ember energy data as a 15th metric, 15-year historical time-series for CO₂ and the eight World Bank indicators, inline SVG sparklines next to every historical metric in the country detail panel, five official client libraries under `libraries/` (npm, PyPI, Go modules, Flutter, NuGet), optional OpenChargeMap charging-station count loader (activates automatically when `OPENCHARGEMAP_KEY` is set in the CI environment).\n\n**v1.0.0** — Live Eurostat electricity pull, Country Compare view (up to 5 countries side-by-side), ported Trip Calculator with 5 cost modes (gasoline / diesel / LPG / EV home / EV fast) and up to 8 waypoints, API Library modal with copy-paste snippets, 8 new World Bank indicators (GDP per capita, population, life expectancy, internet users, renewable share, Gini, unemployment, inflation).\n\n**v0.1.0** — Initial scaffold with fuel + electricity (static) + EV (derived) + CO₂.\n\n## 🤝 Contributing\n\nSee [`CONTRIBUTING.md`](./CONTRIBUTING.md). Community health docs: [`SECURITY.md`](./SECURITY.md), [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md).\n\n## 📄 License\n\nMIT. See [`LICENSE`](./LICENSE).\n\nFeel free to use this project however you like — fork it, ship it, tear it apart, build something bigger on top of it. If you end up using it in something public, a small credit or a link back would make my day, but it's not a requirement. Thanks for taking a look.\n\nUpstream datasets keep their original licences — see the data sources table above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faykutsp%2Fworld-infrastructure-data-hub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faykutsp%2Fworld-infrastructure-data-hub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faykutsp%2Fworld-infrastructure-data-hub/lists"}