A basic Python TDSB Connects API using aiohttp.
Project description
pytdsbconnects
A basic Python TDSB Connects API using aiohttp.
Made with info and help from @mincrmatt12.
Example usage:
import asyncio
import datetime
import tdsbconnects
from getpass import getpass
async def main():
async with tdsbconnects.TDSBConnects() as session: # type: tdsbconnects.TDSBConnects
print("loggin in")
await session.login(input("Username: "), getpass())
print("getting info")
info = await session.get_user_info()
print(info.name, "is a", info.roles[0], "at", info.schools[0].name, "with code",
info.schools[0].code, "in the school year", info.schools[0].school_year, "starting on",
info.schools[0].school_year_start, "and ending on", info.schools[0].school_year_end)
date = datetime.datetime.strptime(input("enter a date to get your timetable for (YYYY-MM-DD): "), "%Y-%m-%d")
timetable = await info.schools[0].timetable(date)
if timetable:
print("that day is a day", timetable[0].course_cycle_day, "and here are your courses:")
for item in timetable:
print("In period", item.course_period, "(starting at", item.course_start, "and ending at",
item.course_end, ") you have class", item.course_name, "with code", item.course_code, "(block",
item.course_block, ") with teacher", item.course_teacher_name, "(email:", item.course_teacher_email, ")")
else:
print("no timetable for that day.")
asyncio.get_event_loop().run_until_complete(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytdsbconnects-0.1.1.tar.gz
(5.3 kB
view details)
Built Distribution
File details
Details for the file pytdsbconnects-0.1.1.tar.gz
.
File metadata
- Download URL: pytdsbconnects-0.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dbdd55368e6bb5276333e0c4078fd4b41df40a041bf8d0fd43e9e7b1ef0e473 |
|
MD5 | 430a78f60bd3d972585da01bec584d43 |
|
BLAKE2b-256 | 2eee0d760736d44752b386db843255fccf1b0223a597df667fb6a354fc4b1aea |
File details
Details for the file pytdsbconnects-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pytdsbconnects-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67c5bfc155d3ef53d902afa65cf56d758e05f47e08267d34a805732005cb0c73 |
|
MD5 | 1dfa898e0406cf9b40d14b46d3d04120 |
|
BLAKE2b-256 | 13a63bb2a285da0c4e070021241b172518ba588ba92866557d27a583ce40a33b |