Metadata-Version: 2.1
Name: powerschool
Version: 0.2.0
Summary: powerschool is a Python client for the PowerSchool API
Home-page: https://github.com/TEAMSchools/powerschool
License: GPL-3.0-or-later
Author: Charlie Bini
Author-email: cbini87@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: fiql_parser (>=0.15,<0.16)
Requires-Dist: oauthlib (>=3.1.0,<4.0.0)
Requires-Dist: python-dateutil (>=2.8.1,<3.0.0)
Requires-Dist: requests (>=2.24.0,<3.0.0)
Requires-Dist: requests_oauth (>=0.4.1,<0.5.0)
Project-URL: Repository, https://github.com/TEAMSchools/powerschool
Description-Content-Type: text/markdown

# PowerSchool

powerschool is a Python client for the [PowerSchool SIS](https://www.powerschool.com/solutions/student-information-system/powerschool-sis) API

## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install powerschool.

```bash
pip install powerschool
```

## Getting Started
1. Ensure you have a valid [plugin](https://support.powerschool.com/developer/#/page/plugin-xml) installed with the proper data access provisioned for your purposes.

2. Instantiate the client by passing the host name of your server.
```python
import powerschool
ps = powerschool.PowerSchool('my.host.name')
```

3. Authorize the client using:
    - client credentials (a tuple)
    ```python
    my_credentials = (client_id, client_secret)
    ps.authorize(client_credentials=my_credentials)
    ```
    - a previously saved access token (dict)
    ```python
    with open(token_file, 'r') as f:
        my_token = json.load(f)
    
    ps.authorize(access_token=my_token)
    ```
    
## Usage
Instantiate a table or PowerQuery object:
```python
schools_table = ps.get_schema_table('schools')
powerquery = ps.get_named_query('com.pearson.core.student.search.get_student_basic_info')
```

Get the record count for a table, passing a query filter:
```python
schools_table.count()
```

Query all records, all columns on a table:
```python
schools_table.query()
```

Query all records on a table, with filter and columns list:
```python
params = {
    'q': 'id=ge=10000',
    'projection': 'school_number,abbreviation',
}
schools_table.query(**params)
```

Query a specific record on a table:
```python
schools_table.query(dcid=123)
```

Execute a PowerQuery, passing arguments in the body:
```python
payload = {
    'studentdcid': '5432',
}
powerquery.query(body=payload)
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## Notice
PowerSchool® is a registered trademark in the U.S. and/or other countries owned by PowerSchool Education, Inc. or its affiliates. PowerSchool® is used under license.

