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-6.0.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

edx_rest_api_client-6.0.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: edx_rest_api_client-6.0.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for edx_rest_api_client-6.0.0.tar.gz
Algorithm Hash digest
SHA256 8f7c87647d7e7220b8f2a8cc2b99190b7a6c93b0c860018e02b88fe1e33b03cd
MD5 debd95eb025deea6c2ec4f1a7b8ca7ed
BLAKE2b-256 f95a9c4a6254b7c6e081d2759076b8f6b44833def1128f2136c769a1f111f987

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for edx_rest_api_client-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 239564c50231c205c804a5c65bfa12173af8a78986327f2de52ead26b573b9f9
MD5 e6854ef9342f314202529331aa042f47
BLAKE2b-256 80d299f2573d36056f92af5684a455bc953025cdf4d5f385ea24922321a0c5c7

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