@unilim/edt-iut-info
v2.0.0
Published
A wrapper for the timetables of the IUT's computer science department.
Readme
edt-iut-info.unilim.fr
A wrapper and parser for the timetable PDFs of the IUT’s computer science department at the University of Limoges.
Every study year publishes one PDF per week, holding the lessons of all its groups and subgroups.
Usage
Latest timetable of a year
use unilim_edt_iut_info::{
OnlineTimetable,
TimetableYear,
};
let latest = OnlineTimetable
::get_latest_timetable_entry(
TimetableYear::A1,
).await?;
let timetable = latest
.get_timetable()
.await?;import {
OnlineTimetable,
TimetableYear,
} from "@unilim/edt-iut-info";
const latest = await OnlineTimetable
.getLatestTimetableEntry(
TimetableYear.A1,
);
const timetable = await latest
.getTimetable();Every published week
Entries are sorted by week number and carry the file name, the URL and the last update timestamp shown in the listing.
let entries = OnlineTimetable
::get_timetable_entries(
TimetableYear::A1,
).await?;
for entry in entries {
println!(
"S{} updated {}",
entry.week_number(),
entry.last_updated(),
);
}const entries = await OnlineTimetable
.getTimetableEntries(
TimetableYear.A1,
);
for (const entry of entries) {
console.log(
`S${entry.weekNumber}`,
"updated", entry.lastUpdated,
);
}Parse a local PDF
The week number and its dates come from the header of the PDF itself.
use unilim_edt_iut_info
::get_timetable_from_pdf;
let bytes = std::fs
::read("A1_S13.pdf")?;
let timetable =
get_timetable_from_pdf(bytes)
.await?;import {
getTimetableFromPdf,
} from "@unilim/edt-iut-info";
const bytes = await Bun
.file("A1_S13.pdf")
.bytes();
const timetable =
await getTimetableFromPdf(bytes);Lessons carry their group assignment: CM and special events apply to the
whole year, TD/DS to a main group, TP to a subgroup and SAE to
either.
License
GPL-3.0-or-later, see LICENSE.md. Not affiliated with the University of Limoges.
