#exercism #programming-language #rest #http #api-bindings #web-api #api

mini_exercism

Minimalistic Rust library to interact with the Exercism.org APIs

10 stable releases (3 major)

4.2.0 Oct 6, 2024
4.1.0 Sep 16, 2024
3.1.0 Aug 26, 2024
3.0.0 Apr 16, 2024
1.0.0 Sep 16, 2023

#195 in Asynchronous

Download history 791/week @ 2024-07-22 437/week @ 2024-07-29 155/week @ 2024-08-05 102/week @ 2024-08-12 247/week @ 2024-08-19 271/week @ 2024-08-26 222/week @ 2024-09-02 512/week @ 2024-09-09 606/week @ 2024-09-16 103/week @ 2024-09-23 614/week @ 2024-09-30 127/week @ 2024-10-07 188/week @ 2024-10-14 111/week @ 2024-10-21 258/week @ 2024-10-28 33/week @ 2024-11-04

592 downloads per month
Used in auxiliaire

MIT license

145KB
2K SLoC

mini_exercism

CI codecov Security audit crates.io downloads docs.rs Contributor Covenant

Minimalistic Rust library to interact with the Exercism.org APIs.

Exerci-what?

Exercism is a free, not-for-profit platform to learn new programming languages. It supports a web editor for solving exercises, mentoring with real humans and a lot more. For more information, see its about page.

Installing

Add mini_exercism to your dependencies:

[dependencies]
mini_exercism = "4.2.0"

or by running:

cargo add mini_exercism

Example

use mini_exercism::api;
use mini_exercism::api::v2::exercises::Filters;
use mini_exercism::core::Credentials;

async fn get_published_solution_uuids(
    api_token: &str,
    track: &str,
) -> anyhow::Result<Vec<String>> {
    let credentials = Credentials::from_api_token(api_token);
    let client = api::v2::Client::builder()
        .credentials(credentials)
        .build()?;

    let filters = Filters::builder().include_solutions(true).build();
    let solutions = client.get_exercises(track, Some(filters)).await?.solutions;

    Ok(solutions
        .into_iter()
        .filter(|solution| solution.published_at.is_some())
        .map(|solution| solution.uuid)
        .collect())
}

For more information, see the docs.

Minimum Rust version

mini_exercism currently builds on Rust 1.64 or newer.

Dependencies

~5–16MB
~212K SLoC