librus-python-api 1.9.0__tar.gz → 1.10.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/API.md +61 -3
  2. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/CHANGELOG.md +79 -0
  3. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/PKG-INFO +9 -4
  4. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/README.md +8 -3
  5. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/pyproject.toml +10 -0
  6. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/__init__.py +11 -1
  7. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/config.py +66 -2
  8. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/diagnostics.py +1 -0
  9. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/gateway_grades.py +205 -107
  10. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/grade_records.py +78 -16
  11. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/inspect_page.py +10 -0
  12. librus_python_api-1.10.1/src/librus_python_api/justifications.py +238 -0
  13. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/models.py +89 -0
  14. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/parsers.py +7 -0
  15. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/service.py +52 -7
  16. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/uv.lock +122 -112
  17. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/.gitignore +0 -0
  18. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/LICENSE +0 -0
  19. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/SECURITY.md +0 -0
  20. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/_notification_bootstrap.py +0 -0
  21. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/_notification_codec.py +0 -0
  22. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/_storage.py +0 -0
  23. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/_windows_filesystem.py +0 -0
  24. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/announcements.py +0 -0
  25. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/attachment_routes.py +0 -0
  26. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/attachments.py +0 -0
  27. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/attendance.py +0 -0
  28. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/attendance_frequency.py +0 -0
  29. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/budget.py +0 -0
  30. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/checkpoint.py +0 -0
  31. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/class_free_days.py +0 -0
  32. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/completed_lessons.py +0 -0
  33. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/detail_fields.py +0 -0
  34. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/exceptions.py +0 -0
  35. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/files.py +0 -0
  36. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/formative_grades.py +0 -0
  37. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/grade_parsers.py +0 -0
  38. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/homework_range.py +0 -0
  39. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/lifecycle.py +0 -0
  40. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/markup.py +0 -0
  41. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/message_content.py +0 -0
  42. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/messages.py +0 -0
  43. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/modern_body.py +0 -0
  44. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/modern_mailbox.py +0 -0
  45. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/modern_messages.py +0 -0
  46. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/notification_models.py +0 -0
  47. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/notification_persistence.py +0 -0
  48. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/notification_workflow.py +0 -0
  49. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/notifications.py +0 -0
  50. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/parsing.py +0 -0
  51. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/persistence.py +0 -0
  52. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/py.typed +0 -0
  53. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/recipients.py +0 -0
  54. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/scheduler.py +0 -0
  55. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/school_reads.py +0 -0
  56. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/school_year_archive.py +0 -0
  57. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/sending.py +0 -0
  58. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/timetable.py +0 -0
  59. {librus_python_api-1.9.0 → librus_python_api-1.10.1}/src/librus_python_api/transport.py +0 -0
