EcoleDirecte
EcoleDirecte is a simple to use module that allows you to interact with EcoleDirecte API.
Installation
npm i @kamkam1_0/ecoledirecte
Initiation
const EcoleDirecte = require("@kamkam1_0/ecoledirecte")
const Account = new EcoleDirecte.Account("LOGIN ID", "LOGIN PASSWORD")
let session = await Account.login()
How to use - Etudiant
Marks
let marks = await session.getMarks()
Mails
let mails = await session.getMails()
Mails - Search
let mails = await session.searchMails(query)
Periodes
let periodes = await session.getPeriods()
Subjects
let subjects = await session.getSubjects()
Teachers
let teachers = await session.getTeachers()
Schedule
let schedule = await session.getSchedule()
Picture
Get the buffer of your profil picture
let picture = await session.downloadProfilePicture()
Staff
let staff = await session.getStaff()
HomeWork
let homeWork = await session.getHomework()
HomeWork with a day
You can also get homework for a specific day (including what you have to do)
let homeWork = await session.getHomeworkByDay(day)
Cloud
let cloud = await session.getCloud()
Documents
let documents = await session.getDocuments()
School Life
let schoolLife = await session.getSchoolOffice()
Marks Average
Mars variable is the marks you get with the .getMarks method.
Periods variable is the periods you get with the .trons in the .getMarks method.
Period variable refers the code of the period. For exemple: A001.
let moyenne = await session.calculateAverage(marks, periods, period)
Downloading files
id variable is the id of the file.
Type is a letter/word that indicates the page you want to download your file from:
- D for the homwork page
- M for the mail page
- C for the cloud
- doc for the document page
let document = await session.download(id, type)
How to use - Parent
The Parent account works the same as the Student one.
The available methods are:
- getMails
- getFinancialSituation
- getInfo
- getDocuments
Children
To see information about the cildren linked to the parent account you can use the getChildren method.
You can either provide the name of the child or his index in the array of the property enfants.
let child = await session.getChildren('John')
The child is a student, therefore you can use all the methods listed above.