librus-python-api 1.0.1__tar.gz → 1.0.3__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 (53) hide show
  1. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/API.md +1 -1
  2. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/CHANGELOG.md +27 -0
  3. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/PKG-INFO +5 -4
  4. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/README.md +4 -3
  5. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/__init__.py +1 -1
  6. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/config.py +14 -6
  7. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/service.py +7 -2
  8. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/.gitignore +0 -0
  9. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/LICENSE +0 -0
  10. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/SECURITY.md +0 -0
  11. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/pyproject.toml +0 -0
  12. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/_notification_bootstrap.py +0 -0
  13. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/_notification_codec.py +0 -0
  14. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/_storage.py +0 -0
  15. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/_windows_filesystem.py +0 -0
  16. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/announcements.py +0 -0
  17. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/attachment_routes.py +0 -0
  18. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/attachments.py +0 -0
  19. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/attendance.py +0 -0
  20. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/attendance_frequency.py +0 -0
  21. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/budget.py +0 -0
  22. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/checkpoint.py +0 -0
  23. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/completed_lessons.py +0 -0
  24. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/detail_fields.py +0 -0
  25. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/diagnostics.py +0 -0
  26. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/exceptions.py +0 -0
  27. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/files.py +0 -0
  28. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/grade_parsers.py +0 -0
  29. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/grade_records.py +0 -0
  30. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/homework_range.py +0 -0
  31. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/lifecycle.py +0 -0
  32. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/markup.py +0 -0
  33. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/message_content.py +0 -0
  34. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/messages.py +0 -0
  35. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/models.py +0 -0
  36. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/modern_body.py +0 -0
  37. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/modern_mailbox.py +0 -0
  38. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/modern_messages.py +0 -0
  39. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/notification_models.py +0 -0
  40. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/notification_persistence.py +0 -0
  41. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/notification_workflow.py +0 -0
  42. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/notifications.py +0 -0
  43. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/parsers.py +0 -0
  44. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/parsing.py +0 -0
  45. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/persistence.py +0 -0
  46. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/py.typed +0 -0
  47. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/recipients.py +0 -0
  48. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/scheduler.py +0 -0
  49. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/school_reads.py +0 -0
  50. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/sending.py +0 -0
  51. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/timetable.py +0 -0
  52. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/src/librus_python_api/transport.py +0 -0
  53. {librus_python_api-1.0.1 → librus_python_api-1.0.3}/uv.lock +0 -0
@@ -112,7 +112,7 @@ refunded. Exhaustion raises `LimitError`; deadlines raise `OperationTimeoutError
112
112
 
113
113
  ## Configuration
114
114
 
115
- - `SchedulerLimits`: 5 requests/second, burst 10, 2 active requests, 1 per
115
+ - `SchedulerLimits`: 10 requests/second, burst 20, 4 active requests, 1 per
116
116
  account, 32 queued (8 per account), 16 accounts, 32 concurrent operations
117
117
  (8 per account). These are engineering defaults, not a published Librus quota.
118
118
  - `TransportLimits`: 30 s request and 10 s connect timeouts, 4 MiB bodies, 10
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.3 (2026-10-06) - Notification counts for parent logins
4
+
5
+ Compatible patch release. The public library API is unchanged.
6
+
7
+ - Read `notification_counts()` from the information page (`/informacja`), which
8
+ every login can open, instead of the student landing route `/uczen/index`.
9
+ That route returned 403 for a parent login in a live check, and the session
10
+ was unusable afterwards. The counters come from the menu shared by every
11
+ page, so the result is unchanged for student logins. The read is now
12
+ retry-safe: a proven session expiry is recovered once.
13
+ - Count the modern messages launcher link (`/wiadomosci3`) as the messages
14
+ category. Before, schools linking it showed no messages counter.
15
+ - Keep `/uczen/index` only as an accepted login redirect target. It is never
16
+ requested directly.
17
+
18
+ ## 1.0.2 (2026-10-06) - Faster shared request policy
19
+
20
+ Compatible patch release. The public library API is unchanged.
21
+
22
+ - Raise the default `SchedulerLimits` to 10 requests/second, a shared burst of
23
+ 20 and four simultaneous requests across the service (from 5, 10 and 2).
24
+ Each login still runs one request at a time, queue limits are unchanged, and
25
+ 429/503 responses still pause all traffic and resume without a burst. Measured
26
+ with the MCP consumer on four logins, the earlier policy made real workloads
27
+ about 35% slower than the unthrottled apix-based client. Pass explicit lower
28
+ `SchedulerLimits` where stricter traffic is required.
29
+
3
30
  ## 1.0.1 (2026-10-06) - Bounded subject frequency and reliability fixes
4
31
 
5
32
  Compatible patch release. The public library API is unchanged.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: librus-python-api
3
- Version: 1.0.1
3
+ Version: 1.0.3
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
@@ -51,7 +51,7 @@ See [limitations](#supported-features-and-limitations) below.
51
51
  Install the exact release from PyPI after its gated publication completes:
52
52
 
53
53
  ```sh
