Skip to main content

bio-pype-carbon-intensity

Grid carbon intensity (gCO2eq/kWh); current values and forecasts from free public APIs. Built for compute.bio / bio-pype but usable standalone; the Python import name is carbon_intensity. Not affiliated with carbonintensity.org.uk or any of the upstream data providers. This package just organises their great public data. MIT licensed.

Zones Source Forecast Notes
EU bidding zones (FR, DE_LU, …) ENTSO-E Transparency (key required) consumption-based via iterative flow tracing
GB + 17 DNO regions (GB-LONDON, …) carbonintensity.org.uk (no key) ✓ 48h precomputed by NG ESO; also pinned into the EU solve
AU-NSW1AU-VIC1, AU-WEM OpenElectricity (free key) + AEMO NEMWEB (no key) ✓ ~40h (NEM), climatology (WEM) production-based
anything else Electricity Maps (personal key) / compute.bio backend ✓ / – escape hatch

The core package has no dependencies (stdlib only). The multi-zone backend bulk path needs the backend extra:

pip install bio-pype-carbon-intensity            # worker / single-zone use
pip install bio-pype-carbon-intensity[backend]   # bulk window fetch + EU flow tracing

Usage

from carbon_intensity import get_current, get_forecast, run_window

rec = get_current("GB-LONDON")           # one or two HTTP calls
print(rec.intensity_g_per_kwh, rec.kind)

for slot in get_forecast("AU-NSW1"):     # AEMO pre-dispatch, ~40h ahead
    print(slot.start, slot.intensity_g_per_kwh, slot.extra["method"])

# backend bulk (needs [backend] extra for EU zones):
import datetime as dt
now = dt.datetime.now(dt.timezone.utc)
results = run_window(["FR", "BE", "GB", "AU-NSW1"], now - dt.timedelta(hours=4),
                     now + dt.timedelta(hours=24))

API keys via env vars: ENTSOE_API_KEY, OPENELECTRICITY_API_KEY, ELECTRICITY_MAPS_API_KEY, COMPUTE_BIO_API_URL/COMPUTE_BIO_TOKEN — or pass a ProviderConfig explicitly.

Method caveat for EU zones: get_current() / get_forecast() on an ENTSO-E zone return production intensity (single-zone fast path, labeled extra["method"] = "production_only") — they do not account for imports/exports. Consumption intensity for EU zones requires the flow-traced run_window() (or the compute_bio provider, which serves a backend's flow-traced value). Don't compare fast-path numbers against consumption-based sources such as Electricity Maps.

Forecast caveats: WEM (Western Australia) uses a 7-day hour-of-day climatology, not a physical forecast; NEM forecasts assume the current thermal mix holds. The method is labeled in each record's extra["method"].

Run the test suite: python tests/smoke.py (live UK checks need network; ENTSO-E/AU live checks run when keys are set).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bio_pype_carbon_intensity-0.1.1.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bio_pype_carbon_intensity-0.1.1-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file bio_pype_carbon_intensity-0.1.1.tar.gz.

File metadata

File hashes

Hashes for bio_pype_carbon_intensity-0.1.1.tar.gz
Algorithm Hash digest
SHA256 10d04d5501af53052b57ed7332dca585c57a0a04df655e9cf41fea50721d5ca9
MD5 ebe78059bf73ecc5c856b54b102be444
BLAKE2b-256 d74c564c52b5de57ca61e2cbcfb1ac605f06b887a78644ea2ee684bf3d649f88

See more details on using hashes here.

File details

Details for the file bio_pype_carbon_intensity-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bio_pype_carbon_intensity-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f10c6333e6a10e397dd12beb7421d7be2588de14795563d2163e0d4a0dd1e62
MD5 95a5275e8f98bdd9bd34b47bb5053f45
BLAKE2b-256 52f019ab9f51116629181b6a88d7a9ded5a33db022c8caab44fdf707970e072c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page