Skip to main content

pyedookit

PyPI CI

Unofficial async Python client for the Edookit parent portal (https://<school>.edookit.net) used by Czech schools. It powers the ha-edookit Home Assistant integration and works standalone.

Edookit's REST API only works if a school administrator enables it, so this library signs in like a parent does (Plus4U OIDC, no browser) and reads the portal's pages. Edookit doesn't support it, and a change to the portal's markup can break a parser until it's updated.

Install

pip install pyedookit

Requires Python 3.12+.

Usage

import asyncio
from pyedookit import EdookitClient, login

async def main():
    session = await login("zs-example", "parent@example.com", "hunter2")
    client = EdookitClient(session)
    for lesson in await client.get_timetable():
        print(lesson.start, lesson.subject, lesson.room)

asyncio.run(main())
Call Returns
get_timetable() this week's Lessons, times in PORTAL_TZ (Europe/Prague)
get_timetable_week(week_offset=0) a TimetableWeek: lessons plus the bell-schedule periods; offset 1 is next week
get_events() upcoming SchoolEvents; all-day events have date start/end, end inclusive
get_payments() Payments totals and requests, amounts as Decimal
get_inbox() the MessageSummarys in Schránka, newest first: subject, sender, sent time, preview, unread
get_message(id) one Message in full; fetching it marks the message read on the portal
get_grades() Grades of the current term: grades newest first (mark, weight, topic, teacher, entered date), subjects with attendance, and average(course_id), weighted
fetch_page(name) raw HTML of a page without a parser yet (CAPTURE_PAGES)

The inbox, message and grades pages are requested the way a browser's first page load is, without the AJAX headers the other calls send: to an AJAX request the portal answers with the inbox's first-run guide and its sample items. Message.body is the message's HTML reduced to a JSON-ready node tree of p, br, strong, em, u, ul, ol, li and http(s) links; everything else, scripts and event handlers included, is dropped. Render it as nodes, never as HTML.

content_fingerprint(html) tells you when such a page's content changed.

Sessions

The password is only used by login(). Store session.to_json() instead, and treat it like a password: it holds the Plus4U sign-in. Its cookie is set for 30 days from login() (session.plus4u_expires_at tells you when, or is None if that's unknown or already past). Load it with Session.from_json(); sessions stored by 0.3.x still load.

EdookitClient renews the short-lived edookit session by itself and retries once. Pass on_session_update to persist each renewed session:

client = EdookitClient(session, on_session_update=lambda s: save(s.to_json()))

Only when Plus4U answers that the user has to sign in again do calls raise AuthError, and you need login() again. A renewal that fails for any other reason (Plus4U or the portal erroring, a maintenance page) raises EdookitConnectionError, so a passing outage doesn't cost the user a login.

Exception Meaning What to do
SessionExpired still expired right after a renewal retry later
AuthError bad credentials, or Plus4U wants a new login login()
EdookitConnectionError network error, 30 s timeout, or a failed renewal retry later
ParseError the portal's markup changed the parser needs updating

All of them derive from EdookitError. login(), refresh() and EdookitClient accept an http: aiohttp.ClientSession to reuse. Create it with cookie_jar=aiohttp.DummyCookieJar(): cookies are handled per host by hand, and a real jar would resend them.

Limitations

  • Current week only. The portal ignores week_offset=1, and the real week-navigation parameter hasn't been found yet. A browser HAR trace of clicking the next-week arrow would solve it; scripts/capture_fixtures.py captures portal HTML.
  • Cancelled and changed lessons are unverified. No real capture has had one yet, so Lesson.is_changed and is_cancelled are always False.
  • Unpaid payment requests are unverified. Only paid ones have been seen. A request without the "accepted" marker is reported as unpaid.
  • Grades: term marks and non-numeric marks are unverified. Neither has been seen. A mark other than 1–5 is kept as text and left out of average(); the current term is chosen by its heading ("2. pololetí" over "1. pololetí").

Development

uv sync --group dev
uv run pytest
uv run ruff check .
uv run mypy src

To release, bump version in pyproject.toml and push a vX.Y.Z tag. The publish workflow checks that the tag matches the version, then tests, builds and uploads to PyPI with trusted publishing.

Metadata

Release files for pyedookit 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyedookit 0.7.0
File Size Uploaded Provenance
pyedookit-0.7.0.tar.gz 45.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyedookit 0.7.0
File Interpreter ABI Platform
pyedookit-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.6 kB

Release files / pyedookit-0.7.0.tar.gz

Download URL pyedookit-0.7.0.tar.gz
Size 45.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f2cdd040952779c75070e548ec5a5dbcc4d24dff8f3f3f253761999c64b4bc06
BLAKE2b-256 checksum
How to use checksums
47acf023e095a68aedd8cd363f67283a5e5b3e234357432546074c0c2878067c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / pyedookit-0.7.0-py3-none-any.whl

Download URL pyedookit-0.7.0-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d132c0934cc8c98fbfefbbf7a4e7f689c435b5e1584578b8e5d9397663eeec33
BLAKE2b-256 checksum
How to use checksums
72ff34d2093753485ebd0d4009a3804854980908b6d9fc09b35c98222f49ed27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for pyedookit 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyedookit-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page