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.1.0.tar.gz (13.1 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.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: webuntis_public-0.1.0.tar.gz
  • Upload date:
  • Size: 13.1 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.1.0.tar.gz
Algorithm Hash digest
SHA256 ee1d217ba231f3c8cc19b6c5d3e2a10252cc24ace8a00d544512a4cde3dd14bc
MD5 04e4526fa84d39d4a70151a3788ae59b
BLAKE2b-256 c78d7b7c8cc3c5eb3f341ea01c2d32630527d064f78fbea024a71c126e182557

See more details on using hashes here.

Provenance

The following attestation bundles were made for webuntis_public-0.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for webuntis_public-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cb039b1afd2ef4ee28eb32e66263bd5c132b92afc03191ccb86ad72998abbbe
MD5 15a92e9d0434eed6f5306de9c734451c
BLAKE2b-256 ef81575b5533d5033e9f62afb6d291d707eb237d3af1473a4f92df00663b2caa

See more details on using hashes here.

Provenance

The following attestation bundles were made for webuntis_public-0.1.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