Skip to main content

Client library for Apereo OpenLRW API

Project description

# OpenLRW Python API Client


> A Python Client making your scripts for OpenLRW easier

<p align="center">
<a href='https://www.python.org/dev/peps/pep-0008/'><img src="https://img.shields.io/badge/code%20style-pep8-orange.svg" alt="code style pep 8"></a>
<a href="https://badge.fury.io/py/openlrw"><img src="https://badge.fury.io/py/openlrw.svg" alt="PyPI version"></a>
</p>

## Getting Started
` pip install openlrw `

## Usage

#### 1. Interacting with the User collection

```python

from openlrw.client import OpenLRW
from openlrw.exceptions import ExpiredTokenException

OpenLrw = OpenLRW(uri, username, password) # Create an instance of the client
jwt = OpenLrw.generate_jwt() # Generate a JSON Web Token for using OneRoster routes

# 1. Get the user john_doe
try:
user = OpenLrw.get_user('john_doe', jwt)
except ExpiredTokenException:
OpenLRW.pretty_error("Error", "JWT Expired")

# 2. Get all the users
try:
users = OpenLrw.get_users(jwt)
except ExpiredTokenException:
OpenLRW.pretty_error("Error", "JWT Expired")




```


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

openlrw-1.0.0rc0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

openlrw-1.0.0rc0-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

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