Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Green Queue

Green Queue displays the current carbon intensity and generation mix for a UK electricity region, together with statistics for the previous and next 24 hours. It is intended to help you choose a lower-carbon time to submit flexible HPC workloads.

Data comes from the National Energy System Operator Carbon Intensity API.

Requirements

  • Python 3.11 or later
  • Network access to api.carbonintensity.org.uk

Installation

Create a virtual environment and install the project:

$ python3 -m venv ~/.local/green-queue
$ ~/.local/green-queue/bin/pip install /path/to/green-compute

The command is then available at:

$ ~/.local/green-queue/bin/green-queue status

To make green-queue available without its full path on future logins, add this line to ~/.bashrc:

export PATH="$HOME/.local/green-queue/bin:$PATH"

Reload the shell and run the command normally:

$ source ~/.bashrc
$ green-queue status

For development, install the checkout in editable mode with its test tools:

$ python3 -m venv .venv
$ source .venv/bin/activate
$ python -m pip install -e '.[test]'

Usage

Show the status for Great Britain:

$ green-queue status

Select another API region or change the per-request timeout (in seconds - default 10s):

$ green-queue status --region "South Scotland" --timeout 5

A full list of the availble API regions use:

$ green-queue regions

Run green-queue status --help to see all status options. If the API cannot be reached, the command prints a concise error and returns a non-zero exit code.

Times are returned by the API in UTC and displayed in the machine's local timezone.

License

Green Queue is licensed under the GNU General Public License version 3.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages