Skip to content

Repository files navigation

Clever - the Python library for the Clever API

API Documentation

View more detailed documentation here

Requirements.

Python 2.7 and 3.4+

Installation

From PyPi:

 $ pip install clever

or

 $ easy_install clever

Or from source:

 $ python setup.py install

Then import the package:

importclever

Getting Started

Please follow the installation procedure and then run the following:

from __future__ importprint_functionimporttimeimportcleverfromclever.restimportApiExceptionfrompprintimportpprint# Note: This is hard coded for demo purposes only. Keep your access tokens secret!# https://dev.clever.com/docs/security#section-security-best-practices# Configure OAuth2 access token for authorization: oauthconfiguration=clever.Configuration()
configuration.access_token='YOUR_ACCESS_TOKEN'# create an instance of the API classapi_instance=clever.DataApi(clever.ApiClient(configuration))
try:
api_response=api_instance.get_students()
forstudentinapi_response.data:
pprint(student.data.id)
exceptApiExceptionase:
print("Exception when calling DataApi->get_students: %s\n"%e)

Updating the Library

  1. Git clone swagger-codegen (https://github.com/swagger-api/swagger-codegen)

  2. Git clone Clever's swagger-api repo (https://github.com/Clever/swagger-api)

  3. Run this command in the swagger-codegen repo

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i $PATH_TO_SWAGGER_API_REPO/v2.1-client.yml -l python -o $PATH_TO_THIS_REPO --additional-properties packageVersion=$VERSION
  1. Run make override to copy over the override files

  2. Update the CHANGELOG.md with the changes!

Development

Dependencies

make deps

Testing

make test

Publishing

Run make publish to publish a new version of the library.

In order to publish to PyPI you will need a .pypirc file in your $HOME directory with the following contents:

[distutils]
index-servers =
pypi
[pypi]
username: ****
password: ****

The username and password are in 1Password for Teams under PyPI.

About

Clever Python bindings

Resources

Stars

0 stars

Watchers

13 watching

Forks

Releases

Packages

Contributors

Languages