54
- python -m pip install librus-python-api==1.0.1
54
+ python -m pip install librus-python-api==1.0.3
55
55
  ```
56
56
 
57
57
  Pin the exact version qualified by your application. Before publication, use a
@@ -67,7 +67,7 @@ python -m pip install .
67
67
  To install a locally built wheel instead:
68
68
 
69
69
  ```sh
70
- python -m pip install ./dist/librus_python_api-1.0.1-py3-none-any.whl
70
+ python -m pip install ./dist/librus_python_api-1.0.3-py3-none-any.whl
71
71
  ```
72
72
 
73
73
  No CLI or background process is installed: import the library in your own program.
@@ -183,7 +183,8 @@ except LibrusError as error:
183
183
  ```
184
184
 
185
185
  A budget covers login, queueing and all pages of an operation. Defaults allow
186
- 5 requests/second, a burst of 10 and two simultaneous requests across the service.
186
+ 10 requests/second, a burst of 20 and four simultaneous requests across the
187
+ service, with one at a time per login.
187
188
  Fresh reads are the default. Unsupported layouts raise typed errors rather than
188
189
  silently returning incomplete data. Cursors detect changes; they are not snapshots.
189
190
 
@@ -25,7 +25,7 @@ See [limitations](#supported-features-and-limitations) below.
25
25
  Install the exact release from PyPI after its gated publication completes:
26
26
 
27
27
  ```sh
28
- python -m pip install librus-python-api==1.0.1
28
+ python -m pip install librus-python-api==1.0.3
29
29
  ```
30
30
 
31
31
  Pin the exact version qualified by your application. Before publication, use a
@@ -41,7 +41,7 @@ python -m pip install .
41
41
  To install a locally built wheel instead:
42
42
 
43
43
  ```sh
44
- python -m pip install ./dist/librus_python_api-1.0.1-py3-none-any.whl
44
+ python -m pip install ./dist/librus_python_api-1.0.3-py3-none-any.whl
45
45
  ```
46
46
 
47
47
  No CLI or background process is installed: import the library in your own program.
@@ -157,7 +157,8 @@ except LibrusError as error:
157
157
  ```
158
158
 
159
159
  A budget covers login, queueing and all pages of an operation. Defaults allow
160
- 5 requests/second, a burst of 10 and two simultaneous requests across the service.
160
+ 10 requests/second, a burst of 20 and four simultaneous requests across the
161
+ service, with one at a time per login.
161
162
  Fresh reads are the default. Unsupported layouts raise typed errors rather than
162
163
  silently returning incomplete data. Cursors detect changes; they are not snapshots.
163
164
 
@@ -120,7 +120,7 @@ from librus_python_api.models import (
120
120
  from librus_python_api.sending import SendAttempt
121
121
  from librus_python_api.service import AccountClient, LibrusService
122
122
 
123
- __version__ = "1.0.1"
123
+ __version__ = "1.0.3"
124
124
 
125
125
  __all__ = [
126
126
  "AccountContext",
@@ -337,8 +337,10 @@ ENDPOINTS: Mapping[str, Endpoint] = MappingProxyType(
337
337
  False,
338
338
  Evidence.SYNTHETIC_ONLY,
339
339
  ),
340
+ # Accepted only as a redirect target during login. Never requested
341
+ # directly: it answers parent logins with 403.
340
342
  Endpoint(
341
- "notification_counts",
343
+ "login_student_landing",
342
344
  "GET",
343
345
  "/uczen/index",
344
346
  SideEffect.AUTHENTICATION,
@@ -695,6 +697,10 @@ CHECKPOINT_TIMEOUT_SECONDS = 5.0
695
697
  CHECKPOINT_MAX_TIMEOUT_SECONDS = 30.0
696
698
  SCHEDULE_RESPONSE_VERSION = 1
697
699
  SCHEDULE_MAX_EVENTS = 1024
700
+ # Every Synergia page carries the counter menu. The information page is
701
+ # readable by student and parent logins alike; the student landing route
702
+ # (/uczen/index) answers parent logins with 403 and is not used.
703
+ NOTIFICATION_COUNTS_ENDPOINT = "student_information"
698
704
  NOTIFICATION_MAX_MENU_ITEMS = 64
699
705
  NOTIFICATION_MAX_COUNT = 1000000
700
706
  NOTIFICATION_DESTINATIONS = MappingProxyType(
@@ -702,6 +708,7 @@ NOTIFICATION_DESTINATIONS = MappingProxyType(
702
708
  "/przegladaj_oceny/uczen": "grades",
703
709
  "/przegladaj_nb/uczen": "attendance",
704
710
  "/wiadomosci": "messages",
711
+ "/wiadomosci3": "messages",
705
712
  "/ogloszenia": "announcements",
706
713
  "/terminarz": "agenda",
707
714
  "/moje_zadania": "homework",
@@ -1284,13 +1291,14 @@ class SchedulerLimits(_ValidatedConfig):
1284
1291
  Queue limits count waiting requests, separately from active requests. Rate
1285
1292
  tokens count every admitted attempt, including future auth/redirect/retry
1286
1293
  requests. Parent and student logins each occupy their own account slot.
1287
- A shared ten-token burst accommodates sequential cold-login hops; refill at
1288
- five tokens/second bounds sustained traffic without one-second hop delays.
1294
+ A shared twenty-token burst accommodates two concurrent cold-login chains;
1295
+ refill at ten tokens/second bounds sustained traffic across all accounts.
1296
+ One active request per account keeps each login's session state sequential.
1289
1297
  """
1290
1298
 
1291
- requests_per_second: PositiveFinite = 5.0
1292
- burst: PositiveCount = 10
1293
- active_requests: PositiveCount = 2
1299
+ requests_per_second: PositiveFinite = 10.0
1300
+ burst: PositiveCount = 20
1301
+ active_requests: PositiveCount = 4
1294
1302
  active_requests_per_account: PositiveCount = 1
1295
1303
  queued_requests: QueueCount = 32
1296
1304
  queued_requests_per_account: QueueCount = 8
@@ -42,6 +42,7 @@ from librus_python_api.config import (
42
42
  GRADE_MAX_WINDOW_DAYS,
43
43
  MESSAGE_MAX_CURSOR_IDS,
44
44
  MODERN_RECIPIENT_OPERATIONS,
45
+ NOTIFICATION_COUNTS_ENDPOINT,
45
46
  SCHEDULE_RESPONSE_VERSION,
46
47
  SESSION_COOKIE,
47
48
  AccountCredentials,
@@ -816,7 +817,7 @@ class AccountClient:
816
817
 
817
818
  async def fetch(budget: RequestBudget, _: bool) -> NotificationCounts:
818
819
  items = await self._page(
819
- "notification_counts", budget, parse_notification_counts
820
+ NOTIFICATION_COUNTS_ENDPOINT, budget, parse_notification_counts
820
821
  )
821
822
  return NotificationCounts(
822
823
  self._session_identity(),
@@ -825,7 +826,11 @@ class AccountClient:
825
826
  )
826
827
 
827
828
  return await self._read(
828
- ("notification_counts",), fetch, budget, max_age_seconds
829
+ ("notification_counts",),
830
+ fetch,
831
+ budget,
832
+ max_age_seconds,
833
+ endpoint=NOTIFICATION_COUNTS_ENDPOINT,
829
834
  )
830
835
 
831
836
  async def consume_schedule_events(