Repository navigation
Timeline
The Timeline module combines student-centric activity tracking (new assignments, grades, school messages) and smart data analysis across academic and school life behaviors to reveal valuable performance correlations.
Let's read the latest events from the student's personalized timeline:
import { Litedirecte } from "litedirecte";
const ld = new Litedirecte();
await ld.auth.login("your_username", "your_password");
const events = await ld.timeline.getTimeline();
console.log(`There are ${events.length} recent events on your feed:`);
events.slice(0, 5).forEach(event => {
console.log(`- [${event.typeElement}] ${event.titre || "Activity update"}`);
if (event.soustitre) console.log(` Detail: ${event.soustitre}`);
});Let's run the smart correlation engine to see statistical performance trends!
import { Litedirecte } from "litedirecte";
const ld = new Litedirecte();
await ld.auth.login("your_username", "your_password");
const correlations = await ld.grades.correlate();
correlations.forEach(insight => {
if (insight.type === "gradeTrend") {
console.log(`📈 Trend in [${insight.subject}]: Overall calculated average is ${insight.data.average.toFixed(2)}/20 (Based on ${insight.observations} observations).`);
} else if (insight.type === "gradeVsDayOfWeek") {
console.log(`📅 Weekly patterns in [${insight.subject}]:`);
for (const [day, average] of Object.entries(insight.data)) {
console.log(` • ${day}: ${average.toFixed(1)}/20`);
}
}
});Retrieves a chronologically ordered list of events relevant to the logged-in student.
ld.timeline.getTimeline(): Promise<any>Fetches general school notices, bulletins, and shared announcements. Litedirecte automatically decodes French HTML "sticky notes" (stickyNotes) for you in the process, including multi-line (chunked) Base64 payloads.
ld.timeline.getCommonTimeline(): Promise<any>Runs an advanced correlation pass across different modules (grades and attendance) to construct statistical insights.
Note: Litedirecte only includes subjects in the analysis that have at least 5 graded entries to maintain statistical reliability.
ld.grades.correlate(): Promise<Correlation[]>ld.timeline.getTimeline resolves to the raw EcoleDirecte API payload (treated as any). Litedirecte preserves the API's original key names and only normalizes values (date strings become Date, base64 fields are decoded).
interface Correlation {
type: CorrelationType; // Category of correlation analysis
subject: string; // Subject name being analyzed
finding: string; // Brief summary of findings
data: Record<string, number>; // Key-value statistics map (averages, days, etc.)
confidence: number; // Statistical confidence score (from 0 to 1)
observations: number; // Number of entries/data-points analyzed
}type CorrelationType =
| "gradeVsPresence"
| "gradeVsDayOfWeek"
| "gradeVsTimeOfDay"
| "homeworkVsGrade"
| "gradeTrend";getTimeline() and getCommonTimeline() are maintained entries: served instantly and refreshed by the poller and by ld.getAll(). Every read accepts { force: true } to skip the cache. See Cache & sync.
© 2026 typeof (Scolup) | Licensed under AGPL 3.0