View more detailed documentation here
Python 2.7 and 3.4+
From PyPi:
$ pip install cleveror
$ easy_install cleverOr from source:
$ python setup.py installThen import the package:
importcleverPlease 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)Git clone swagger-codegen (https://github.com/swagger-api/swagger-codegen)
Git clone Clever's swagger-api repo (https://github.com/Clever/swagger-api)
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
Run
make overrideto copy over the override filesUpdate the CHANGELOG.md with the changes!
make deps
make test
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.