#exercism #http #rest #api-bindings #api

mini_exercism

Minimalistic Rust library to interact with the Exercism.org APIs

6 stable releases

3.0.0 Apr 16, 2024
2.1.0 Jan 15, 2024
1.2.0 Nov 13, 2023
1.1.0 Oct 14, 2023
1.0.0 Sep 16, 2023

#213 in Asynchronous

Download history 79/week @ 2024-01-09 188/week @ 2024-01-16 6/week @ 2024-01-23 21/week @ 2024-01-30 30/week @ 2024-02-06 16/week @ 2024-02-13 12/week @ 2024-02-20 60/week @ 2024-02-27 55/week @ 2024-03-05 61/week @ 2024-03-12 74/week @ 2024-03-19 68/week @ 2024-03-26 48/week @ 2024-04-02 7/week @ 2024-04-09 839/week @ 2024-04-16 52/week @ 2024-04-23

951 downloads per month
Used in auxiliaire

MIT license

130KB
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 = "3.0.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–19MB
~251K SLoC