nikel-py
A modern, easy to use, async and sync API wrapper for the nikel API written in Python.
Key Features
- Gather Data about UofT Courses, Programs, Textbooks, Services, and more
- Gather Data asynchronously so main event loop isn't blocked
Installation
Python 3.6 or higher is required
#Linux/macOS
python3 -m pip install -U nikel-py
#Windows
py -3 -m pip install -U nikel-py
Current list of endpoints
- Courses
- Programs
- Textbooks
- Examples
- Evals
- Food
- Services
- Buildings
- Parking
Methods
get(query : Dict, limit : int=10)Synchronousasync_get(query : Dict, limit : int=10)Asynchronous
Basic Examples
Synchronous
from nikel_py import Courses
'''
Creates a list (limited to 1) of courses that have the name "Introduction to Computer
Programming"
'''
x = Courses.get({'name' : 'Introduction to Computer Programming'}, limit=1)
print(x[0].code)
# >> CSC108H1
Asynchronous
import asyncio
from nikel_py import Textbooks
async def main():
#Creates a list (limited to 1) of Textbooks that have the ID '10552179'
x = await Textbooks.async_get({'id' : '10552179'}, limit=1)
print(x[0].name)
asyncio.run(main())
# >> Where The Wild Things Are
Advanced Examples (Filtering & Extra Fields)
Synchronous
from nikel_py import Foods
query = {
'coordinates.latitude' : 43.66332,
'attributes' : '~Gluten Free'
}
'''
Creates a list (limited to 10) of Restaurants that provide Gluten Free Foods and have
a latitude of 43.66332
'''
x = Foods.get(query, limit=10)
print(x[0].name)
# >> Second Cup Kiosk
Asynchronous
import asyncio
from nikel_py import Programs
async def main():
query = {
'campus' : 'St. George',
'name' : '(Computer Science'
}
'''
Creates a list (limited to 1) of Programs that start with Computer Science and
are done at the St. George Campus
'''
x = await Programs.async_get(query, limit=1)
print(x[0].type)
asyncio.run(main())
# >> major
Filters
| Operator | String | Numerical/Boolean |
|---|---|---|
| Fuzzy Search | Equality | |
| = | Equality | Equality |
| ! | Inequality | Inequality |
| < | N/A | Less than |
| <= | N/A | Less than or equal to |
| > | N/A | Greater than |
| >= | N/A | Greater than or equal to |
| ( | Starts with | N/A |
| ) | Ends with | N/A |
| ~ | Serialization | N/A |
Note: the ~ operator essentially "yolos" and tries to search within nested arrays and hard to navigate nested structures.
For more information. Please go Here
Query & Properties Lookup Table
Note: All Objects listed below have an all_data property which returns every property in JSON format.
| Courses | Programs | Textbooks | Exams | Evals | Food | Services | Buildings | Parking |
|---|---|---|---|---|---|---|---|---|
| id | id | id | id | id | id | id | id | id |
| code | name | isbn | course_id | name | name | name | code | name |
| name | type | title | course_code | campus | description | alias | tags | alias |
| description | campus | edition | campus | terms | tags | building_id | name | building_id |
| division | description | author | date | last_updated | campus | description | short_name | description |
| department | enrollment | image | start | address | campus | address | campus | |
| prerequisites | completion | price | end | coordinates | address | coordinates | address | |
| corequisites | last_updated | url | duration | hours | image | last_updated | coordinates | |
| exclusions | courses | sections | image | coordinates | last_updated | |||
| recommended_preparation | last_updated | last_updated | url | tags | ||||
| level | attributes | |||||||
| campus | last_updated | |||||||
| term | attributes | |||||||
| arts_and_science_breadth | last_updated | |||||||
| arts_and_science_distribution | ||||||||
| utm_distribution | ||||||||
| utsc_breadth | ||||||||
| apsc_electives | ||||||||
| meeting_sections | ||||||||
| last_updated |
For more info please refer to the Schemas of each Endpoint Here
Metadata
Release files for nikel-py 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nikel-py-0.1.8.tar.gz | 8.9 kB | Without provenance | Details for nikel-py-0.1.8.tar.gz |
Release files / nikel-py-0.1.8.tar.gz
| Download URL | nikel-py-0.1.8.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
494179ba4cac8de893fccc8a150a970d276bc407561f30e7d6290caebf8e89a7
|
|
BLAKE2b-256 checksum How to use checksums |
9c1fa03c1019eeaf56cf2e654a8e6c1684a55a0d417c254b5e477363bbe645a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.7
|
Security for nikel-py 0.1.8
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.