carbonintensity-api
Rust library to retrieve regional carbon intensity data from the UK National Grid.
https://github.com/jnioche/carbonintensity-api
Category: Emissions
Sub Category: Carbon Intensity and Accounting
Keywords
carbon-intensity carbon-intensity-api national-grid rust-lang
Last synced: about 20 hours ago
JSON representation
Repository metadata
A simple Rust library to retrieve data from https://api.carbonintensity.org.uk/
- Host: GitHub
- URL: https://github.com/jnioche/carbonintensity-api
- Owner: jnioche
- License: apache-2.0
- Created: 2023-11-10T15:37:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-15T05:58:37.000Z (7 months ago)
- Last Synced: 2025-04-10T05:04:48.960Z (18 days ago)
- Topics: carbon-intensity, carbon-intensity-api, national-grid, rust-lang
- Language: Rust
- Homepage:
- Size: 101 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 3
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
README.md
carbonintensity-api
A simple Rust library to help retrieve data from the Carbon Intensity API, not all functionalities of the CarbonIntensity API might be exposed.
Please read the API's terms of use.
CLI
An executable is provided to try the library. With Rust and Cargo installed
cargo install --locked --path .
then
carbonintensity-api -h
should display the list of available commands and options.
Provides a client for the UK National Grid Carbon Intensity API
Usage: carbonintensity-api [OPTIONS] [TARGET]
Arguments:
[TARGET] numerical value for a region (1-17) or first part of a UK postcode returns data at the national level if not set [default: National]
Options:
-s, --start-date <START_DATE>
-e, --end-date <END_DATE>
-h, --help Print help
-V, --version Print version
To display the current carbon intensity at national level
carbonintensity-api
for a given postcode
carbonintensity-api bs7
or a region
carbonintensity-api 11
The region id is a number between 1 and 17
1. North Scotland
2. South Scotland
3. North West England
4. North East England
5. South Yorkshire
6. North Wales, Merseyside and Cheshire
7. South Wales
8. West Midlands
9. East Midlands
10. East England
11. South West England
12. South England
13. London
14. South East England
15. England
16. Scotland
17. Wales
Specifying dates will return a list of intensities. If no end date is provided, the current day and time will be used.
The dates are expected to be at the %Y-%m-%dT%H:%MZ
format or simply %Y-%m-%d
, for instance
carbonintensity-api -s 2023-11-11 -e 2023-11-11T12:00Z postcode bs7
Intensities are returned by 30 mins windows.
Library
You can use the library in your Rust project by adding it to cargo with
cargo add carbonintensity-api
then declaring it in your code
use carbonintensity::{get_intensity, Target, Region};
...
let scotland = Region::Scotland;
let result = get_intensity(&Target::Region(scotland)).await;
License
This project is provided under Apache License.
Changelog
See CHANGELOG.
Owner metadata
- Name: Julien Nioche
- Login: jnioche
- Email:
- Kind: user
- Description: I run @DigitalPebble Ltd My expertise is in document engineering with a strong focus on open source tools.
- Website: http://www.digitalpebble.com
- Location: Bristol, UK
- Twitter:
- Company: DigitalPebble Ltd
- Icon url: https://avatars.githubusercontent.com/u/218319?u=49acbd191fb8a9b1aeabdb7fff35e035a68ef5c3&v=4
- Repositories: 15
- Last ynced at: 2025-04-24T00:44:15.224Z
- Profile URL: https://github.com/jnioche
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Committers metadata
Last synced: 7 days ago
Total Commits: 98
Total Committers: 2
Avg Commits per committer: 49.0
Development Distribution Score (DDS): 0.357
Commits in past year: 98
Committers in past year: 2
Avg Commits per committer in past year: 49.0
Development Distribution Score (DDS) in past year: 0.357
Name | Commits | |
---|---|---|
Aldo "xoen" Giambelluca | a****a@g****m | 63 |
Julien Nioche | j****n@d****m | 35 |
Committer domains:
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 14
Total pull requests: 19
Average time to close issues: 3 months
Average time to close pull requests: about 13 hours
Total issue authors: 2
Total pull request authors: 2
Average comments per issue: 0.5
Average comments per pull request: 1.32
Merged pull request: 19
Bot issues: 0
Bot pull requests: 0
Past year issues: 5
Past year pull requests: 19
Past year average time to close issues: about 15 hours
Past year average time to close pull requests: about 13 hours
Past year issue authors: 2
Past year pull request authors: 2
Past year average comments per issue: 0.8
Past year average comments per pull request: 1.32
Past year merged pull request: 19
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- jnioche (12)
- xoen (2)
Top Pull Request Authors
- xoen (17)
- jnioche (2)
Top Issue Labels
- enhancement (7)
- help wanted (4)
- good first issue (3)
- bug (2)
Top Pull Request Labels
- enhancement (5)
Package metadata
- Total packages: 1
-
Total downloads:
- cargo: 2,732 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
crates.io: carbonintensity-api
Provides a client for the UK National Grid Carbon Intensity API
- Homepage:
- Documentation: https://docs.rs/carbonintensity-api/
- Licenses: Apache-2.0
- Latest release: 0.3.0 (published 7 months ago)
- Last Synced: 2025-04-26T13:01:03.002Z (2 days ago)
- Versions: 3
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 2,732 Total
-
Rankings:
- Dependent repos count: 30.798%
- Dependent packages count: 36.137%
- Average: 55.115%
- Downloads: 98.412%
- Maintainers (1)
Dependencies
- actions/checkout v3 composite
Score: 11.245359696103272