Skip to main content

Client utilities to access various Open edX Platform REST APIs.

Project description

Maintained License Test suite status Code coverage PyPI

The edX REST API Client simplifies communicating with other Open edX services by providing OAuth2 and JWT utilities.

Getting Started with Development

In a Python 3.11 virtual environment:

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

Contributing

Contributions are very welcome. Please read How To Contribute for details.

This project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to have a discussion about your new feature idea with the maintainers prior to beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.

More Help

If you’re having trouble, we have discussion forums at discuss.openedx.org where you can connect with others in the community.

Our real-time conversations are on Slack. You can request a Slack invitation, then join our community Slack workspace.

For anything non-trivial, the best path is to open an issue in this repository with as many details about the issue you are facing as you can provide.

For more information about these options, see the Getting Help page.

The Open edX Code of Conduct

All community members are expected to follow the Open edX Code of Conduct.

Reporting Security Issues

Please do not report security issues in public. Please email security@openedx.org.

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-7.0.0.tar.gz (15.5 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-7.0.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file edx_rest_api_client-7.0.0.tar.gz.

File metadata

  • Download URL: edx_rest_api_client-7.0.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for edx_rest_api_client-7.0.0.tar.gz
Algorithm Hash digest
SHA256 221cb6299d6af30df879084e9f1d1d16a7362e4afd3eef2f81c2e7a8ae7c2e17
MD5 c1feb5f4c9aafee7d0fb6e798da99615
BLAKE2b-256 9b769e4ab36555e1bb932df6d7b98e63ce134872a954c5b99b7fbb08513fa0be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for edx_rest_api_client-7.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 718c573aa6dd11ae23f940ccca0792e66376a8a4d1c515c28612a425e509e679
MD5 a9023bf105234ff746512fb3fb1d9b29
BLAKE2b-256 6b3a11b38d254cb1921ec6a8a8e5c9efb90a5f8fb212cfe95264c3308e9ef6cf

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