pronotepy package

Submodules

pronotepy.dataClasses module

class pronotepy.dataClasses.Absences(parsed_json)

Bases: object

Teachers only. Represents the absences in a class.

class pronotepy.dataClasses.Average(parsed_json)

Bases: object

Represents an Average.

Attributes

Variables:
  • student – students average in the subject
  • class – classes average in the subject
  • max – highest average in the class
  • min – lowest average in the class
  • out_of – maximum amount of points
  • default_out_of – he default maximum amount of points
  • subject – subject the average is from
exception pronotepy.dataClasses.DataError

Bases: Exception

Base exception for any errors made by creating or manipulating data classes.

class pronotepy.dataClasses.File(client, parsed_json)

Bases: object

Represents a file uploaded to pronote.

Attributes

Variables:
  • name – Name of the file.
  • id – id of the file (used internally and for url)
  • url – url of the file
data

Gets the raw file data.

save(file_name=None)

Saves the file on to local storage.

Parameters:file_name (str) – file name
class pronotepy.dataClasses.Grade(parsed_json)

Bases: object

Represents a grade. You shouldn’t have to create this class manually.

Attributes

Variables:
  • id – the id of the grade (used internally)
  • grade – the actual grade
  • out_of – the maximum amount of points
  • default_out_of – the default maximum amount of points
  • date – the date on which the grade was given
  • subject – the subject in which the grade was given
  • period – the period in which the grade was given
  • average – the average of the class
  • max – the highest grade of the test
  • min – the lowest grade of the test
  • coefficient – the coefficient of the grade
class pronotepy.dataClasses.Homework(client, parsed_json)

Bases: object

Represents a homework. You shouldn’t have to create this class manually.

Attributes

Variables:
  • id – the id of the homework (used internally)
  • subject – the subject that the homework is for
  • description – the description of the homework
  • done – if the homework is marked done
  • date – deadline
files

Get all the files attached to the homework

set_done(status: bool)

Sets the status of the homework.

Parameters:status (bool) – The status to which to change
exception pronotepy.dataClasses.IncorrectJson

Bases: pronotepy.dataClasses.DataError

Bad json

class pronotepy.dataClasses.Lesson(client, parsed_json)

Bases: object

Represents a lesson with a given time. You shouldn’t have to create this class manually.

!!If a lesson is a pedagogical outing, it will only have the “outing” and “start” attributes!!

Attributes

Variables:
  • id – the id of the lesson (used internally)
  • subject – the subject that the lesson is from
  • teacher_name – name of the teacher
  • classroom – name of the classroom
  • canceled – if the lesson is canceled
  • outing – if it is a pedagogical outing
  • start – starting time of the lesson
  • group_name – Name of the group.
  • student_class – Teachers only. Class of the students
absences

Teachers only. Get the absences from the lesson.

content

Gets content of the lesson. .. note:: This property is very inefficient and will send a request to pronote, so don’t use it often.

class pronotepy.dataClasses.LessonContent(client, parsed_json)

Bases: object

Represents the content of a lesson. You shouldn’t have to create this class manually.

Attributes

Variables:
  • title – title of the lesson content
  • description – description of the lesson content
files

Get all the attached files from the lesson

class pronotepy.dataClasses.Message(client, json_)

Bases: object

Represents a message in a discussion.

Attributes

Variables:
  • id – the id of the message (used internally)
  • author – author of the message
  • recipients – Recipitents of the message. ! May be just [‘# recipients’] !
  • seen – if the message was seen
  • date – the date when the message was sent
content

Returns the content of the message

class pronotepy.dataClasses.Period(client, parsed_json)

Bases: object

Represents a period of the school year. You shouldn’t have to create this class manually.

Attributes

Variables:
  • id – the id of the period (used internally)
  • name – name of the period
  • start – date on which the period starts
  • end – date on which the period ends
averages

Get averages from the period.

grades

Get grades from the period.

overall_average

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)

class pronotepy.dataClasses.Student(parsed_json)

Bases: object

Represents a class of students

Attributes

Variables:
  • id – ID of the class
  • name – name of the class
class pronotepy.dataClasses.StudentClass(parsed_json)

Bases: object

Represents a class of students

Attributes

Variables:
  • id – ID of the class
  • name – name of the class
class pronotepy.dataClasses.Subject(parsed_json)

Bases: object

Represents a subject. You shouldn’t have to create this class manually.

Attributes

Variables:
  • id – the id of the subject (used internally)
  • name – name of the subject
  • groups – if the subject is in groups
class pronotepy.dataClasses.Util

Bases: object

Utilities for the API wrapper

classmethod get(iterable, **kwargs) → list

Gets items from the list with the attributes specified.

Parameters:iterable (list) – The iterable to loop over
classmethod prepare_json(data_class, json_dict)

Prepares json for the data class.

pronotepy.pronoteAPI module

class pronotepy.pronoteAPI.Client(pronote_url, ent: bool = False, cookies=None)

Bases: object

A PRONOTE client.

Parameters:
  • pronote_url (string) – URL of the server
  • ent (bool) – If the connection is from an ENT
  • cookies (cookies_jar) – Cookies for ENT connections
Variables:
  • start_day – The first day of the school year
  • week – The current week of the school year
current_period

Get the current period.

homework(date_from: datetime.date, date_to: datetime.date = None)

Get homework between two given points.

Parameters:
Returns:

Homework between two given points

Return type:

list

keep_alive()

Returns a context manager to keep the connection alive. When inside the context manager, it sends a “Presence” packet to the server after 5 minutes of inactivity from another thread.

lessons(date_from: datetime.date, date_to: datetime.date = None)

Gets all lessons in a given timespan.

Parameters:
Returns:

Lessons list in a given timespan

Return type:

list

login(username='', password='')

Logs in the user.

Parameters:
  • username (str) – Username
  • password (str) – Password
Returns:

True if logged in, False if not

Return type:

bool

messages()

Gets all the discussions in the discussions tab

Returns:Messages
Return type:list
periods

Get all of the periods of the year.

Returns:All the periods of the year
Return type:list
exception pronotepy.pronoteAPI.CryptoError

Bases: pronotepy.pronoteAPI.PronoteAPIError

Exception for known errors in the encryption.

exception pronotepy.pronoteAPI.PronoteAPIError

Bases: Exception

Base exception for any pronote api errors

Module contents