2 unstable releases

0.1.0 Oct 16, 2024
0.0.1 Oct 2, 2024

#1486 in Web programming

Download history 155/week @ 2024-09-26 42/week @ 2024-10-03 86/week @ 2024-10-10 96/week @ 2024-10-17 2/week @ 2024-10-24

89 downloads per month

MIT license

72KB
1.5K SLoC

Wakapi : wakatime API client

This crate is a Work In Progress API client for the Wakatime API. It is NOT ready for production.

The following endpoints are implemented, only in read mode (GET requests), as blocking or async depending on the feature flag blocking:

The structures are based on the official documentation at 2024-10-01 with a few modifications to correct some errors / inconsistencies.

Usage

Async mode

use wakapi::{WakapiClient, CommitsParams};
let client = wakapi::WakapiClient::new(
    "https://api.wakatime.com",
    "YOUR_WAKATIME_API_KEY",
);
let res = wakapi::Summaries::fetch(&client,
   wakapi::SummariesParams::from_interval("2024-01-01", "2024-01-05"),
).await.unwrap();
println!("{:?}", res);
```

### Blocking mode
```rust
use wakapi::{WakapiClient, CommitsParams};
let client = wakapi::WakapiClient::new(
    "https://api.wakatime.com",
    "YOUR_WAKATIME_API_KEY",
);
let res = wakapi::Summaries::fetch(&client,
   wakapi::SummariesParams::from_interval("2024-01-01", "2024-01-05"),
).unwrap();
println!("{:?}", res);

License

This project is licensed under the MIT License.

Dependencies

~7–22MB
~248K SLoC