Dataclasses¶
This is where the dataclasses used to represent the Classeviva API responses are defined.
They are used to represent the data returned by the API in a more structured and easy-to-use way.
Warning
These should NOT be manually constructed, as they are returned
by the methods from me.
In this case, parameters should be considered as attributes, and not as parameters. Dataclasses are frozen, which means that they’re immutable and cannot be changed after creation.
- class aiocvv.dataclasses.AbsenceDay(id, type, date, justified, position)¶
Represents an absence day. This could be either a full-day absence, a (small) delay or an early exit.
- Parameters:
id (
int) – The ID of the absence.type (
AbsenceCode) – The type of absence.date (
date) – The day of the absence.justified (
bool) – Whether the absence is justified.position (
Optional[int]) – The position of the delay or exit.
- class aiocvv.dataclasses.SchoolDay(date, weekday, status)¶
Represents a school day.
- Parameters:
date (
date) – The date.weekday (
Weekday) – The day weekday.status (
SchoolDayStatus) – The kind of day (normal, non-working, etc.).
- class aiocvv.dataclasses.PartialSubject(code, description)¶
Represents a partial subject.
- Parameters:
code (
str) – The subject code.description (
Optional[str]) – The subject description.
- class aiocvv.dataclasses.Event(id, type, start, end, full_day, author, class_desc, notes=None, homework=None, homework_item=None, subject=None)¶
Represents an agenda event.
- Parameters:
id (
int) – The ID of the event.type (
EventCode) – The kind of event (annotation, homework, or classroom reservation).start (
datetime) – The start date and time.end (
datetime) – The end date and time.full_day (
bool) – Whether the event is full-day or not.author (
str) – The author (a teacher in most cases) of the event.class_desc (
str) – The description of the classroom.notes (
Optional[str]) – The actual text of the event.homework (
Optional[int]) – The homework ID, if homework is provided.homework_item (
Optional[List[str]]) – The homework item, if homework is provided.subject (
Optional[PartialSubject]) – The subject of the event.
- class aiocvv.dataclasses.AgendaDay(date, events)¶
Represents a day for the agenda.
- Parameters:
date (
date) – The date.events (
List[Event]) – The events of the day.
- class aiocvv.dataclasses.Lesson(id, date, type, position, duration, class_desc, subject, status=None)¶
Represents a lesson.
- Parameters:
id (
int) – The ID of the lesson.date (
date) – The date of the lesson.type (
LessonEvent) – The type of lesson (normal or co-presence with and without support).position (
int) – The position of the lesson in that day.duration (
int) – The duration of the lesson.class_desc (
str) – The description of the classroom.subject (
PartialSubject) – The subject of the lesson.status (
Optional[LessonStatus]) – The status of the lesson.
- class aiocvv.dataclasses.MIURData(code, division)¶
Represents data provided from the MIUR.
- Parameters:
code (
str) – The school code.division (
str) – The school division code.
- class aiocvv.dataclasses.School(code, name, dedication, city, province, miur_data)¶
Represents a school.
- Parameters:
code (
str) – The school code.name (
str) – The school name.dedication (
str) – The dedication of the school.city (
str) – The city of the school.province (
str) – The province of the school.miur – The school’s data from MIUR.
miur_data (MIURData)
- class aiocvv.dataclasses.Note(id, type, end, date, text, read, author_name)¶
Represents a school note.
- Parameters:
id (
int) – The ID of the note.type (
NoteType) – The type of the note (annotation, disciplinary, warning and sanction).date (
date) – The day the note has been created.text (
str) – The text of the note.read (
bool) – Whether the note has been read.author_name (
str) – The name of the author of the note.end (
Optional[date]) – Optional. The day the disciplinary sanction ends. Only available whentypeis sanction.
- class aiocvv.dataclasses.Teacher(id, name)¶
Represents a teacher.
- Parameters:
id (
str) – The ID of the teacher.name (
str) – The name of the teacher.
- class aiocvv.dataclasses.Subject(id, description, order, teachers, grades)¶
Represents a subject.
- class aiocvv.dataclasses.Grade(subject, subject_code, id, code, date, value, display_value, position, family_notes, color, canceled, underlined, period, component_position, component_description, weight, grade_master_id, skill_id, skill_description, skill_code, skill_master_id)¶
Represents a subject grade.
- Parameters:
subject (
Subject) – The subject of the grade.subject_code (
str) – The subject’s shorter name.id (
int) – The ID of the grade.code (
GradeCode) – The kind of grade.date (
date) – The day the grade has been given.value (
Optional[int]) – The actual value of the grade. (e.g. 6.25)display_value (
str) – The display value of the grade. (e.g. 6.25 is displayed as 6+)position (
int) – The position of the grade.family_notes (
str) – The notes of the grade visible to family and students.color (
str) – The color of the grade.canceled (
bool) – Whether the grade has been canceled.underlined (
bool) – Whether the grade is underlined.period (
Period) – The period of the grade.component_position (
int) – The position of the component.component_description (
str) – The description of the component.weight (
int) – The weight of the grade.grade_master_id (
int) – The ID of the grade master.skill_id (
int) – The ID of the skill.skill_description (
str) – The description of the skill.skill_code (
str) – The code of the skill.skill_master_id (
int) – The ID of the skill master.
- class aiocvv.dataclasses.Day(date, weekday, status, lessons, agenda, events, grades, notes)¶
Represents a full overview of a day.
- Parameters:
date (
date) – The date.weekday (
Weekday) – The day weekday.status (
SchoolDayStatus) – The kind of day (normal, non-working, etc.).lessons (
List[Lesson]) – The lessons of that day.agenda (
List[Event]) – The events of that day.events (
List[AbsenceDay]) – The absences of that day.grades (
List[Grade]) – The grades of that day.notes (
List[Note]) – The notes of that day.