Data classes#
This section documents all data classes / models that pronotepy receives
from PRONOTE. It also includes a useful Util
class.
- class pronotepy.Util#
Utilities for the API wrapper
- class pronotepy.Object(json_dict: dict)#
Base object for all pronotepy data classes.
- to_dict(exclude: Set[str] = {}, include_properties: bool = False) dict #
Recursively serializes this object into a dict
Note
Does not check for loops, which are currently handled on a case to case basis.
- Parameters
exclude (Set[str]) – items to exclude from serialization
include_properties (bool) –
whether to evaluate properties. This may be useful for example for a
Period
for which you want to serialize its grades too.Period.grades
is a property that is evaluated only when called.Warning
Setting this option to True can be extremely inefficient!
- Returns
A dictionary containing all non-private properties
- Return type
- class pronotepy.Subject(parsed_json: dict)#
Represents a subject. You shouldn’t have to create this class manually.
- class pronotepy.Absence(json_dict: dict)#
Represents an absence with a given period. You shouldn’t have to create this class manually.
- from_date#
starting time of the absence
- Type
- to_date#
end of the absence
- Type
- class pronotepy.Period(client: ClientBase, json_dict: dict)#
Represents a period of the school year. You shouldn’t have to create this class manually.
- start#
date on which the period starts
- Type
- end#
date on which the period ends
- Type
- property evaluations: List[Evaluation]#
All evaluations from this period
- property overall_average: float#
Get overall average from the period. If the period average is not provided by pronote, then it’s calculated. Calculation may not be the same as the actual average. (max difference 0.01)
- property punishments: List[Punishment]#
All punishments from a given period
- class pronotepy.Grade(json_dict: dict)#
Represents a grade. You shouldn’t have to create this class manually.
- date#
the date on which the grade was given
- Type
- to_dict(exclude: Set[str] = {}, include_properties: bool = False) dict #
Recursively serializes this object into a dict
Note
Does not check for loops, which are currently handled on a case to case basis.
- Parameters
exclude (Set[str]) – items to exclude from serialization
include_properties (bool) –
whether to evaluate properties. This may be useful for example for a
Period
for which you want to serialize its grades too.Period.grades
is a property that is evaluated only when called.Warning
Setting this option to True can be extremely inefficient!
- Returns
A dictionary containing all non-private properties
- Return type
- class pronotepy.Attachment(client: ClientBase, json_dict: dict)#
Represents a attachment to homework for example
- class pronotepy.LessonContent(client: ClientBase, json_dict: dict)#
Represents the content of a lesson. You shouldn’t have to create this class manually.
- property files: List[Attachment]#
Get all the attached files from the lesson
- class pronotepy.Lesson(client: ClientBase, json_dict: dict)#
Represents a lesson with a given time. You shouldn’t have to create this class manually.
- start#
starting time of the lesson
- Type
- end#
end of the lesson
- Type
- property content: Optional[LessonContent]#
Gets content of the lesson. May be None if there is no description.
Note
This property is very inefficient and will send a request to pronote, so don’t use it often.
- class pronotepy.Homework(client: ClientBase, json_dict: dict)#
Represents a homework. You shouldn’t have to create this class manually.
- date#
deadline
- Type
- property files: List[Attachment]#
Get all the files and links attached to the homework
- class pronotepy.Information(client: ClientBase, json_dict: dict)#
Represents a information in a information and surveys tab.
- creation_date#
the date when the message was created
- Type
- start_date#
the date when the message became visible
- Type
- end_date#
the date on which the message will be withdrawn
- Type
- attachments#
- Type
List[Attachment]
if it is a shared template message
- Type
- class pronotepy.Recipient(client: ClientBase, json_dict: dict)#
Represents a recipient to create a discussion
- class pronotepy.Message(client: ClientBase, json_dict: dict)#
Represents a message in a discussion.
- date#
the date when the message was sent
- Type
- class pronotepy.Discussion(client: Client, json_dict: dict)#
Represents a discussion.
- date#
the date when the discussion was open
- Type
- replyable#
because pronotepy does not currently support replying to discussions that are inside other discussions, this boolean signifies if pronotepy is able to reply
- Type
- class pronotepy.ClientInfo(client: ClientBase, json_: dict)#
Contains info for a resource (a client).
- property address: tuple[str, str, str, str, str, str, str, str]#
Address of the client
- Returns
4 lines of address info
postal code
city
province
country
- Return type
A tuple of 8 elements
- property phone: str#
Phone of the client
- Returns
Phone in the format +[country-code][phone-number]
- Return type
- property profile_picture: Optional[Attachment]#
Profile picture of the client
- class pronotepy.Acquisition(json_dict: dict)#
Contains acquisition info for an evaluation.
- order#
Telling the order in which the acquisition is. The list of acquisitions is already sorted by this.
- Type
- class pronotepy.Evaluation(json_dict: dict)#
Data class for an evaluation.
- acquisitions#
- Type
List[Acquisition]
- date#
- Type
- class pronotepy.Student(client: ClientBase, json_dict: dict)#
Represents a student
- enrollment_date#
- Type
- date_of_birth#
- Type
- class pronotepy.StudentClass(client: ClientBase, json_dict: dict)#
Represents a class of students
- class pronotepy.Menu(client: ClientBase, json_dict: dict)#
Represents the menu of a meal
- date#
the date of the menu
- Type
- class pronotepy.Punishment(client: ClientBase, json_dict: dict)#
Represents a punishment.
- given#
Date and time when the punishment was given
- Type
- homework_documents#
Attached documents for homework
- Type
List[Attachment]
- circumstance_documents#
- Type
List[Attachment]
- schedule#
List of scheduled date-times with durations
- Type
List[ScheduledPunishment]
- duration#
- Type
- class ScheduledPunishment(client: ClientBase, json_dict: dict)#
Represents a sheduled punishment.
- start#
- Type
- duration#
- Type