@@ -225,12 +225,16 @@ source)` with an aware UTC timestamp.
225
225
  - `averages`: `SchoolAverage` as school-provided text. Nothing is computed.
226
226
  - `corrections` (1.9.0): `GradeCorrection`s, see
227
227
  [grade IDs and corrections](#grade-ids-and-corrections-190).
228
+ - `behaviour_points` (1.10.0): `BehaviourPoints`, see
229
+ [behaviour points](#behaviour-points-1100).
228
230
  - `grades_window(start=None, end=None, view=GradeView.ALL)` filters the selected
229
231
  collection to inclusive civil dates. Either boundary may be omitted; two
230
232
  supplied dates may be at most 370 days apart. `GradeWindow.view` records the
231
233
  selection. It reuses only that view's cache; averages and undated summaries
232
234
  remain outside the window. `GradeWindow.corrections` keeps every correction
233
235
  with at least one of its grades in the window, whole.
236
+ `GradeWindow.behaviour_points` keeps each item with an entry in the window,
237
+ with only those entries.
234
238
 
235
239
  ### Grade IDs and corrections (1.9.0)
236
240
 
@@ -267,6 +271,38 @@ Requested in krzysztofbury/librus-mcp#88.
267
271
  `inspect_page grades` (its `corrections` count) show the brackets.
268
272
  See [correction brackets](contracts/grades.md#grade-ids-and-correction-brackets-190-librus-mcp88).
269
273
 
274
+ ### Behaviour points (1.10.0)
275
+
276
+ Asked for in #76. Schools that grade behaviour with points show them in the
277
+ `Zachowanie` row of the grades page. `GradeRecords.behaviour_points` holds one
278
+ `BehaviourPoints(semester, tally, entries)` per period cell with points, apart
279
+ from grades; no grade or summary type is reused.
280
+
281
+ - `semester` is the period whose current-grade column holds the cell.
282
+ - `tally` is the integer the cell shows. Whether it is the starting points or a
283
+ running total is not established, so it is not interpreted, and `entries`
284
+ are never summed or compared with it.
285
+ - Each `BehaviourPointEntry(points, detail_id, category, day, metadata)` has its
286
+ signed points, the ID of its behaviour detail link (recognised, never
287
+ requested), its tooltip's unlabelled first line as `category`, `day` from
288
+ `Data wystawienia`, and the labelled lines (`Zakres od`, `Zakres do`,
289
+ `Data wystawienia`, `Dodał`, `Komentarz`) in `metadata`.
290
+ - A cell with the tally alone has no entries. A page without points gives `()`.
291
+ - Any other tooltip label, a missing first line or date, other content beside
292
+ the tally or a tally outside the behaviour row raises `ParseError`. Entries
293
+ count toward the grade record bound (`LimitError`). A tally alone in a cell
294
+ spanning both periods parses but gives no item, since its period would be a
295
+ guess.
296
+ - `grades_window(...)` keeps an item when one of its entries falls in the
297
+ window, with only those entries and the tally; a tally alone stays outside,
298
+ like averages.
299
+ - Grades, averages and notification identities are the same as before; behaviour
300
+ grade symbols (1.8.3) stay `NumericGrade`s. `inspect_page grades` reports
301
+ `behaviour_points` and `behaviour_point_entries` counts.
302
+
303
+ The layout comes from two schools' pages seen offline (2026-10-18); no live
304
+ login with points was available. See [grades](contracts/grades.md).
305
+
270
306
  ### School-year archive (1.3.0)
271
307
 
272
308
  `school_year_archive(*, budget=None, max_age_seconds=0.0)` returns
@@ -332,7 +368,7 @@ line (such as `wzorowe`), `day` is `Data wystawienia`, `teacher` stays `None`
332
368
  and `Dodał` is kept only in `metadata`. See [grades](contracts/grades.md).
333
369
 
334
370
  Schools on the new descriptive grading schema show a subject table
335
- (`newSchemaGradesByStudentTable`) in one of two layouts. Every view checks it
371
+ (`newSchemaGradesByStudentTable`) in one of three layouts. Every view checks it
336
372
  the same way (from 1.8.4; before, only the `ALL` view did):
337
373
 
338
374
  - Empty semester cells (`gradesCell` hooks) that the page script fills from
@@ -341,9 +377,16 @@ the same way (from 1.8.4; before, only the `ALL` view did):
341
377
  - Semester cells holding bare text, such as `5` or `Brak ocen` (1.8.3). The
342
378
  text becomes undated `descriptive_summaries` (`Brak ocen` is empty) and no
343
379
  view makes a gateway request. Undated summaries are not notified.
380
+ - Semester cells holding grade boxes such as `O` or `C+`, with filled detail
381
+ rows (1.10.1, #173). The boxes become dated `DescriptiveGrade`s in
382
+ `descriptive` (kind `CURRENT`, no `href`), with `Obszar oceniania`,
383
+ `Umiejętność` and the other tooltip lines in `metadata`, and no view makes a
384
+ gateway request. The detail rows must list the same grades, value and date,
385
+ in the same order; otherwise, or when a detail grade has `Treść oceny` text,
386
+ the read raises `UnsupportedCapabilityError`.
344
387
  - Anything else fails the read: blank cells without hooks, a cell with an
345
- attribute or markup, both layouts in one table, a bare-text table that still
346
- has `studentGradesDetailsRow` rows (`UnsupportedCapabilityError`), or rows
388
+ attribute or markup, mixed layouts in one table, a bare-text table that still
389
+ has empty `studentGradesDetailsRow` rows (`UnsupportedCapabilityError`), or rows
347
390
  of more than one student (`ParseError`).
348
391
 
349
392
  Gateway descriptive grades (1.8.0): with the empty layout, the `ALL` view
@@ -394,6 +437,21 @@ optional paired `lesson_no_from`/`lesson_no_to`. One bounded read-only GET;
394
437
  reference URLs are not followed and type labels are not inferred. An explicit
395
438
  empty collection returns `items=()`. See [contract](contracts/class-free-days.md).
396
439
 
440
+ ### e-Justifications
441
+
442
+ `justifications(*, budget=None, max_age_seconds=0.0)` returns frozen
443
+ `Justifications` with `identity`, `window_start`, `window_end`, `items` and
444
+ `observation`. Each `Justification` has civil `start`/`end`, `lessons` (lesson
445
+ numbers of a one-day entry, empty for a range), `absence_count`, `content`,
446
+ `teachers`, naive local `sent_at`, `status` (`JustificationStatus.SENT`,
447
+ `JUSTIFIED` or `REJECTED`), `decided_by` (the decider's name as text, or
448
+ `None`) and `has_attachment`. One GET of the list in the window the page shows
449
+ by default; entries sent before `window_start` may be missing. Only a login
450
+ whose identity response reports `Me.Account.GroupId` 5 (both parent logins
451
+ observed) sends the request; any other or missing group (8 on both student
452
+ logins, where the page ends the session) raises `UnsupportedCapabilityError`
453
+ without it. See [contract](contracts/justifications.md).
454
+
397
455
  ### Weekly timetable
398
456
 
399
457
  `timetable(monday)` takes a `date` that is a Monday and returns `Timetable` with
@@ -1,5 +1,84 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.1 (2026-11-15) - Descriptive grades shown as grade boxes
4
+
5
+ Thank you, @sanyok-ua, for the sanitized pages on #76 that showed this layout (#173).
6
+
7
+ - Grades: a new-schema descriptive table whose semester cells hold grade boxes
8
+ (such as `O` or `C+`) and whose hidden detail rows the page already filled
9
+ made every grades read fail with `UnsupportedCapabilityError`. The boxes are
10
+ now `DescriptiveGrade`s in `descriptive` (kind `CURRENT`, no `href`), with
11
+ `Obszar oceniania`, `Umiejętność`, `Data`, `Nauczyciel`, `Dodał` and
12
+ `Komentarz` in `metadata`, and no view makes a gateway request for such a
13
+ table. The detail rows must list the same grades, value and date, in the
14
+ same order. A detail grade with `Treść oceny` text, which the boxes do not
15
+ carry, a missing, extra or empty detail row, other columns, a semester cell
16
+ with other content, or a table mixing layouts still fails closed. So does a
17
+ table with empty script hooks whose detail rows hold a table, which used to
18
+ go on to the gateway read and could have counted grades twice.
19
+ - `Obszar oceniania` and `Umiejętność` are known tooltip labels
20
+ (`config.TOOLTIP_LABELS`), so failure diagnostics show them by name.
21
+ - The layout follows two sanitized pages the reporter checked with
22
+ `inspect_page`, with original fixtures. None of the owner's four logins shows
23
+ it; their live grade reads gave the same counts with and without the change.
24
+
25
+ ## 1.10.0 (2026-11-13) - Behaviour points and e-Justifications
26
+
27
+ Thank you, @sanyok-ua, for reporting #76 and asking for behaviour points as a
28
+ value. Existing signatures are unchanged; the additions are listed below.
29
+
30
+ - Grades: `GradeRecords.behaviour_points` and `GradeWindow.behaviour_points`
31
+ hold the `Zachowanie` row's points (#138), apart from grades, as
32
+ `BehaviourPoints(semester, tally, entries)` with `BehaviourPointEntry(points,
33
+ detail_id, category, day, metadata)`. The tally is the integer the cell
34
+ shows; it is not interpreted as starting points or a running total, and
35
+ entries are never summed. A window keeps an item with an entry inside it,
36
+ with only those entries. Pages without points give `()`; grades, averages and
37
+ notification identities do not change.
38
+ - Grades: a point entry's tooltip is now read. A label other than `Zakres od`,
39
+ `Zakres do`, `Data wystawienia`, `Dodał` and `Komentarz`
40
+ (`config.BEHAVIOUR_POINT_LABELS`), a missing first line or a missing date
41
+ raises `ParseError`; before, the tooltip was not read and such a page
42
+ parsed. So does a point table showing different points for the same period.
43
+ A tally alone in a cell spanning both periods still parses and gives no
44
+ item, since its period would be a guess.
45
+ - Point entries count toward `GRADE_MAX_RECORDS` with the grades; an item the
46
+ point table repeats counts once.
47
+ - `inspect_page grades` reports `behaviour_points` and
48
+ `behaviour_point_entries` counts.
49
+ - The layout follows two schools' pages seen offline on 2026-10-18 with
50
+ original synthetic fixtures; no live login with points was available.
51
+
52
+ - New read `AccountClient.justifications()` returns the e-Justifications list
53
+ (`/eusprawiedliwienia`) as typed `Justifications`: the page's default window
54
+ (`window_start`, `window_end`) and each `Justification` with its period or
55
+ day and lessons, absence count, content, notified teachers, sent time,
56
+ `JustificationStatus` and the decider's name. One GET, no filter POST; older
57
+ entries may be missing. Structure observed on two parent logins on
58
+ 2026-11-13 (issue #137).
59
+ - `justifications()` sends its request only for a login whose identity
60
+ reports `Me.Account.GroupId` 5 (both parent logins observed). Any other or
61
+ missing group raises `UnsupportedCapabilityError` with no request: opening
62
+ the list on a student login (`GroupId` 8) ends its session (owner live
63
+ check, 2026-11-13). A parent login that gets the logged-out page signs in
64
+ again once, as for any read. `GroupId` is parsed internally as an optional
65
+ integer; `Identity` is unchanged.
66
+ - New route `justifications` in `config.ENDPOINTS` and the OpenAPI contract;
67
+ `inspect_page justifications`; the list's header labels are named in failure
68
+ diagnostics.
69
+ - Weekly live check: new step `justifications` (slot 0 `any`, slot 1
70
+ `unavailable`).
71
+
72
+ Other changes:
73
+
74
+ - Gateway grades: the pagination check reads the member recorded on
75
+ 2026-11-13 (`pagination` = `{limit, page, total}` integers) and nothing else,
76
+ instead of guessing key names. A total above the items received or a page
77
+ other than 1 still fails as `UNSUPPORTED_CAPABILITY`; non-integer or
78
+ inconsistent values fail as `PARSE`. A PartialGrades response without the
79
+ member is rejected; Subjects (no member) parses. Users now validates the
80
+ member when present. Requests are unchanged (#136).
81
+
3
82
  ## 1.9.0 (2026-11-08) - Grade IDs and correction links
4
83
 
5
84
  Thank you, @nawa, for raising krzysztofbury/librus-mcp#88 with a clear
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: librus-python-api
3
- Version: 1.9.0
3
+ Version: 1.10.1
4
4
  Summary: Independent bounded async Librus Synergia client
5
5
  Project-URL: Repository, https://github.com/krzysztofbury/librus-python-api
6
6
  Project-URL: Issues, https://github.com/krzysztofbury/librus-python-api/issues
@@ -42,7 +42,12 @@ private ACLs. Windows installations include `pywin32` and `tzdata` automatically
42
42
  Network paths, reparse-point paths and unsafe storage permissions fail closed.
43
43
  See [platform requirements](contracts/persistence.md#windows-disk-boundary-25).
44
44
 
45
- **Status:** `1.9.0` gives every ordinary grade its stable Librus ID (`grade_id`)
45
+ **Status:** `1.10.1` reads descriptive grades that the new-schema table
46
+ shows as grade boxes. `1.10.0` returns behaviour points as a typed value
47
+ (`GradeRecords.behaviour_points`), reads the e-Justifications list on parent
48
+ logins (`AccountClient.justifications()`) and checks the gateway grade
49
+ pagination member recorded live.
50
+ `1.9.0` gives every ordinary grade its stable Librus ID (`grade_id`)
46
51
  and links a corrected grade to its corrections, as the all view brackets them
47
52
  (`GradeRecords.corrections`, [grade corrections](API.md#grade-ids-and-corrections-190)).
48
53
  `1.8.4` reads multi-line formative assessment text and repeated
@@ -72,7 +77,7 @@ See [limitations](#supported-features-and-limitations) below.
72
77
  Install the exact release from PyPI after its gated publication completes:
73
78
 
74
79
  ```sh
