Skip to main content

gbeng

Pretty-print the GB electricity generation mix in your terminal.

Data comes from the free, unauthenticated NESO Carbon Intensity API. No API key needed.

Install

pip install gbeng

Or with uv:

uv tool install gbeng

Note that if you use uv you don't even need to install it, just run uvx!

Usage

Print current mix and exit:

gbeng mix

Live display (refreshes every 2 seconds, re-fetches data every 5 minutes):

gbeng mix --live

Example output

╭─ GB Electricity Grid ────────────────────────────────────────────╮
│ Carbon intensity: 142 gCO₂/kWh (moderate)                        │
│                                                                   │
│          Generation mix                                           │
│  Fuel      Share                                                  │
│  wind      35.2%  ███████████████████████████████████            │
│  gas       28.1%  ████████████████████████████                   │
│  nuclear   20.0%  ████████████████████                           │
│  solar      8.5%  ████████                                        │
│  imports    5.0%  █████                                           │
│  hydro      2.1%  ██                                              │
│  biomass    1.1%  █                                               │
│                                                                   │
│  Fetched 2026-04-23 12:34:56 · data from api.carbonintensity.org.uk · ^C  │
╰───────────────────────────────────────────────────────────────────╯

Development

git clone https://github.com/phalt/gb-energy-mix-cli
cd gb-energy-mix-cli
make install
make test

Licence

MIT

Metadata

Release files for gbeng 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gbeng 0.2.0
File Size Uploaded
gbeng-0.2.0.tar.gz 13.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gbeng 0.2.0
File Interpreter ABI Platform
gbeng-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / gbeng-0.2.0.tar.gz

Download URL gbeng-0.2.0.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8ed99d0d32222da1618bad331683701bd5b31a11f771e1c4fe1b00428845c980
BLAKE2b-256 checksum
How to use checksums
8c4cb94ec114c258c31d448e4e2b7be5f9a55ecc563fd82ff553de3409a66653
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gbeng-0.2.0-py3-none-any.whl

Download URL gbeng-0.2.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d4d2e4028286198e28f5be76c5ff96694908f74af3de93b5fb9b65d5d8adbc4
BLAKE2b-256 checksum
How to use checksums
ad36fca94d11741f288577b67e78947aa67d17ad8d1ca57812bcebc332036065
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release 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