#json-rpc #api-bindings #webuntis

untis

Rust library to access the webuntis jsonrpc

3 unstable releases

Uses old Rust 2015

0.2.1 Apr 22, 2018
0.2.0 Apr 21, 2018
0.1.0 Mar 17, 2018

#1390 in Data structures

45 downloads per month

MIT license

21KB
568 lines

untis-rs

Rust library to access the webuntis jsonrpc

fn main() {
    let mut untis = Units::new("server", "school", "user", "password");
    let today = Local::today().naive_local();
    
    let info = untis.login().expect("Failed to login");

    let _statusdata  = untis.status_data()                      .expect("Failed to get status data" );
    let _holidays    = untis.holidays()                         .expect("Failed to get holidays"    );
    let _rooms       = untis.rooms()                            .expect("Failed to get rooms"       );
    let _classes     = untis.classes()                          .expect("Failed to get classes"     );
    let _subjects    = untis.subjects()                         .expect("Failed to get subjects"    );
    let _timetable   = untis.timetable(info.class_id, 1, today) .expect("Failed to get timetable"   );
    let _departments = untis.departments()                      .expect("Failed to get departments" );
    // teachers

    untis.logout().expect("Failed to logout");
}

Dependencies

~16–26MB
~456K SLoC