75
- python -m pip install librus-python-api==1.9.0
80
+ python -m pip install librus-python-api==1.10.1
76
81
  ```
77
82
 
78
83
  Pin the exact version qualified by your application. Before publication, use a
@@ -88,7 +93,7 @@ python -m pip install .
88
93
  To install a locally built wheel instead:
89
94
 
90
95
  ```sh
91
- python -m pip install ./dist/librus_python_api-1.9.0-py3-none-any.whl
96
+ python -m pip install ./dist/librus_python_api-1.10.1-py3-none-any.whl
92
97
  ```
93
98
 
94
99
  No console script or background process is installed: import the library in your
@@ -16,7 +16,12 @@ private ACLs. Windows installations include `pywin32` and `tzdata` automatically
16
16
  Network paths, reparse-point paths and unsafe storage permissions fail closed.
17
17
  See [platform requirements](contracts/persistence.md#windows-disk-boundary-25).
18
18
 
19
- **Status:** `1.9.0` gives every ordinary grade its stable Librus ID (`grade_id`)
19
+ **Status:** `1.10.1` reads descriptive grades that the new-schema table
20
+ shows as grade boxes. `1.10.0` returns behaviour points as a typed value
21
+ (`GradeRecords.behaviour_points`), reads the e-Justifications list on parent
22
+ logins (`AccountClient.justifications()`) and checks the gateway grade
23
+ pagination member recorded live.
24
+ `1.9.0` gives every ordinary grade its stable Librus ID (`grade_id`)
20
25
  and links a corrected grade to its corrections, as the all view brackets them
21
26
  (`GradeRecords.corrections`, [grade corrections](API.md#grade-ids-and-corrections-190)).
22
27
  `1.8.4` reads multi-line formative assessment text and repeated
@@ -46,7 +51,7 @@ See [limitations](#supported-features-and-limitations) below.
46
51
  Install the exact release from PyPI after its gated publication completes:
47
52
 
48
53
  ```sh
