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.8 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-5.6.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

edx_rest_api_client-5.6.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: edx-rest-api-client-5.6.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for edx-rest-api-client-5.6.1.tar.gz
Algorithm Hash digest
SHA256 e65448874c1892cda3acaed230cdd78a54778ef7920fafdb02a3952c4869ef72
MD5 11e8cdbfa9330635d6d32f03aa0a238c
BLAKE2b-256 7c80164ee4ce29f36881947144cee03c1cdc05542ad68f45f99c005b9a594d3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for edx_rest_api_client-5.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e17a4f86fada8bf545fba166050eedf9bc30171cb3a3e4e380bf5a1184022882
MD5 aa253dc9b61171c52f8d294a216cb497
BLAKE2b-256 38187602322d2eb72c3dbd4b0ba1f3adb6038b85fffd67adc7b9930b5ece786c

See more details on using hashes here.

Supported by

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