librus-python-api 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl

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.
@@ -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(
@@ -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
 
@@ -1,4 +1,4 @@
1
- librus_python_api/__init__.py,sha256=YAo4-5FnnoG8Rx29PXJFTCxiQ0Rb6biHI52JCXsdQ0A,5657
1
+ librus_python_api/__init__.py,sha256=6WrjdwyywtqZ9iRD7jGBvGjOdy7YAAUNfChbcT4jdQU,5657
2
2
  librus_python_api/_notification_bootstrap.py,sha256=18nzH0doXBNaZXCz-_ckIvRrlHTWV5Mm1t5m2-5eYGI,4669
3
3
  librus_python_api/_notification_codec.py,sha256=hU6G3zGJ5fR8wfPC6fV2OqBKs-7XpT9eRnKO3FGsTzY,13451
4
4
  librus_python_api/_storage.py,sha256=M_6ZAzN4zs7laOdKJBRH1I2rvy3pgqYgC_MZtsd2xtM,15893
@@ -11,7 +11,7 @@ librus_python_api/attendance_frequency.py,sha256=SBhED5zuyRIHWdw4urFyTJYykb6EYB7
11
11
  librus_python_api/budget.py,sha256=8fvqT7eIxyVX2P2OBG27XsYHk_HbtSS4lzuecYpHtgs,2878
12
12
  librus_python_api/checkpoint.py,sha256=QBmG9GtpyaGRaFq-FXuGA3yR1BjuMFN9V3RTvvi_FNQ,1930
13
13
  librus_python_api/completed_lessons.py,sha256=sR2oLSGb2q1580l-2upCBv9sQfIcHi7CQfWr1K0EFXI,7635
14
- librus_python_api/config.py,sha256=E3rMMc5qsw_imdpODI09Y6EOv0fcfbuWLPcIkY-ChwQ,49057
14
+ librus_python_api/config.py,sha256=Tx104USrajcwJe9SxfJWK6ppeoSYqd88lC_PKsCJMYs,49575
15
15
  librus_python_api/detail_fields.py,sha256=K10Stx_ehDTttkUI7-G7a2Ko9exYEu5NJpR-3sBnQ60,1789
16
16
  librus_python_api/diagnostics.py,sha256=2l7wq6RA3it-Gwj-JRLcw5qbI37fl3xII6GZA2mZj0o,856
17
17
  librus_python_api/exceptions.py,sha256=yWWoo0xyrQAk1d13HOJZnQBsq4ulh_P0hRSI6ZiNQOE,4622
@@ -39,10 +39,10 @@ librus_python_api/recipients.py,sha256=6GQCKo-Zjg3VFSg1J8YXcDsy_U3r6-MUS4VCvz0xd
39
39
  librus_python_api/scheduler.py,sha256=3JplYxqvQdFz3aKXcoQUJHE9s3FPw_xRhQ2CPNLuQmA,10729
40
40
  librus_python_api/school_reads.py,sha256=PCnZ4lv44j-68FgJpQiMteaPSyfhbX8_3CUyE6zhFcQ,14760
41
41
  librus_python_api/sending.py,sha256=Nvvk2r-6D6Us53a2fH5GW9PcA6bWEfuOvy6c3M5QVcE,4549
42
- librus_python_api/service.py,sha256=tPDO0MlbhD6j0PHIZAHGpAVPvCMq2bLLK1HXGR7QQdc,86428
42
+ librus_python_api/service.py,sha256=tTjOC3nOWQL1O7QH-IvoSukJX7oNENmAN5xH8z-d8a0,86557
43
43
  librus_python_api/timetable.py,sha256=tX1QK9fQABxzfLaHHqTe8e6rAgdOkCoTOfAHdPwNmLE,9836
44
44
  librus_python_api/transport.py,sha256=6S5wwBiRkUfKmi6w2t8msxlTSzCo-IbIBE13FeBc7Jw,35357
45
- librus_python_api-1.0.1.dist-info/METADATA,sha256=rwPPhwhdUftJky5wfqstlurtWaiXT93gAPEKi_1oQtY,11514
46
- librus_python_api-1.0.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
47
- librus_python_api-1.0.1.dist-info/licenses/LICENSE,sha256=IuerLb3cnZCsaB23znydjjvKqP-LmSJd3syKa9NGUts,1071
48
- librus_python_api-1.0.1.dist-info/RECORD,,
45
+ librus_python_api-1.0.3.dist-info/METADATA,sha256=PbL-qr7wfo185OJS5JpIWHdli4xxck8uOtVRVuVHZYg,11546
46
+ librus_python_api-1.0.3.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
47
+ librus_python_api-1.0.3.dist-info/licenses/LICENSE,sha256=IuerLb3cnZCsaB23znydjjvKqP-LmSJd3syKa9NGUts,1071
48
+ librus_python_api-1.0.3.dist-info/RECORD,,