Skip to main content

edX REST API Client

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.

Release files for edx-rest-api-client 7.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for edx-rest-api-client 7.1.0
File Size Uploaded
edx_rest_api_client-7.1.0.tar.gz 103.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for edx-rest-api-client 7.1.0
File Interpreter ABI Platform
edx_rest_api_client-7.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 116.4 kB

Release files / edx_rest_api_client-7.1.0.tar.gz

Download URL edx_rest_api_client-7.1.0.tar.gz
Size 103.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0b39ae6035f1459466724a5afacce2cb1be8c2e07b9f546b91e473f9056ac297
BLAKE2b-256 checksum
How to use checksums
f2cb219c56b408f9c5a8fcf83d3a9168220fb8ab01d3b5012b703a22145de604
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / edx_rest_api_client-7.1.0-py3-none-any.whl

Download URL edx_rest_api_client-7.1.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0817167d894e0fdabf81752dbe858c93f789d4e00c3112e0e141fcd5818ba737
BLAKE2b-256 checksum
How to use checksums
b0df5c2b8cac9b8a896841f60e1d8c131866e06d345bdab4ffe29bcbe2e79250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

7.1.0 This release

2 release files

7.0.0

2 release files

6.2.0

2 release files

6.1.0

2 release files

6.0.0

2 release files

5.7.1

2 release files

5.7.0

2 release files

5.6.1

2 release files

5.6.0

2 release files

5.5.2

2 release files

5.5.1

2 release files

5.5.0

2 release files

5.4.1

2 release files

5.4.0

2 release files

5.3.0

2 release files

5.2.3

2 release files

5.2.2

2 release files

5.2.1

2 release files

5.2.0

2 release files

5.1.0

2 release files

5.0.2

2 release files

5.0.1

2 release files

4.0.1

2 release files

3.0.2

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9

2 release files

1.8.2

2 release files

1.8.0

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page