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

Download files

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

Source Distribution

gbeng-0.2.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

gbeng-0.2.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file gbeng-0.2.0.tar.gz.

File metadata

  • Download URL: gbeng-0.2.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for gbeng-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8ed99d0d32222da1618bad331683701bd5b31a11f771e1c4fe1b00428845c980
MD5 101c0be11780ad376301868d7aa34d73
BLAKE2b-256 8c4cb94ec114c258c31d448e4e2b7be5f9a55ecc563fd82ff553de3409a66653

See more details on using hashes here.

File details

Details for the file gbeng-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gbeng-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for gbeng-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d4d2e4028286198e28f5be76c5ff96694908f74af3de93b5fb9b65d5d8adbc4
MD5 f9b82b394bd8d01ea7136d00f07c75b4
BLAKE2b-256 ad36fca94d11741f288577b67e78947aa67d17ad8d1ca57812bcebc332036065

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page