Canvas Parent API
This is an async wrapper for the Canvas API from Instructure. There are a few types of objects this will retrieve based on the assumption that you are a parent with students enrolled with Canvas.
The types of objects that can be returned include:
- Observees (Students)
- Courses
- Assignments
- Submissions
This module is provided for use with the Home Assistant custom integration Canvas however it could be useful as a standalone module for your own projects as well.
Installing
To install the module use:
python3 -m pip install canvas-parent-api
Get API Token
If you are a parent, you will have a Canvas Parent account. To get an API token, you must sign into the Canvas Parent application from a web browser. This is typically using: https://.instructure.com/login/canvas
Once you have signed into your account, navigate to Account > Settings.
Under "Approved Integrations" click "+ New Access Token" to create a new API Token.
Enter a Purpose and Expiration date (blank for no expiration).
Be sure to save your API token, as you will have to generate a new token if this is lost.
Usage
Example usage to get students, printing names:
import asyncio
from canvas_parent_api import Canvas
base_url = "https://school.instructure.com"
api_token = "randomstringthatisntreallyatoken"
async def get_students():
client = Canvas(f"{base_url}",f"{api_token}")
return await client.observees()
students = asyncio.run(get_students())
for student in students:
print(student.name)
Patch Notes
-
0.0.12:
- Added pagination support to automatically paginate to end of available requests
-
0.0.9:
- Added Submissions
Metadata
Release files for canvas-parent-api 0.0.23
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 |
|---|---|---|---|---|
| canvas_parent_api-0.0.23.tar.gz | 10.7 kB | Without provenance | Details for canvas_parent_api-0.0.23.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| canvas_parent_api-0.0.23-py3-none-any.whl | Python 3 | none | any | Details for canvas_parent_api-0.0.23-py3-none-any.whl |
Total release size: 22.4 kB
Release files / canvas_parent_api-0.0.23.tar.gz
| Download URL | canvas_parent_api-0.0.23.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ecda86a191ae7453fc0efcbe50da5214cc131d50799a4101021dcc0397dcc0b9
|
|
BLAKE2b-256 checksum How to use checksums |
5128aebec4a78d2028f697539ff11df1afb19d195df6e56dbfd018cfd4851361
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.2
|
Release files / canvas_parent_api-0.0.23-py3-none-any.whl
| Download URL | canvas_parent_api-0.0.23-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
169812003177e14e8029de80561939aee3978bdec776559ec10770a188ad79cc
|
|
BLAKE2b-256 checksum How to use checksums |
17c4bc0708116a7a7af447c652796e788ad9f39405387fb654f2a0bc1227c101
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.2
|
Security for canvas-parent-api 0.0.23
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.