Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markus-k/awattar-api-rs
Rust client for the awattar price API
https://github.com/markus-k/awattar-api-rs
awattar awattar-api energy-prices rust-lang
Last synced: 18 days ago
JSON representation
Rust client for the awattar price API
- Host: GitHub
- URL: https://github.com/markus-k/awattar-api-rs
- Owner: markus-k
- License: mit
- Created: 2022-08-08T19:16:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-25T17:32:14.000Z (about 2 years ago)
- Last Synced: 2024-06-11T20:19:00.436Z (7 months ago)
- Topics: awattar, awattar-api, energy-prices, rust-lang
- Language: Rust
- Homepage: https://crates.io/crates/awattar-api
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `awattar-api` – Rust client for the awattar price API
This crates is an API client for the [awattar](https://www.awattar.de) price API.
The API of this crate is currently not considered stable and is likely to change
in future releases.## Usage
For a full example have a look at the `examples/`-directory.
Add `awattar-api` to you dependencies:
``` toml
[dependencies]
awattar-api = "0.2.0"
```Querying prices is simple:
``` rust
use awattar_api::*;
use chrono::Utc;#[tokio::main]
async fn main() {
let date = Utc::today().naive_local();let prices = PriceData::query_date(AwattarZone::Germany, date)
.await
.unwrap();for slot in prices.slots_iter() {
println!(
"{} - {}: {:.02} €/kWh",
slot.start(),
slot.end(),
slot.price_cents_per_mwh() as f32 / 100_000.00
);
}
}
```## License
This crate is licensed under the MIT license.