UE Katowice class schedule utility library
Project description
UE Class schedule utility library
A utility library used to download, filter and export class schedule at University of Economics in Katowice. Imports data from "Wirtualna uczelnia".
Each students gets a constant schedule id which is used to generate the schedule.
You can get your ID by going to "Wirtualna uczelnia" > "Rozkład zajęć" > "Prezentacja harmonogramu zajęć" > "Eksport planu do kalendarza".
The url ends with /calendarid_XXXXXX.ics
, the XXXXXX will be your ID.
Installation
pip install ue-schedule
You can then run the ue-schedule tool from your shell like
ue-schedule <schedule_id>
Development
You can install dependencies in a virtualenv with poetry
# create virtualenv, install dependencies and switch to the virtualenv
poetry install
poetry shell
Linting and testing
# to lint and typecheck, in the root directory run:
flakehell lint
mypy .
# To run tests, run:
pytest
# there is a pre-commit hook that lints, typechecks and runs tests
# you can run it manually on all files with
pre-commit run -a
Usage
from ue_schedule import Schedule
# initialize the downloader
schedule = Schedule("<schedule id here>")
# get event list
schedule.get_events()
# get event list as iCalendar
schedule.get_ical()
# get event list as json
schedule.get_json()
Data is automatically fetched when exporting, but you can force fetch with
schedule.fetch()
If you need to dump the event list and load later
# dump the event list
events = schedule.dump_events()
# load the event list
schedule.load_events(events)
If there's a need to format the list acquired with .get_events()
, you can use format functions
# format event list as ical file
Schedule.format_as_ical(events)
# format event list as json
Schedule.format_as_json(events)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ue_schedule-3.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8beea3d45e9daac412246c52b8630e4ab2bbba481d62322dd5f80dd6e51d26c |
|
MD5 | 079043fcd23ed7007b24b90f6f8a5dd7 |
|
BLAKE2b-256 | 672861077d06d2e77150ef2d179d17071bf58a43afbba51446a0114755ed78bb |