The Wilma rest client.
Supports getting daily data or date range of the resource. Valid resource types are rooms, teachers and students.
The Wilma JSON schema is quite complex to parse. The Easiest way utilize it, is use some framework, for example the MongoDB Aggregation Framework.
From git repo:
python3 WilmaJSONReader/reader.py rooms 01.01.2020 10.01.2020 some.domain.name user password apikey data/
As library:
from WilmaJSONReader import reader ... wilma_reader = reader.WilmaJSONReader( url, user, password, apikey, ) wilma_reader.login() dates = wilma_reader.get_dates("01.01.2020", "10.01.2020", logger) for day in dates: r = wilma_reader.get_schedule(day, "rooms") schedules = r.json() pprint(schedules)
Easiest way is install WilmaJSONReader from PyPi. Before installation create Python virtual environment or install it to container image.
Linux && Mac:
python3 -m venv venv source venv/bin/activate pip install WilmaJSONReader ... deactivate
Windows
https://docs.python.org/3.8/library/venv.html
Upgrade:
pip install WilmaJSONReader -U
Python 3.8 ->
GNU GENERAL PUBLIC LICENSE Version 3
WilmaJSONReader was written by Pasi Ollikainen.