Skip to main content

Asynchronous client for PowerSchool API

Project description

PyPowerSchool

PyPI - Python Version PyPI MIT

PyPowerSchool is a basic Python wrapper for asynchronous communication with the PowerSchool API. The goal is to simplify the process of communicating with the PowerSchool Student Information System API by handling authentication and decoding, allowing you to focus on using the data, not retrieving it.

PyPowerSchool is not endorsed, sponsored, or affilitated with PowerSchool in any way.


Table of Contents


PowerSchool Plugin

Before using PyPowerSchool, you will need to create and install a data access plugin on your PowerSchool server. Information about creating the plugin file can be found on the PowerSchool Developer Support site. We have created an example plugin (PSDataAccessCorePlugin) that you can use as is, or modify as you see fit. Once you have installed the plugin, you will be provided a client ID and client secret that you will use for authenticating with the PowerSchool server.

Usage

Begin by installing the PyPowerSchool module, using pip.

pip install pypowerschool

In your code, simply import the PyPowerSchool module and instantiate a new client object. The constructor requires three arguments:

  1. base_url - the base URL of your PowerSchool server
  2. client_id - client ID, found after installing the data access plugin
  3. client_secret - client secret, found after installing the data access plugin
from pypowerschool import powerschool

client = powerschool.Client('https://example.powerschool.com', 'client-id', 'client-secret')

Once you have a client, you can start making asynchronous calls to the API.

# returns list of all schools in the current district
all_schools = await client.schools_in_district()

# returns list of all students for school with ID of 3
students = await client.students_for_school(3)

# returns dictionary of student with DCID of 1234
student = await client.student_for_dcid(1234)

Refer to the endpoints.py file for other built-in methods. Additionally, you can use the fetch_item and fetch_items methods to access any PowerSchool endpoint. Basic support for POST has been included through the post_data method.

PowerQueries

PowerQueries are a feature that allows for the creation of custom API endpoints. PyPowerSchool only includes core endpoints and PowerQueries provided directly by PowerSchool. To add additional core PowerQueries to PyPowerSchool, you will need to modify the plugin file (PSDataAccessCorePlugin) with the proper <access-request> elements.

Using a PowerQuery endpoint works just like any other endpoint. The powerquery method requires the PowerQuery endpoint URL and, optionally, a dictionary of arguements for the PowerQuery.

# returns a list of grade levels for the school and district office
grade_levels = await client.powerquery('/ws/schema/query/com.pearson.core.schools.grade_levels')

# returns school information for the school with an ID of 1
school_details = await client.powerquery('/ws/schema/query/com.pearson.core.school.school_detail', {'school_number':[1]})

Contributing

If you have a feature or idea you would like to see added to PyPowerSchool, please create an issue explaining your idea.

Likewise, if you come across a bug, please create an issue explaining the bug with as much detail as possible.

The PowerSchool API provides access to a lot of information and, unfortunately, we don't have time to research and implement every endpoint. Please feel free to open a pull request with any additional endpoints you create. We would love to have as many of the core endpoints covered as possible.

License

PyPowerSchool is released under an MIT license. See LICENSE for more information.

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

pypowerschool-0.1.4.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

pypowerschool-0.1.4-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file pypowerschool-0.1.4.tar.gz.

File metadata

  • Download URL: pypowerschool-0.1.4.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pypowerschool-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0ab49178e549e5ca4a3ff3a425da0645d12638954f0174532cfe5e1927933c9c
MD5 ab4f3dcc75b4ee8c4a1cb9d8542824d0
BLAKE2b-256 e4df93d39818f6e1685bd2f208c5848e55d3b5101b96bd5f4771ad6b9ec5eb73

See more details on using hashes here.

File details

Details for the file pypowerschool-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pypowerschool-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pypowerschool-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f2f6333b082cdc2eebcc3358ac481f93c35e4d184e0a20f24ff7c0ea8a16f033
MD5 31fb496ffe0da7ff6c5f6dc4cc33a844
BLAKE2b-256 e496a41e9b6946551f86bceb39f3b9e2ff8be4ce2fe36a8dab0f426456a4f74a

See more details on using hashes here.

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