Slumber client used to access various edX Platform REST APIs.
$ make validate
Clients & REST API Clients code
Open edX services, including LMS, should use the OAuthAPIClient class to make OAuth2 client requests and REST API calls.
By default the OAuthAPIClient object can be used like any requests.Session object and you can follow the docs that the requests library provides.
The OAuthAPIClient sessions makes some extra requests to get access tokens from the auth endpoints. These requests have a default timeout that can be overridden by passing in a timeout parameter when instantiating the OAuthAPIClient object.
# create client with default timeouts for token retrieval client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret') # create client, overriding default timeouts for token retrieval client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret', timeout=(6.1, 2)) client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret', timeout=(REQUEST_CONNECT_TIMEOUT, 3) ) # for a request to some.url, a separate timeout should always be set on your requests client.get('https://some.url', timeout=(3.1, 0.5))
The value of the timeout setting is the same as for any request made with the requests library. See the Requests timeouts documentation for more details.
The OAuthAPIClient uses the TieredCache internally for caching. Read more about the requirements of TieredCache, which include Django caching and some custom middleware.
How to Contribute
Contributions are very welcome, but for legal reasons, you must submit a signed individual contributor’s agreement before we can accept your contribution. See our CONTRIBUTING file for more information – it also contains guidelines for how to maintain high code quality, which will make your contribution more likely to be accepted.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size edx_rest_api_client-5.2.1-py3-none-any.whl (13.0 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size edx-rest-api-client-5.2.1.tar.gz (11.5 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for edx_rest_api_client-5.2.1-py3-none-any.whl
Hashes for edx-rest-api-client-5.2.1.tar.gz