Skip to main content

Slumber client used to access various edX Platform REST APIs.

Project description

The edX REST API Client (henceforth, client) allows users to communicate with various edX REST APIs, including the E-Commerce Service and the Programs Service.

Testing

$ 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.

Usage

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.

Additional Requirements

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.

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

edx-rest-api-client-5.4.1.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edx_rest_api_client-5.4.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file edx-rest-api-client-5.4.1.tar.gz.

File metadata

  • Download URL: edx-rest-api-client-5.4.1.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for edx-rest-api-client-5.4.1.tar.gz
Algorithm Hash digest
SHA256 0c22418d5d6bcebd60586be766b6ef0af5a2dffdc7196ac2f4773be4ea461b03
MD5 9640ba8333885125be0c6c35b27fde9a
BLAKE2b-256 8f3202ac7374b1cf696330b335c3161d9872e00296e6ec5ed6bab0a56f8b4fd7

See more details on using hashes here.

File details

Details for the file edx_rest_api_client-5.4.1-py3-none-any.whl.

File metadata

  • Download URL: edx_rest_api_client-5.4.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for edx_rest_api_client-5.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15933cd4259116070729c1cf566f6e8e66417cf3bbb6b0fc1e9c7b82e6b5f461
MD5 fcf136f5eccf1a9dcc2dac1085d74cb0
BLAKE2b-256 a5f2db32115f5993d615abd41ca5bc10219804441e049ea6c291bd68c1966d58

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page