SomPlus allows you to be notified by changes in grades and schedule through the Somtoday API.
It relies on the files refreshtoken.txt
, gradelist.pkl
, schedule.pkl
, week_number.txt
, and standard_schedule.pkl
. You can replace the .pkl
files with .json
files if you prefer that.
The auth for the Som API is a huge mess. To get the refreshtoken, I use the Somtoday SSO tool (in python), and store the token in refreshtoken.txt
. You can also use SomtodaySSOLogin (in js) to get the token.
The schedule section only uses items with a defined starting hour. Any items that do not align with standard lesson times are excluded. You could save all the times directly from the data, but the notification generator won't work then.
To make the script work, you will need to adjust the following things. These will differ across schools:
-
lln_id
ingrades_main
This is not the "leerlingnummer" but the ID you get via/rest/v1/account/
. -
Removing the column types in
grades_main
You can find all the column types in the raw data from/rest/v1/resultaten/huidigVoorLeerling/...
. Usually, thetoetskolom
is needed if you're working with grades from tests. If you're working with period or report grades, you will need either thePeriodeGemiddeldeKolom
orRapportGemiddeldeKolom
. On most schools one of them is rounded and the other is not (I think), but it differs, so just look wich one does the thing you want :D -
subjects_to_remove
ingrades_main
-
maximum_amount_lessons
inschedule_notification_generator
,schedule_main
, andsaveStandardSchedule.py
-
subjects_in_schedule
inschedule_main
-
btoken
insaveStandardSchedule.py
You only need to save a new standard schedule if you have a new one, so you can just generate a extra token when you need to run this script
The Sheet Updater is quite inefficient and very specific, but you may find it helpful.
- Go to the Google Cloud Console and create a new project (or use an existing one)
- Enable the Google Sheets API and Google Drive API under APIs & Services > Library
- Create a Service Account by going to APIs & Services > Credentials > Create Credentials and add at least editor permissions
- On the service account page, create a key and download the JSON file
- Share your spreadsheet with the service account email (found on the service account page) and give editor permissions