https://github.com/pasiol/wilmajsonreader
https://github.com/pasiol/wilmajsonreader
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pasiol/wilmajsonreader
- Owner: pasiol
- License: gpl-3.0
- Created: 2020-12-02T14:25:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-04T14:09:46.000Z (over 5 years ago)
- Last Synced: 2024-11-16T20:34:52.276Z (over 1 year ago)
- Language: Python
- Size: 71.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
WilmaJSONReader
======================
.. image:: https://img.shields.io/pypi/v/WilmaJSONReader.svg
:target: https://pypi.python.org/pypi/WilmaJSONReader
:alt: Latest PyPI version
The Wilma rest client.
Supports getting daily data or date range of the resource. Valid resource types are rooms, teachers and students.
Usage
-----
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/
.. image:: https://github.com/pasiol/WilmaJSONReader/raw/main/images/rooms.png
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)
Installation
------------
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
``_
Upgrade::
pip install WilmaJSONReader -U
Requirements
^^^^^^^^^^^^
Python 3.8 ->
Compatibility
-------------
Licence
-------
GNU GENERAL PUBLIC LICENSE Version 3
Authors
-------
`WilmaJSONReader` was written by `Pasi Ollikainen `_.