jnioche / carbonintensity-api Goto Github PK
View Code? Open in Web Editor NEWA simple Rust library to retrieve data from https://api.carbonintensity.org.uk/
License: Apache License 2.0
A simple Rust library to retrieve data from https://api.carbonintensity.org.uk/
License: Apache License 2.0
when the range exceeds 13 days, this is currently done sequentially
The API returns the 30min slot with the range inclusive of the start date
carbonintensity-api -s 2023-11-19 postcode bs7
2023-11-18 23:30:00, 223
2023-11-19 00:00:00, 241
...
We should rewrite the start date so that it is aligned with the closest 30 min boundary + 1min
and not just at the regional level
Since a postcode starts with a letter and a region is a numerical value, it would possible to remove the subcommand (postcode
region
) altogether and determine what the user wants from the input itself.
Additionally, passing nothing at all could return data for the country as a whole.
rust-lang/rust#46016 (comment)
carbonintensity-api -s 2023-11-11 postcode bs7 | head
The CI API limits the range between the start and end dates to 14 days. An error is returned if a user provides a greater range.
We could at least provide a utility function to return the list of maximum ranges for a given input so that the end users can call the methods themselves for each range.
Later on we could do these calls in parallel and return a unified output.
Currently goes straight from
2022-12-31 23:00:00
to
2023-01-02 22:30:00
We currently return the whole RegionData
pub struct RegionData {
regionid: i32,
dnoregion: Option<String>,
shortname: String,
postcode: Option<String>,
data: Vec<Data>,
}
including the GenerationMix which is pretty verbose. The dates are also returned as strings, which takes further processing.
If #3 gets implemented we would also need to merge the outputs from individual calls into a single output.
The outward code can be between 2 and 4 characters
https://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom
carbonintensity-api postcode wc2n
currently fails
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.