You can initialize a Client directly with a username and password.
Requirements:
- The URL must be a direct link to your PRONOTE instance (e.g., ending in
eleve.html or parent.html) and must not include query parameters. - If you are logging in through an ENT (Environnement Numérique de Travail), you must pass an ENT-specific function (e.g.,
ac_reunion from pronotepy.ent) to the ent parameter to fetch cookies correctly.
High Security Accounts: If your account requires a PIN or recognizes devices, provide account_pin, device_name, and client_identifier. Once logged in, you can retrieve the client_identifier from the client instance to use in future sessions.
import pronotepy
from pronotepy.ent import ac_reunion
# Standard login via ENT
client = pronotepy.Client(
'https://demo.index-education.net/pronote/eleve.html',
username='demonstration',
password='pronotevs',
ent=ac_reunion
)
# Login for accounts with higher security (PIN/Device recognition)
client = pronotepy.Client(
'https://demo.index-education.net/pronote/eleve.html',
username='demonstration',
password='pronotevs',
account_pin="1111",
device_name="pronotepy",
client_identifier=None
)
# Retrieve identifier to use for future recognized device logins
identifier = client.client_identifier