carbonintensity-api

A simple Rust library to retrieve data from https://api.carbonintensity.org.uk/

https://github.com/jnioche/carbonintensity-api

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.8%) to scientific vocabulary

Keywords

carbon-intensity carbon-intensity-api national-grid rust-lang
Last synced: 5 months ago · JSON representation

Repository

A simple Rust library to retrieve data from https://api.carbonintensity.org.uk/

Basic Info
  • Host: GitHub
  • Owner: jnioche
  • License: apache-2.0
  • Language: Rust
  • Default Branch: main
  • Homepage:
  • Size: 101 KB
Statistics
  • Stars: 11
  • Watchers: 2
  • Forks: 1
  • Open Issues: 3
  • Releases: 0
Topics
carbon-intensity carbon-intensity-api national-grid rust-lang
Created over 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.md

carbonintensity-api

crates.io crates.io 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
-e, --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

```Rust 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

  • Name: Julien Nioche
  • Login: jnioche
  • Kind: user
  • Location: Bristol, UK
  • Company: DigitalPebble Ltd

I run @DigitalPebble Ltd My expertise is in green software / grenops / digital sustainability with a strong focus on open source tools.

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 98
  • Total Committers: 2
  • Avg Commits per committer: 49.0
  • Development Distribution Score (DDS): 0.357
Past Year
  • Commits: 76
  • Committers: 2
  • Avg Commits per committer: 38.0
  • Development Distribution Score (DDS): 0.171
Top Committers
Name Email Commits
Aldo "xoen" Giambelluca a****a@g****m 63
Julien Nioche j****n@d****m 35
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 14
  • Total pull requests: 17
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 14 hours
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.5
  • Average comments per pull request: 1.41
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 17
  • Average time to close issues: about 15 hours
  • Average time to close pull requests: about 14 hours
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 0.8
  • Average comments per pull request: 1.41
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jnioche (12)
  • xoen (3)
Pull Request Authors
  • xoen (29)
  • jnioche (4)
Top Labels
Issue Labels
enhancement (7) help wanted (4) bug (2) good first issue (2)
Pull Request Labels
enhancement (8)

Packages

  • Total packages: 1
  • Total downloads:
    • cargo 3,609 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

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 3,609 Total
Rankings
Dependent repos count: 30.8%
Dependent packages count: 36.1%
Average: 55.1%
Downloads: 98.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

Cargo.toml cargo
.github/workflows/rust.yml actions
  • actions/checkout v3 composite