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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for edx_rest_api_client-6.2.0.tar.gz
Algorithm Hash digest
SHA256 b3f10bfa139c7660e8942261bed7d7c8973fd67b31a12a59d116a1b6dc023f28
MD5 5df6ab385f4d58ed4395940e8e343557
BLAKE2b-256 fb9d33223aebe6b779fd05ffead2817cbbd54c698d19d950d7b176f4cb951f41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for edx_rest_api_client-6.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c53227d763d96c2fbeaee21b84e33b9c2a31148336303a7d7d9b555c58b9db2
MD5 f062819ce04bfe34d4a87ce5b5fa97b8
BLAKE2b-256 0cc5d7e96a0b2a6764b135b54ff2e9efad9ed4d4e989ae8812ba814426329871

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