coursehku

Crates.iocoursehku
lib.rscoursehku
version1.0.0
sourcesrc
created_at2024-01-08 14:51:33.623368
updated_at2024-01-21 05:30:21.118197
descriptionA library for course scheduling in HKU
homepagehttps://github.com/adlsdztony/CourseHKU
repositoryhttps://github.com/adlsdztony/CourseHKU
max_upload_size
id1092599
size58,748
Zilong Zhou (adlsdztony)

documentation

README

CourseHKU

A library to deal with HKU course data.

Add to your project

Add this to your Cargo.toml:

cargo add coursehku

Usage

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);
}

Run example

git clone https://github.com/adlsdztony/CourseHKU.git
cd CourseHKU
cargo run --example scheduler
Commit count: 0

cargo fmt