#ml #api #interfacing #status-code #nikel

nikel-rs

A library for interfacing with https://nikel.ml

9 releases

0.2.2 Jul 31, 2020
0.2.1 Jul 16, 2020
0.1.6 Jul 4, 2020

#23 in #status-code

36 downloads per month

MIT license

14KB
334 lines

Nikel-rs

Crates.io Crates.io

A Rust library for interacting with the UofT API Nikel: http://nikel.ml

Usage

use std::vec:Vec;
use nikel_rs::NikelAPI;

let client = NikelAPI::Client::new(); // Create client
let opts: Vec<(&str, &str)> = vec![("code", "CSC108"), ("campus", "mississauga")] // Query options
let resp = client.courses(opts).expect("Error!"); // Get
if resp.status_code == 200 {
  println!("{}", resp.response[0].description); // Print the first course's description
} else {
  println!("Error!");
}

See Nikel-CLI for a more complete example

Dependencies

~3–7.5MB
~171K SLoC