<img src="https://raw.githubusercontent.com/vovchic17/static/main/src/logo.svg" alt="drawing" width="150"/>
# CHSUScheduleAPI
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
[![Aiohttp](https://img.shields.io/badge/aiohttp-v3.9.3-2c5bb4?logo=aiohttp)](https://docs.aiohttp.org/en/stable/)
[![Checked with mypy](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/vovchic17/static/main/src/badges/mypy.json)](https://mypy-lang.org/)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
Asynchronous API wrapper for [CHSU schedule API](http://api.chsu.ru)
## 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
```shell
pip install chsu_schedule_api
```
## Synchronous example
Get your schedule for today
```python
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
```python
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
Raw data
{
"_id": null,
"home_page": "https://github.com/vovchic17/CHSUScheduleAPI",
"name": "chsu_schedule_api",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": "chsu, schedule, api",
"author": "VoVcHiC",
"author_email": "hello@chsutech.ru",
"download_url": "https://files.pythonhosted.org/packages/c8/88/ec41ba1076e33d23bc5034c1a101064a25da4fc5c20f544d3d8a52491a11/chsu_schedule_api-1.2.2.tar.gz",
"platform": null,
"description": "<img src=\"https://raw.githubusercontent.com/vovchic17/static/main/src/logo.svg\" alt=\"drawing\" width=\"150\"/>\n\n\n# CHSUScheduleAPI\n[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)\n[![Aiohttp](https://img.shields.io/badge/aiohttp-v3.9.3-2c5bb4?logo=aiohttp)](https://docs.aiohttp.org/en/stable/)\n[![Checked with mypy](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/vovchic17/static/main/src/badges/mypy.json)](https://mypy-lang.org/)\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n\nAsynchronous API wrapper for [CHSU schedule API](http://api.chsu.ru)\n\n## Covered methods\n* Auth (validate token and sign in)\n* Building (get building list)\n* StudentGroup (get all the student groups)\n* Department (get list of departments and cathedras)\n* Auditorium (get auditorium list)\n* TimeTable (get number of academic week / get schedule for lecturer / group / full)\n* Discipline (get list of discipline)\n* Teacher (get list of lecturers)\n\n## Installation\n\nInstall via pip\n\n```shell\npip install chsu_schedule_api\n```\n\n## Synchronous example\nGet your schedule for today\n```python\nfrom chsu_schedule_api import CHSUApi\nfrom chsu_schedule_api.types import Group\n\nclient = CHSUApi(username=\"USERNAME\", password=\"PASSWORD\")\n\nclient.auth_signin()\ngroup_tt = client.get_time_table(\n Group(title=\"1\u0418\u0421\u0431-01-1\u043e\u043f-22\")\n)\n\nfor tt in group_tt:\n print(\n tt.start_time,\n tt.end_time,\n tt.discipline.title,\n tt.auditory.title\n )\n```\n\n## Asynchronous example\nGet building list\n```python\nimport asyncio\n\nfrom chsu_schedule_api import CHSUApi\n\nclient = CHSUApi(username=\"USERNAME\", password=\"PASSWORD\")\n\n\nasync def main() -> None:\n await client.auth_signin()\n buildings = await client.get_buildings()\n print(buildings)\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n## License\nMIT",
"bugtrack_url": null,
"license": "MIT",
"summary": "Asynchronous API wrapper for CHSU schedule API",
"version": "1.2.2",
"project_urls": {
"Homepage": "https://github.com/vovchic17/CHSUScheduleAPI",
"Repository": "https://github.com/vovchic17/CHSUScheduleAPI"
},
"split_keywords": [
"chsu",
" schedule",
" api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "614055f650bf6c0635a75c248f39ed49219a000077c28e9fedac5dd923025f1c",
"md5": "8317886d371fb6e33485a1ea09f29823",
"sha256": "368b9819b98e47106fb8130c1bb5ac327b3a2cbdff68fbac084a69736328a005"
},
"downloads": -1,
"filename": "chsu_schedule_api-1.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8317886d371fb6e33485a1ea09f29823",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 13970,
"upload_time": "2024-05-10T00:19:28",
"upload_time_iso_8601": "2024-05-10T00:19:28.908197Z",
"url": "https://files.pythonhosted.org/packages/61/40/55f650bf6c0635a75c248f39ed49219a000077c28e9fedac5dd923025f1c/chsu_schedule_api-1.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c888ec41ba1076e33d23bc5034c1a101064a25da4fc5c20f544d3d8a52491a11",
"md5": "65b594bb7afe98ed6013c4bbe5acd390",
"sha256": "0c6666258e310dbd29556c687922b263163d81795591b690229a6896a4fad045"
},
"downloads": -1,
"filename": "chsu_schedule_api-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "65b594bb7afe98ed6013c4bbe5acd390",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 8236,
"upload_time": "2024-05-10T00:19:30",
"upload_time_iso_8601": "2024-05-10T00:19:30.092478Z",
"url": "https://files.pythonhosted.org/packages/c8/88/ec41ba1076e33d23bc5034c1a101064a25da4fc5c20f544d3d8a52491a11/chsu_schedule_api-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-10 00:19:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "vovchic17",
"github_project": "CHSUScheduleAPI",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "chsu_schedule_api"
}