Crates.io | coursehku |
lib.rs | coursehku |
version | 1.0.0 |
source | src |
created_at | 2024-01-08 14:51:33.623368 |
updated_at | 2024-01-21 05:30:21.118197 |
description | A library for course scheduling in HKU |
homepage | https://github.com/adlsdztony/CourseHKU |
repository | https://github.com/adlsdztony/CourseHKU |
max_upload_size | |
id | 1092599 |
size | 58,748 |
A library to deal with HKU course data.
Add this to your Cargo.toml
:
cargo add coursehku
use CourseHKU::course::CourseTable;
use std::path::PathBuf;
fn main() {
let table = CourseTable::load(PathBuf::from("data.csv"));
let table = table
.to_lazy() // convert to lazy table
.semester(1) // filter semester 1
.contains(&["COMP", "MATH", "ENGG"]) // filter courses by code
.no_conflict_with(table.get_course("COMP1117").unwrap()) // filter courses that do not conflict with COMP1117
.collect() // collect the lazy table
.unwrap();
println!("{}", table);
}
git clone https://github.com/adlsdztony/CourseHKU.git
cd CourseHKU
cargo run --example scheduler