Skip to main content

Asynchronous API wrapper for CHSU schedule API

Project description

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

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

chsu_schedule_api-1.2.2.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

chsu_schedule_api-1.2.2-py3-none-any.whl (14.0 kB view hashes)

Uploaded Python 3

Supported by

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