chsu_schedule_api

Asynchronous API wrapper for CHSU schedule API


Keywords
chsu, schedule, api
License
MIT
Install
pip install chsu_schedule_api==1.2.2

Documentation

drawing

CHSUScheduleAPI

Pydantic v2 Aiohttp Checked with mypy Poetry

Asynchronous API wrapper for CHSU schedule API

Covered methods

  • Auth (validate token and sign in)
  • Building (get building list)
  • StudentGroup (get all the student groups)
  • Department (get list of departments and cathedras)
  • Auditorium (get auditorium list)
  • TimeTable (get number of academic week / get schedule for lecturer / group / full)
  • Discipline (get list of discipline)
  • Teacher (get list of lecturers)

Installation

Install via pip

pip install chsu_schedule_api

Synchronous example

Get your schedule for today

from chsu_schedule_api import CHSUApi
from chsu_schedule_api.types import Group

client = CHSUApi(username="USERNAME", password="PASSWORD")

client.auth_signin()
group_tt = client.get_time_table(
    Group(title="1ИСб-01-1оп-22")
)

for tt in group_tt:
    print(
        tt.start_time,
        tt.end_time,
        tt.discipline.title,
        tt.auditory.title
    )

Asynchronous example

Get building list

import asyncio

from chsu_schedule_api import CHSUApi

client = CHSUApi(username="USERNAME", password="PASSWORD")


async def main() -> None:
    await client.auth_signin()
    buildings = await client.get_buildings()
    print(buildings)


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

License

MIT