49
- python -m pip install librus-python-api==1.9.0
54
+ python -m pip install librus-python-api==1.10.1
50
55
  ```
51
56
 
52
57
  Pin the exact version qualified by your application. Before publication, use a
@@ -62,7 +67,7 @@ python -m pip install .
62
67
  To install a locally built wheel instead:
63
68
 
64
69
  ```sh
65
- python -m pip install ./dist/librus_python_api-1.9.0-py3-none-any.whl
70
+ python -m pip install ./dist/librus_python_api-1.10.1-py3-none-any.whl
66
71
  ```
67
72
 
68
73
  No console script or background process is installed: import the library in your
@@ -44,6 +44,16 @@ dev = [
44
44
  "pytest-timeout>=2.3,<3",
45
45
  ]
46
46
 
47
+ [tool.uv]
48
+ # Supply-chain window: resolution ignores files uploaded in the last 7 days,
49
+ # so a freshly published (possibly compromised) release never reaches the lock.
50
+ # The lock stores only the window, so it does not change from day to day.
51
+ exclude-newer = "7 days"
52
+ # The project's own releases are exempt: the release workflow's `confirm` job
53
+ # installs the version uploaded seconds earlier from this checkout. Their
54
+ # dependencies stay inside the window.
55
+ exclude-newer-package = { librus-python-api = false }
56
+
47
57
  [tool.hatch.version]
48
58
  path = "src/librus_python_api/__init__.py"
49
59
 
@@ -1,7 +1,7 @@
1
1
  """Independent bounded async client. General live compatibility is unqualified."""
2
2
 
3
3
  # Before the imports: config reads it for the User-Agent.
4
- __version__ = "1.9.0"
4
+ __version__ = "1.10.1"
5
5
 
6
6
  from librus_python_api.attachments import AttachmentStream, ModernAttachmentStream
7
7
  from librus_python_api.budget import RequestBudget
@@ -38,6 +38,8 @@ from librus_python_api.models import (
38
38
  AttendanceView,
39
39
  AttendanceWindow,
40
40
  Availability,
41
+ BehaviourPointEntry,
42
+ BehaviourPoints,
41
43
  ClassFreeDay,
42
44
  ClassFreeDays,
43
45
  CompletedLesson,
@@ -64,6 +66,9 @@ from librus_python_api.models import (
64
66
  HomeworkItem,
65
67
  HomeworkRangeRequest,
66
68
  Identity,
69
+ Justification,
70
+ Justifications,
71
+ JustificationStatus,
67
72
  LuckyNumber,
68
73
  MessageAttachment,
69
74
  MessageAttachmentReference,
@@ -259,6 +264,8 @@ __all__ = [
259
264
  "DescriptiveGradeSummary",
260
265
  "FinalGrades",
261
266
  "FormativeGrade",
267
+ "BehaviourPointEntry",
268
+ "BehaviourPoints",
262
269
  "GradeCorrection",
263
270
  "GradeKind",
264
271
  "GradeRecords",
@@ -267,6 +274,9 @@ __all__ = [
267
274
  "GradeView",
268
275
  "GradeWindow",
269
276
  "Identity",
277
+ "Justification",
278
+ "Justifications",
279
+ "JustificationStatus",
270
280
  "LibrusService",
271
281
  "LuckyNumber",
272
282
  "NumericGrade",
@@ -503,6 +503,17 @@ ENDPOINTS: Mapping[str, Endpoint] = MappingProxyType(
503
503
  True,
504
504
  Evidence.INDEPENDENTLY_OBSERVED,
505
505
  ),
506
+ # The e-Justifications list as the page shows it unfiltered. Both
507
+ # parent logins got it, both student logins the "Brak dostępu"
508
+ # page (2026-11-13). The filter form's POST is not used.
509
+ Endpoint(
510
+ "justifications",
511
+ "GET",
512
+ "/eusprawiedliwienia",
513
+ SideEffect.NONE,
514
+ True,
515
+ Evidence.INDEPENDENTLY_OBSERVED,
516
+ ),
506
517
  Endpoint(
507
518
  "gateway_attendance",
508
519
  "GET",
@@ -749,11 +760,13 @@ TOOLTIP_LABELS = frozenset(
749
760
  "Maksymalna ilość punktów",
750
761
  "Nauczyciel",
751
762
  "Obowiązek wyk. zadania",
763
+ "Obszar oceniania",
752
764
  "Ocena",
753
765
  "Poprawa oceny",
754
766
  "Rodzaj",
755
767
  "Suma punktów",
756
768
  "Temat zajęć",
769
+ "Umiejętność",
757
770
  "Waga",
758
771
  "Zakres do",
759
772
  "Zakres od",
@@ -796,12 +809,29 @@ GRADE_PERIOD_HEADERS = MappingProxyType(
796
809
  "Ocena roczna": 0,
797
810
  }
798
811
  )
799
- # New-schema descriptive grading: the page renders this table either with empty
812
+ # New-schema descriptive grading: the page renders this table with empty
800
813
  # `gradesCell` semester cells, which its script fills from the gateway routes
801
- # above, or with bare semester text, which needs no gateway read.
814
+ # above, with bare semester text, or with grade boxes and filled detail rows;
815
+ # the last two need no gateway read.
802
816
  DESCRIPTIVE_TABLE_CLASS = "newSchemaGradesByStudentTable"
803
817
  DESCRIPTIVE_ROW_CLASS = "studentRow"
804
818
  DESCRIPTIVE_DETAILS_ROW_CLASS = "studentGradesDetailsRow"
819
+ DESCRIPTIVE_DETAILS_CELL_CLASS = "studentGradesDetailsCell"
820
+ # A filled detail row's table (2026-11-15, reported page, #173): these column
821
+ # labels, then per period a heading row with one `DESCRIPTIVE_PERIOD_LABELS` cell and
822
+ # either `detail-grades` rows or one empty-marker row.
823
+ DESCRIPTIVE_DETAIL_COLUMNS = (
824
+ "Ocena",
825
+ "K",
826
+ "Obszar oceniania",
827
+ "Umiejętność",
828
+ "Data",
829
+ "Nauczyciel",
830
+ "Treść oceny",
831
+ "Dodał",
832
+ )
833
+ DESCRIPTIVE_DETAIL_GRADE_ROW_CLASS = "detail-grades"
834
+ DESCRIPTIVE_PERIOD_LABELS = MappingProxyType({"Okres 1": 1, "Okres 2": 2})
805
835
  # Gateway account and student identifiers are opaque strings, unlike every
806
836
  # other `{id}` route, which takes a numeric ID.
807
837
  DESCRIPTIVE_IDENTIFIER = re.compile(r"[A-Za-z0-9_-]{1,128}")
@@ -877,6 +907,11 @@ FORMATIVE_DETAIL_PATH_PREFIX = "/przegladaj_oceny/szczegoly/ksztaltujace/"
877
907
  BEHAVIOUR_POINTS_DETAIL_PATH_PREFIX = "/przegladaj_oceny/zachowanie_szczegoly/"
878
908
  # Tooltip labels of a behaviour grade symbol entry (#114, synthetic example).
879
909
  BEHAVIOUR_GRADE_LABELS = frozenset({"Data wystawienia", "Dodał", "Komentarz"})
910
+ # Tooltip labels after a behaviour-point entry's unlabelled first line, as the
911
+ # 1.6.2 synthetic entry has them; any other label fails the read (#138).
912
+ BEHAVIOUR_POINT_LABELS = frozenset(
913
+ {"Zakres od", "Zakres do", "Data wystawienia", "Dodał", "Komentarz"}
914
+ )
880
915
  # Recognition only: point-grade detail links are classified, never requested.
881
916
  POINT_GRADE_DETAIL_PATH_PREFIX = "/przegladaj_oceny_punktowe/szczegoly/"
882
917
  # Recognition only: an ordinary grade's own detail link gives its stable grade
@@ -1034,6 +1069,35 @@ PAGE_NOTICES = MappingProxyType(
1034
1069
  )
1035
1070
  MODULE_UNAVAILABLE_PATH = "/modul_niedostepny"
1036
1071
  CLASS_FREE_DAYS_MAX_RECORDS = 4096
1072
+ # e-Justifications list (`/eusprawiedliwienia`, structure observed on two
1073
+ # parent logins on 2026-11-13). The list table's classes, its seven header
1074
+ # cells in page order (`td`, not `th`, in `thead`) and the status words. The
1075
+ # status words are the filter's options; `odrzucone` has not been seen on an
1076
+ # entry. A decided entry adds " (" + the deciding person's name + ")".
1077
+ JUSTIFICATION_TABLE_CLASSES = frozenset({"decorated", "stretch", "center"})
1078
+ JUSTIFICATION_HEADERS = (
1079
+ "Załącznik",
1080
+ "Okres usprawiedliwienia",
1081
+ "Liczba usprawiedliwionych nieobecności",
1082
+ "Treść",
1083
+ "Powiadomieni nauczyciele",
1084
+ "Data wysłania",
1085
+ "Status",
1086
+ )
1087
+ JUSTIFICATION_STATUSES = MappingProxyType(
1088
+ {"wysłane": "sent", "usprawiedliwione": "justified", "odrzucone": "rejected"}
1089
+ )
1090
+ # `Me.Account.GroupId` of the logins that may request the list: 5 on both
1091
+ # parent logins, 8 on both student logins (one school, 2026-11-13). Opening
1092
+ # the list on a student login ends its session, so any other or missing group
1093
+ # is refused before the request.
1094
+ JUSTIFICATION_ACCOUNT_GROUP = 5
1095
+ # The filter form's date inputs, filled with the window the list shows.
1096
+ JUSTIFICATION_WINDOW_FIELDS = ("data_od", "data_do")
1097
+ JUSTIFICATION_MAX_ITEMS = 512
1098
+ JUSTIFICATION_MAX_CONTENT_LENGTH = 8192
1099
+ JUSTIFICATION_MAX_TEACHERS = 64
1100
+ JUSTIFICATION_MAX_TOTAL_TEXT_LENGTH = 262144
1037
1101
  COMPLETED_LESSONS_MAX_WINDOW_DAYS = 371
1038
1102
  COMPLETED_LESSONS_MAX_PAGE_COUNT = 1000
1039
1103
  COMPLETED_LESSONS_MAX_PAGE_ITEMS = 256
@@ -255,6 +255,7 @@ def _redaction_vocabulary() -> tuple[
255
255
  *config.GRADE_PERIOD_HEADERS,
256
256
  *config.GRADE_PREDICTED_PERIOD_HEADERS,
257
257
  *config.GRADE_AVERAGE_HEADERS,
258
+ *config.JUSTIFICATION_HEADERS,
258
259
  }
259
260
  texts |= {label.casefold() for label in config.FORMATIVE_HEADERS}
260
261
  profile = (*config.PROFILE_LABELS, *config.PROFILE_OWNER_LABELS)