The Hanze Digirooster API is an unofficial api to get information of the Hanze University time schedules.
- Install Python 3.x. During the installation keep the checkbox for "installing pip" checked
- Install requests via pip:
pip install requests
- Install cherrypy via pip:
pip install cherrypy
- Copy (and paste) "env_EXAMPLE.py" and change the name of the copy to "env.py". Edit the content of env.py according to your credentials for the Hanze Intranet.
- Run server.py via the commandline
python server.py
GET http://127.0.0.1:8080/schools
Retrieves all the schools currently available in the digirooster
Name | Description |
---|---|
LongName | Contains the name of the school |
ShortName | Contains the letter code of the school (3 or 4 letter code) |
ID | Contains the schoolId , that can be used further on in the API |
GET /schools HTTP/1.1
Host: 127.0.0.1:8080
[
{
"LongName": "Academie voor Architectuur, Bouwkunde & Civiele Techniek",
"ShortName": "SABC",
"ID": "F77859ED31A4449917C761E84E7208B2"
},
{
"LongName": "Academie Minerva",
"ShortName": "SABK",
"ID": "F77859ED31A4449917C761E84E7208AA"
},
...
]
GET http://127.0.0.1:8080/groups/_schoolId_/_studyYear_
Retrieves all the groups currently available in the digirooster, for a specific school and year
Name | Description |
---|---|
schoolId | Should contain the schoolId of the group. Can be retrieved via getSchools() |
studyYear | Should contain the year of the group: (1-4) |
Name | Description |
---|---|
resourceId |
Contains the (short) name of the group |
GET /groups/F77859ED31A4449917C761E84E720894/4 HTTP/1.1
Host: 127.0.0.1:8080
{
"48E0614F807625FDF612ED87670FB9E9": "BUDK",
"99030BAD69623C854AA2CF1AB103A3D3": "BUD4A",
"2928A60834C6C958AF19F1C73019593F": "IBV4B",
...
}
GET http://127.0.0.1:8080/schedule/_resourceID_
Retrieves the current timetable of a group (resource)
Name | Description |
---|---|
resourceID | Should contain the resourceID of the group. Can be retrieved via getGroups() |
Name | Description | |
---|---|---|
ScheduleId |
Contains the id of this schedule | |
ScheduleStart |
Contains a Unix timestamp with the starting date of this schedule | |
ScheduleEnd |
Contains a Unix timestamp with the ending date of this schedule | |
WeekData |
Contains a dict with data of the weeks: | |
WeekStart |
Unix timestamp | |
WeekEnd |
Unix timestamp | |
WeekNumber |
int | |
ActivityData |
Contains a dict with the activities: | |
Staff |
String , representing teacher |
|
Location |
String , representing location |
|
Left |
int , unknown property |
|
ID |
int , representing id |
|
Student |
String , representing the name of the group(s) taking this class |
|
Description |
String |
|
Start |
Unix timestamp , representing starting time of activity |
|
End |
Unix timestamp , representing ending time of activity |
|
Width |
int , unknown property |
|
Week |
int , representing weeknumber |
GET /schedule/99030BAD69623C854AA2CF1AB103A3C1 HTTP/1.1
Host: 127.0.0.1:8080
{
"ScheduleEnd": 1454686200000,
"ChangeData": [],
"ScheduleId": "99030BAD69623C854AA2CF1AB103A3D0",
"ActivityData": [
{
"Staff": "NIEV",
"Location": "EM/E143 C20",
"Left": 0,
"ID": "155689D466AB57A9D13D5E8E77744EAA",
"Student": "BF\ITV4B",
"Description": "T4.2 SE/practicum SA/SE",
"End": 1447759800000,
"Start": 1447752600000,
"Width": 100,
"Week": 47
},
...
"ScheduleStart": 1447666200000,
"WeekData": [
{
"WeekEnd": 1448060399999,
"WeekStart": 1447628400000,
"WeekNumber": 47
},
...
}
This code is specifically for made for educational purposes (for IT students of the Hanze University ), but I won't stop you from using it for a different purpose. I have no clue if you are allowed to use it, so you might want to contact the Hanze University if you're going to use it for something else.
Are you (an angry) legal counselor of the Hanze University? Please contact me through GitHub.
Do you want to help make this code better or write a better readme? Clone the repo, check out to different branch (with a descriptive name) and create a pull request ๐