Skip to main content

osu-schedule-client

Python SDK для работы с расписанием Оренбургского государственного университета. Клиент обращается к legacy API и возвращает нормализованные Pydantic-модели.

Статус: alpha

Почему проект появился

Оригинальный API расписания возвращает сложные для понимания данные и требует дополнительной обработки кодировки ответа. Этот клиент предоставляет устойчивый слой доступа, нормализацию и типизированные модели, чтобы разработчики могли работать с расписанием как с обычным Python API.

Ключевые возможности

  • Асинхронный клиент поверх httpx.
  • Нормализация и стабилизация полей расписания.
  • Четкая модельная схема на Pydantic v2.
  • Удобный импорт моделей и SDK-ориентированный API.

Установка

Через pip:

pip install osu-schedule-client

Через uv:

uv add osu-schedule-client

Примеры работы с API

import asyncio

from osu_schedule_client import OsuScheduleClient


async def main() -> None:
    async with OsuScheduleClient() as client:
        # Получаем факультеты
        faculties = await client.reference.get_faculties()

        print("Факультеты (первые 5):")
        for faculty in faculties[:5]:
            print(f"  [{faculty.id}] {faculty.name}")

        # Берём первый факультет
        faculty = faculties[0]

        print(f"\nВыбран факультет: {faculty.full_name}")

        # Получаем потоки (годы набора)
        potoks = await client.reference.get_potoks(faculty.id)

        print("\nПотоки:")
        for potok in potoks:
            print(f"  [{potok.id}] {potok.name} (год набора: {potok.enrollment_year})")

        # Берём первый поток
        potok = potoks[0]

        # Получаем группы
        groups = await client.reference.get_groups(
            faculty_id=faculty.id,
            potok_id=potok.id,
        )

        print("\nГруппы (первые 5):")
        for group in groups[:5]:
            print(
                f"  [{group.id}] "
                f"{group.name} | "
                f"{group.education_level} | "
                f"{group.education_form}"
            )

        # Берём первую группу
        group = groups[0]

        print(f"\nПолучаем расписание группы: {group.name}")

        lessons = await client.schedule.get_by_group(group.id)

        print(f"\nНайдено занятий: {len(lessons)}\n")

        for lesson in lessons[:5]:
            print(
                f"{lesson.date} "
                f"{lesson.time_range} | "
                f"{lesson.subject} | "
                f"{lesson.teacher_name} | "
                f"ауд. {lesson.auditorium_name}"
            )


if __name__ == "__main__":
    asyncio.run(main())

Архитектура

transport -> api -> mapping -> models

  • transport: сетевой слой и декодирование legacy JSON.
  • api: низкоуровневые методы доступа к конечным точкам.
  • mapping: нормализация и стабилизация нестабильных полей.
  • models: Pydantic-модели домена расписания.

Ошибки и устойчивость

Запросы выполняются с ретраями. Ошибки httpx (сетевые и HTTP) пробрасываются наружу, чтобы вы могли использовать свои стратегии обработки.

Особенности

  • Нормализация времени и дат в datetime.
  • Разделение моделей расписания по источнику (группа, преподаватель, аудитория).
  • Явные типы для поля недели, семестра и источника расписания.

Разработка

uv sync
uvx ruff check .

Лицензия

MIT. См. файл LICENSE.

Metadata

Release files for osu-schedule-client 0.1.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 osu-schedule-client 0.1.0
File Size Uploaded Provenance Actions
osu_schedule_client-0.1.0.tar.gz 16.1 kB Without provenance Details for osu_schedule_client-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for osu-schedule-client 0.1.0
File Interpreter ABI Platform Actions
osu_schedule_client-0.1.0-py3-none-any.whl Python 3 none any Details for osu_schedule_client-0.1.0-py3-none-any.whl

Total release size: 35.2 kB

Release files / osu_schedule_client-0.1.0.tar.gz

Download URL osu_schedule_client-0.1.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8d5c7aac47258c9ff5fb0c53d4e70190de982d65bedc5ff69da6b128bad78481
BLAKE2b-256 checksum
How to use checksums
eee1b60216e5d02a32a0aa88eed4fa448643fef2ac27ea7f10cfe191ca5b8206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / osu_schedule_client-0.1.0-py3-none-any.whl

Download URL osu_schedule_client-0.1.0-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
381b2e0ad2e7433051ff1bbbb6a7d27063c0a60dd0d07eb7f38284add776e980
BLAKE2b-256 checksum
How to use checksums
02555541f72c3f1d5d82f1f78e05f97e697a80c4cd46bb96d09923aefaea1134
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for osu-schedule-client 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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