librus-python-api 1.9.0__tar.gz → 1.10.0__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.
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/API.md +51 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/CHANGELOG.md +57 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/PKG-INFO +8 -4
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/README.md +7 -3
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/pyproject.toml +6 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/__init__.py +11 -1
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/config.py +45 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/diagnostics.py +1 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/gateway_grades.py +33 -74
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/grade_records.py +78 -16
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/inspect_page.py +10 -0
- librus_python_api-1.10.0/src/librus_python_api/justifications.py +238 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/models.py +89 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/parsers.py +7 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/service.py +46 -3
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/uv.lock +7 -3
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/.gitignore +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/LICENSE +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/SECURITY.md +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/_notification_bootstrap.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/_notification_codec.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/_storage.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/_windows_filesystem.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/announcements.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/attachment_routes.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/attachments.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/attendance.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/attendance_frequency.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/budget.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/checkpoint.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/class_free_days.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/completed_lessons.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/detail_fields.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/exceptions.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/files.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/formative_grades.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/grade_parsers.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/homework_range.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/lifecycle.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/markup.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/message_content.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/messages.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/modern_body.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/modern_mailbox.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/modern_messages.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/notification_models.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/notification_persistence.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/notification_workflow.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/notifications.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/parsing.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/persistence.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/py.typed +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/recipients.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/scheduler.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/school_reads.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/school_year_archive.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/sending.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/timetable.py +0 -0
- {librus_python_api-1.9.0 → librus_python_api-1.10.0}/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
|
|
@@ -394,6 +430,21 @@ optional paired `lesson_no_from`/`lesson_no_to`. One bounded read-only GET;
|
|
|
394
430
|
reference URLs are not followed and type labels are not inferred. An explicit
|
|
395
431
|
empty collection returns `items=()`. See [contract](contracts/class-free-days.md).
|
|
396
432
|
|
|
433
|
+
### e-Justifications
|
|
434
|
+
|
|
435
|
+
`justifications(*, budget=None, max_age_seconds=0.0)` returns frozen
|
|
436
|
+
`Justifications` with `identity`, `window_start`, `window_end`, `items` and
|
|
437
|
+
`observation`. Each `Justification` has civil `start`/`end`, `lessons` (lesson
|
|
438
|
+
numbers of a one-day entry, empty for a range), `absence_count`, `content`,
|
|
439
|
+
`teachers`, naive local `sent_at`, `status` (`JustificationStatus.SENT`,
|
|
440
|
+
`JUSTIFIED` or `REJECTED`), `decided_by` (the decider's name as text, or
|
|
441
|
+
`None`) and `has_attachment`. One GET of the list in the window the page shows
|
|
442
|
+
by default; entries sent before `window_start` may be missing. Only a login
|
|
443
|
+
whose identity response reports `Me.Account.GroupId` 5 (both parent logins
|
|
444
|
+
observed) sends the request; any other or missing group (8 on both student
|
|
445
|
+
logins, where the page ends the session) raises `UnsupportedCapabilityError`
|
|
446
|
+
without it. See [contract](contracts/justifications.md).
|
|
447
|
+
|
|
397
448
|
### Weekly timetable
|
|
398
449
|
|
|
399
450
|
`timetable(monday)` takes a `date` that is a Monday and returns `Timetable` with
|
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.10.0 (2026-11-13) - Behaviour points and e-Justifications
|
|
4
|
+
|
|
5
|
+
Thank you, @sanyok-ua, for reporting #76 and asking for behaviour points as a
|
|
6
|
+
value. Existing signatures are unchanged; the additions are listed below.
|
|
7
|
+
|
|
8
|
+
- Grades: `GradeRecords.behaviour_points` and `GradeWindow.behaviour_points`
|
|
9
|
+
hold the `Zachowanie` row's points (#138), apart from grades, as
|
|
10
|
+
`BehaviourPoints(semester, tally, entries)` with `BehaviourPointEntry(points,
|
|
11
|
+
detail_id, category, day, metadata)`. The tally is the integer the cell
|
|
12
|
+
shows; it is not interpreted as starting points or a running total, and
|
|
13
|
+
entries are never summed. A window keeps an item with an entry inside it,
|
|
14
|
+
with only those entries. Pages without points give `()`; grades, averages and
|
|
15
|
+
notification identities do not change.
|
|
16
|
+
- Grades: a point entry's tooltip is now read. A label other than `Zakres od`,
|
|
17
|
+
`Zakres do`, `Data wystawienia`, `Dodał` and `Komentarz`
|
|
18
|
+
(`config.BEHAVIOUR_POINT_LABELS`), a missing first line or a missing date
|
|
19
|
+
raises `ParseError`; before, the tooltip was not read and such a page
|
|
20
|
+
parsed. So does a point table showing different points for the same period.
|
|
21
|
+
A tally alone in a cell spanning both periods still parses and gives no
|
|
22
|
+
item, since its period would be a guess.
|
|
23
|
+
- Point entries count toward `GRADE_MAX_RECORDS` with the grades; an item the
|
|
24
|
+
point table repeats counts once.
|
|
25
|
+
- `inspect_page grades` reports `behaviour_points` and
|
|
26
|
+
`behaviour_point_entries` counts.
|
|
27
|
+
- The layout follows two schools' pages seen offline on 2026-10-18 with
|
|
28
|
+
original synthetic fixtures; no live login with points was available.
|
|
29
|
+
|
|
30
|
+
- New read `AccountClient.justifications()` returns the e-Justifications list
|
|
31
|
+
(`/eusprawiedliwienia`) as typed `Justifications`: the page's default window
|
|
32
|
+
(`window_start`, `window_end`) and each `Justification` with its period or
|
|
33
|
+
day and lessons, absence count, content, notified teachers, sent time,
|
|
34
|
+
`JustificationStatus` and the decider's name. One GET, no filter POST; older
|
|
35
|
+
entries may be missing. Structure observed on two parent logins on
|
|
36
|
+
2026-11-13 (issue #137).
|
|
37
|
+
- `justifications()` sends its request only for a login whose identity
|
|
38
|
+
reports `Me.Account.GroupId` 5 (both parent logins observed). Any other or
|
|
39
|
+
missing group raises `UnsupportedCapabilityError` with no request: opening
|
|
40
|
+
the list on a student login (`GroupId` 8) ends its session (owner live
|
|
41
|
+
check, 2026-11-13). A parent login that gets the logged-out page signs in
|
|
42
|
+
again once, as for any read. `GroupId` is parsed internally as an optional
|
|
43
|
+
integer; `Identity` is unchanged.
|
|
44
|
+
- New route `justifications` in `config.ENDPOINTS` and the OpenAPI contract;
|
|
45
|
+
`inspect_page justifications`; the list's header labels are named in failure
|
|
46
|
+
diagnostics.
|
|
47
|
+
- Weekly live check: new step `justifications` (slot 0 `any`, slot 1
|
|
48
|
+
`unavailable`).
|
|
49
|
+
|
|
50
|
+
Other changes:
|
|
51
|
+
|
|
52
|
+
- Gateway grades: the pagination check reads the member recorded on
|
|
53
|
+
2026-11-13 (`pagination` = `{limit, page, total}` integers) and nothing else,
|
|
54
|
+
instead of guessing key names. A total above the items received or a page
|
|
55
|
+
other than 1 still fails as `UNSUPPORTED_CAPABILITY`; non-integer or
|
|
56
|
+
inconsistent values fail as `PARSE`. A PartialGrades response without the
|
|
57
|
+
member is rejected; Subjects (no member) parses. Users now validates the
|
|
58
|
+
member when present. Requests are unchanged (#136).
|
|
59
|
+
|
|
3
60
|
## 1.9.0 (2026-11-08) - Grade IDs and correction links
|
|
4
61
|
|
|
5
62
|
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.
|
|
3
|
+
Version: 1.10.0
|
|
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,11 @@ 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.
|
|
45
|
+
**Status:** `1.10.0` returns behaviour points as a typed value
|
|
46
|
+
(`GradeRecords.behaviour_points`), reads the e-Justifications list on parent
|
|
47
|
+
logins (`AccountClient.justifications()`) and checks the gateway grade
|
|
48
|
+
pagination member recorded live.
|
|
49
|
+
`1.9.0` gives every ordinary grade its stable Librus ID (`grade_id`)
|
|
46
50
|
and links a corrected grade to its corrections, as the all view brackets them
|
|
47
51
|
(`GradeRecords.corrections`, [grade corrections](API.md#grade-ids-and-corrections-190)).
|
|
48
52
|
`1.8.4` reads multi-line formative assessment text and repeated
|
|
@@ -72,7 +76,7 @@ See [limitations](#supported-features-and-limitations) below.
|
|
|
72
76
|
Install the exact release from PyPI after its gated publication completes:
|
|
73
77
|
|
|
74
78
|
```sh
|
|
75
|
-
python -m pip install librus-python-api==1.
|
|
79
|
+
python -m pip install librus-python-api==1.10.0
|
|
76
80
|
```
|
|
77
81
|
|
|
78
82
|
Pin the exact version qualified by your application. Before publication, use a
|
|
@@ -88,7 +92,7 @@ python -m pip install .
|
|
|
88
92
|
To install a locally built wheel instead:
|
|
89
93
|
|
|
90
94
|
```sh
|
|
91
|
-
python -m pip install ./dist/librus_python_api-1.
|
|
95
|
+
python -m pip install ./dist/librus_python_api-1.10.0-py3-none-any.whl
|
|
92
96
|
```
|
|
93
97
|
|
|
94
98
|
No console script or background process is installed: import the library in your
|
|
@@ -16,7 +16,11 @@ 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.
|
|
19
|
+
**Status:** `1.10.0` returns behaviour points as a typed value
|
|
20
|
+
(`GradeRecords.behaviour_points`), reads the e-Justifications list on parent
|
|
21
|
+
logins (`AccountClient.justifications()`) and checks the gateway grade
|
|
22
|
+
pagination member recorded live.
|
|
23
|
+
`1.9.0` gives every ordinary grade its stable Librus ID (`grade_id`)
|
|
20
24
|
and links a corrected grade to its corrections, as the all view brackets them
|
|
21
25
|
(`GradeRecords.corrections`, [grade corrections](API.md#grade-ids-and-corrections-190)).
|
|
22
26
|
`1.8.4` reads multi-line formative assessment text and repeated
|
|
@@ -46,7 +50,7 @@ See [limitations](#supported-features-and-limitations) below.
|
|
|
46
50
|
Install the exact release from PyPI after its gated publication completes:
|
|
47
51
|
|
|
48
52
|
```sh
|
|
49
|
-
python -m pip install librus-python-api==1.
|
|
53
|
+
python -m pip install librus-python-api==1.10.0
|
|
50
54
|
```
|
|
51
55
|
|
|
52
56
|
Pin the exact version qualified by your application. Before publication, use a
|
|
@@ -62,7 +66,7 @@ python -m pip install .
|
|
|
62
66
|
To install a locally built wheel instead:
|
|
63
67
|
|
|
64
68
|
```sh
|
|
65
|
-
python -m pip install ./dist/librus_python_api-1.
|
|
69
|
+
python -m pip install ./dist/librus_python_api-1.10.0-py3-none-any.whl
|
|
66
70
|
```
|
|
67
71
|
|
|
68
72
|
No console script or background process is installed: import the library in your
|
|
@@ -44,6 +44,12 @@ 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
|
+
|
|
47
53
|
[tool.hatch.version]
|
|
48
54
|
path = "src/librus_python_api/__init__.py"
|
|
49
55
|
|
|
@@ -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.
|
|
4
|
+
__version__ = "1.10.0"
|
|
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",
|
|
@@ -877,6 +888,11 @@ FORMATIVE_DETAIL_PATH_PREFIX = "/przegladaj_oceny/szczegoly/ksztaltujace/"
|
|
|
877
888
|
BEHAVIOUR_POINTS_DETAIL_PATH_PREFIX = "/przegladaj_oceny/zachowanie_szczegoly/"
|
|
878
889
|
# Tooltip labels of a behaviour grade symbol entry (#114, synthetic example).
|
|
879
890
|
BEHAVIOUR_GRADE_LABELS = frozenset({"Data wystawienia", "Dodał", "Komentarz"})
|
|
891
|
+
# Tooltip labels after a behaviour-point entry's unlabelled first line, as the
|
|
892
|
+
# 1.6.2 synthetic entry has them; any other label fails the read (#138).
|
|
893
|
+
BEHAVIOUR_POINT_LABELS = frozenset(
|
|
894
|
+
{"Zakres od", "Zakres do", "Data wystawienia", "Dodał", "Komentarz"}
|
|
895
|
+
)
|
|
880
896
|
# Recognition only: point-grade detail links are classified, never requested.
|
|
881
897
|
POINT_GRADE_DETAIL_PATH_PREFIX = "/przegladaj_oceny_punktowe/szczegoly/"
|
|
882
898
|
# Recognition only: an ordinary grade's own detail link gives its stable grade
|
|
@@ -1034,6 +1050,35 @@ PAGE_NOTICES = MappingProxyType(
|
|
|
1034
1050
|
)
|
|
1035
1051
|
MODULE_UNAVAILABLE_PATH = "/modul_niedostepny"
|
|
1036
1052
|
CLASS_FREE_DAYS_MAX_RECORDS = 4096
|
|
1053
|
+
# e-Justifications list (`/eusprawiedliwienia`, structure observed on two
|
|
1054
|
+
# parent logins on 2026-11-13). The list table's classes, its seven header
|
|
1055
|
+
# cells in page order (`td`, not `th`, in `thead`) and the status words. The
|
|
1056
|
+
# status words are the filter's options; `odrzucone` has not been seen on an
|
|
1057
|
+
# entry. A decided entry adds " (" + the deciding person's name + ")".
|
|
1058
|
+
JUSTIFICATION_TABLE_CLASSES = frozenset({"decorated", "stretch", "center"})
|
|
1059
|
+
JUSTIFICATION_HEADERS = (
|
|
1060
|
+
"Załącznik",
|
|
1061
|
+
"Okres usprawiedliwienia",
|
|
1062
|
+
"Liczba usprawiedliwionych nieobecności",
|
|
1063
|
+
"Treść",
|
|
1064
|
+
"Powiadomieni nauczyciele",
|
|
1065
|
+
"Data wysłania",
|
|
1066
|
+
"Status",
|
|
1067
|
+
)
|
|
1068
|
+
JUSTIFICATION_STATUSES = MappingProxyType(
|
|
1069
|
+
{"wysłane": "sent", "usprawiedliwione": "justified", "odrzucone": "rejected"}
|
|
1070
|
+
)
|
|
1071
|
+
# `Me.Account.GroupId` of the logins that may request the list: 5 on both
|
|
1072
|
+
# parent logins, 8 on both student logins (one school, 2026-11-13). Opening
|
|
1073
|
+
# the list on a student login ends its session, so any other or missing group
|
|
1074
|
+
# is refused before the request.
|
|
1075
|
+
JUSTIFICATION_ACCOUNT_GROUP = 5
|
|
1076
|
+
# The filter form's date inputs, filled with the window the list shows.
|
|
1077
|
+
JUSTIFICATION_WINDOW_FIELDS = ("data_od", "data_do")
|
|
1078
|
+
JUSTIFICATION_MAX_ITEMS = 512
|
|
1079
|
+
JUSTIFICATION_MAX_CONTENT_LENGTH = 8192
|
|
1080
|
+
JUSTIFICATION_MAX_TEACHERS = 64
|
|
1081
|
+
JUSTIFICATION_MAX_TOTAL_TEXT_LENGTH = 262144
|
|
1037
1082
|
COMPLETED_LESSONS_MAX_WINDOW_DAYS = 371
|
|
1038
1083
|
COMPLETED_LESSONS_MAX_PAGE_COUNT = 1000
|
|
1039
1084
|
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)
|
{librus_python_api-1.9.0 → librus_python_api-1.10.0}/src/librus_python_api/gateway_grades.py
RENAMED
|
@@ -4,8 +4,10 @@ The grades page of a school on the new descriptive grading schema renders a
|
|
|
4
4
|
subject table whose semester cells are empty; the page script then loads the
|
|
5
5
|
grades from gateway JSON routes. Routes and field names come from public client
|
|
6
6
|
code and the official page script. One authorized read on 2026-10-28 parsed four
|
|
7
|
-
PartialGrades records on one school
|
|
8
|
-
|
|
7
|
+
PartialGrades records on one school. A structure-only read on 2026-11-13 recorded
|
|
8
|
+
the pagination member, `{"limit", "page", "total"}` integers beside `data` or
|
|
9
|
+
`Users` (Subjects has none), and only that member is checked; every unexpected
|
|
10
|
+
shape fails instead of producing a partial collection.
|
|
9
11
|
|
|
10
12
|
Another school renders the same table with plain text in its semester cells and
|
|
11
13
|
no script hooks (#115, from a reporter's synthetic example). The grade record
|
|
@@ -55,29 +57,6 @@ _DATE = re.compile(
|
|
|
55
57
|
r"(?:[T ][0-9]{2}:[0-9]{2}(?::[0-9]{2}(?:\.[0-9]{1,9})?)?"
|
|
56
58
|
r"(?:Z|[+-][0-9]{2}:?[0-9]{2})?)?"
|
|
57
59
|
)
|
|
58
|
-
# Keys (lower case, without separators) that, in any object beside `data`,
|
|
59
|
-
# show that the collection continues on another page.
|
|
60
|
-
_TOTAL_KEYS = frozenset(
|
|
61
|
-
{
|
|
62
|
-
"total",
|
|
63
|
-
"totalcount",
|
|
64
|
-
"totalitems",
|
|
65
|
-
"totalrecords",
|
|
66
|
-
"totalresults",
|
|
67
|
-
"count",
|
|
68
|
-
"itemcount",
|
|
69
|
-
"itemscount",
|
|
70
|
-
"recordcount",
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
_PAGE_COUNT_KEYS = frozenset(
|
|
74
|
-
{"pages", "totalpages", "pagecount", "pagescount", "lastpage", "numberofpages"}
|
|
75
|
-
)
|
|
76
|
-
_NEXT_KEYS = frozenset({"next", "nextpage", "nexturl", "nextpageurl", "nextlink"})
|
|
77
|
-
_MORE_KEYS = frozenset({"hasmore", "hasnext", "hasnextpage", "more"})
|
|
78
|
-
_PAGE_SIZE_KEYS = frozenset(
|
|
79
|
-
{"limit", "perpage", "pagesize", "itemsperpage", "pagelimit"}
|
|
80
|
-
)
|
|
81
60
|
|
|
82
61
|
|
|
83
62
|
class _TokenInfoWire(BaseModel):
|
|
@@ -199,52 +178,33 @@ def _decode_collection(body: bytes, key: str, maximum: int) -> dict[str, Any]:
|
|
|
199
178
|
return data
|
|
200
179
|
|
|
201
180
|
|
|
202
|
-
def
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return int(value)
|
|
207
|
-
return None
|
|
181
|
+
def _check_pagination(
|
|
182
|
+
envelope: dict[str, Any], received: int, *, required: bool
|
|
183
|
+
) -> None:
|
|
184
|
+
"""Read the recorded `pagination` member; anything else decides nothing.
|
|
208
185
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
total above the items received, more than one page, a next link or page,
|
|
216
|
-
a true has-more flag, or a full page of a stated size with no total.
|
|
186
|
+
Observed 2026-11-13: `{"limit": int, "page": int, "total": int}` beside
|
|
187
|
+
`data` (PartialGrades) or `Users`. Subjects carries no member. Only the
|
|
188
|
+
first page is ever read, so the member must show page 1 and a total equal
|
|
189
|
+
to the items received (the limit is not a fixed page size and is only
|
|
190
|
+
checked to be an integer). Anything else fails instead of returning a
|
|
191
|
+
possibly partial collection.
|
|
217
192
|
"""
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
pending.append((value, depth + 1))
|
|
234
|
-
continue
|
|
235
|
-
number = _count(value)
|
|
236
|
-
if name in _TOTAL_KEYS and number is not None:
|
|
237
|
-
totals.append(number)
|
|
238
|
-
elif name in _PAGE_COUNT_KEYS and number is not None:
|
|
239
|
-
more = more or number > 1
|
|
240
|
-
elif name in _MORE_KEYS:
|
|
241
|
-
more = more or value is True
|
|
242
|
-
elif name in _PAGE_SIZE_KEYS and number is not None:
|
|
243
|
-
sizes.append(number)
|
|
244
|
-
if any(total > received for total in totals):
|
|
245
|
-
return True
|
|
246
|
-
full_page = any(0 < size <= received for size in sizes)
|
|
247
|
-
return more or (full_page and not totals)
|
|
193
|
+
if "pagination" not in envelope:
|
|
194
|
+
if required:
|
|
195
|
+
raise LibrusError(ErrorKind.PARSE)
|
|
196
|
+
return
|
|
197
|
+
member = envelope["pagination"]
|
|
198
|
+
if not isinstance(member, dict):
|
|
199
|
+
raise LibrusError(ErrorKind.PARSE)
|
|
200
|
+
limit, page, total = member.get("limit"), member.get("page"), member.get("total")
|
|
201
|
+
# `type(...) is int` rejects booleans, strings and floats.
|
|
202
|
+
if type(limit) is not int or type(page) is not int or type(total) is not int:
|
|
203
|
+
raise LibrusError(ErrorKind.PARSE)
|
|
204
|
+
if limit < 1 or total < received:
|
|
205
|
+
raise LibrusError(ErrorKind.PARSE)
|
|
206
|
+
if page != 1 or total > received:
|
|
207
|
+
raise LibrusError(ErrorKind.UNSUPPORTED_CAPABILITY)
|
|
248
208
|
|
|
249
209
|
|
|
250
210
|
def parse_token_info(body: bytes) -> str:
|
|
@@ -281,9 +241,8 @@ def _day(value: str) -> date:
|
|
|
281
241
|
def parse_partial_grades(body: bytes) -> tuple[PartialGrade, ...]:
|
|
282
242
|
data = _decode_collection(body, "data", GRADE_MAX_RECORDS)
|
|
283
243
|
wire = _validate(_PartialGradesWire, data)
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
raise LibrusError(ErrorKind.UNSUPPORTED_CAPABILITY)
|
|
244
|
+
# Returning the first page alone would be a silently partial result.
|
|
245
|
+
_check_pagination(data, len(wire.data), required=True)
|
|
287
246
|
return tuple(
|
|
288
247
|
PartialGrade(
|
|
289
248
|
item.subjectId,
|
|
@@ -303,8 +262,7 @@ def parse_partial_grades(body: bytes) -> tuple[PartialGrade, ...]:
|
|
|
303
262
|
def parse_gateway_subjects(body: bytes) -> Mapping[str, GatewaySubject]:
|
|
304
263
|
data = _decode_collection(body, "data", DESCRIPTIVE_MAX_SUBJECTS)
|
|
305
264
|
wire = _validate(_SubjectsWire, data)
|
|
306
|
-
|
|
307
|
-
raise LibrusError(ErrorKind.UNSUPPORTED_CAPABILITY)
|
|
265
|
+
_check_pagination(data, len(wire.data), required=False)
|
|
308
266
|
result: dict[str, GatewaySubject] = {}
|
|
309
267
|
numeric: set[int] = set()
|
|
310
268
|
for item in wire.data:
|
|
@@ -323,6 +281,7 @@ def parse_gateway_users(body: bytes) -> Mapping[str, str]:
|
|
|
323
281
|
"""Account IDs to "LastName FirstName"; a user with neither is omitted."""
|
|
324
282
|
data = _decode_collection(body, "Users", DESCRIPTIVE_MAX_USERS)
|
|
325
283
|
wire = _validate(_UsersWire, data)
|
|
284
|
+
_check_pagination(data, len(wire.Users), required=False)
|
|
326
285
|
result: dict[str, str] = {}
|
|
327
286
|
seen: dict[str, tuple[str | None, str | None]] = {}
|
|
328
287
|
for user in wire.Users:
|