Metadata-Version: 2.4
Name: gbeng
Version: 0.2.0
Summary: Pretty-print the GB electricity generation mix in your terminal
Project-URL: Homepage, https://github.com/phalt/gb-energy-mix-cli
Project-URL: Issues, https://github.com/phalt/gb-energy-mix-cli/issues
Author-email: Paul Hallett <paulandrewhallett@gmail.com>
License: MIT
License-File: LICENSE
Requires-Python: >=3.14
Requires-Dist: click>=8.1
Requires-Dist: httpx>=0.27
Requires-Dist: rich>=13.0
Description-Content-Type: text/markdown

# gbeng

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

Data comes from the free, unauthenticated [NESO Carbon Intensity API](https://api.carbonintensity.org.uk). No API key needed.

## Install

```bash
pip install gbeng
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
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:

```bash
gbeng mix
```

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

```bash
gbeng mix --live
```

## Example output

```text
╭─ 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

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

## Licence

MIT
