7 releases

0.1.7 Sep 30, 2024
0.1.6 Sep 29, 2024

#932 in Web programming

Download history 107/week @ 2024-09-23 329/week @ 2024-09-30 4/week @ 2024-10-07 1/week @ 2024-10-14

441 downloads per month

MIT license

16KB
283 lines

RoughtRight API

This create allows us to communicate with RoughtRight to get data from its api. It has some 1:1 functions:

  • Get all projects
  • Get all employees
  • Get all customers
  • Get all projects for a certain week

And also some helper functions

  • Get all projects as a hashmap
  • Get all employees as a hashmap
  • Get all customers as a hashmap
  • Get all projects on a certain week and return who will work on those procects

Usage


use std::{env, error::Error};
use roughly_rs::RoughlyRight;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {

    let username = env::var("EMAIL").unwrap();
    let password = env::var("PASSWORD").unwrap();

    let week = "202440";

    let mut roughly_right = RoughlyRight::new(&username, &password);

    let the_week = roughly_right.weekly_work(week).await?;

    for (_key, value) in the_week.iter() {
        println!("{}: {:?}", value.project, value.employees);
    }

    Ok(())

}

Dependencies

~6–18MB
~241K SLoC