Skip to main content

Python client for the WebUntis public timetable REST API (no authentication required)

Project description

webuntis-public

Python client for the WebUntis public timetable REST API. No authentication or API key required.

Installation

pip install webuntis-public

Quick Start

from webuntis_public import WebUntisPublicClient

# Connect to any WebUntis school
client = WebUntisPublicClient("hs-reutlingen.webuntis.com")

# List all available classes
classes = client.list_classes()
for c in classes[:5]:
    print(f"{c.id}: {c.name} ({c.long_name})")

# Search for classes by name
mkib = client.find_classes("MKIB")

# Fetch a single week
from datetime import date
week = client.fetch_week(class_id=21893, date=date(2026, 3, 2))
for period in week.periods:
    subj = ", ".join(s.name for s in period.subjects)
    print(f"  {period.date} {period.start_time}-{period.end_time}: {subj}")

# Fetch an entire semester
semester = client.fetch_semester(
    class_id=21893,
    start=date(2026, 3, 2),
    end=date(2026, 7, 5),
)
print(f"Total periods: {len(semester.periods)}")

API Reference

WebUntisPublicClient(server, *, school=None, rate_limit=0.3)

Create a client for the given WebUntis server hostname.

Methods:

Method Description
list_classes() Returns all ClassGroup entries on the server
find_classes(pattern) Case-insensitive search for class groups by name
fetch_week(class_id, date) Fetch one week of timetable data
fetch_semester(class_id, start, end) Fetch all weeks in a date range

Data Models

All models are frozen dataclasses:

  • ClassGroupid, name, long_name
  • Perioddate, start_time, end_time, subjects, teachers, rooms, classes, lesson_id, ...
  • Elementtype (ElementType), id, name, long_name, alternate_name
  • WeeklyTimetableclass_id, week_start, periods
  • SemesterTimetableclass_id, start, end, weeks, periods (property)

Utility Functions

  • parse_date(int) -> date — e.g. 20260302 -> date(2026, 3, 2)
  • parse_time(int) -> time — e.g. 800 -> time(8, 0)
  • format_date(int) -> str — e.g. 20260302 -> "2026-03-02"
  • format_time(int) -> str — e.g. 800 -> "08:00"
  • iter_mondays(start, end) — yield all Mondays in range

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webuntis_public-0.2.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webuntis_public-0.2.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file webuntis_public-0.2.0.tar.gz.

File metadata

  • Download URL: webuntis_public-0.2.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for webuntis_public-0.2.0.tar.gz
Algorithm Hash digest
SHA256 74f9460ad7f8994951e845d2266aac6344a4399e5a8aefeef488f310a3e5ba00
MD5 12dd6f78e6eb7fc5c36e8203709496c6
BLAKE2b-256 155307dfcdacacdffefcaad3b29b371ba1bf0a71d24dd2fff96f02f160b62eac

See more details on using hashes here.

Provenance

The following attestation bundles were made for webuntis_public-0.2.0.tar.gz:

Publisher: publish.yml on mklemmingen/webuntis-public

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webuntis_public-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for webuntis_public-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06417ffccc19fa0154873e87e24e0a722d4b305fad0e32029c2ddbcfadec1cda
MD5 2e8f4aeb8b045da11a09548e8c931be4
BLAKE2b-256 b07ac32b1362a0c6173bfb534267556c300b333d485ccc051bbebda058e17805

See more details on using hashes here.

Provenance

The following attestation bundles were made for webuntis_public-0.2.0-py3-none-any.whl:

Publisher: publish.yml on mklemmingen/webuntis-public

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page