-
Notifications
You must be signed in to change notification settings - Fork 4
/
example.py
20 lines (16 loc) · 885 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pronotepy
# initialise the client
# Note: the address should be a direct one (like the one below) usually the address shown by your school just redirects
# you to the real one.
# Ex.: https://your-school.com/pronote/students <-- BAD
# https://0000000a.index-education.net/pronote/eleve.html <-- GOOD
client = pronotepy.Client('https://demo.index-education.net/pronote/eleve.html',
username='demonstration',
password='pronotevs')
if client.logged_in:
# get the all the periods (may return multiple types like trimesters and semesters but it doesn't really matter
# the api will get it anyway)
periods = client.periods
for period in periods:
for grade in period.grades: # iterate over all the grades
print(f'{grade.grade}/{grade.out_of}') # print out the grade in this style: 20/20