edx-rest-api-client
raw JSON → 7.0.0 verified Mon Apr 27 auth: no python
Client utilities for accessing various Open edX Platform REST APIs. Version 7.0.0 is the latest. Release cadence irregular, with major version bumps for Python/Django support.
pip install edx-rest-api-client Common errors
error ImportError: cannot import name 'EdxRestApiClient' ↓
cause Incorrect import path after version 6.0.0 restructure.
fix
Use: from edx_rest_api_client.client import EdxRestApiClient
error AttributeError: module 'edx_rest_api_client' has no attribute 'EdxRestApiClient' ↓
cause Trying to import from package root instead of submodule.
fix
Use: from edx_rest_api_client.client import EdxRestApiClient
Warnings
breaking In v6.0.0, the `EdxRestApiClient` class was deprecated in favor of using requests directly. The client still works but is no longer maintained. ↓
fix Consider migrating to plain `requests` calls with OAuth2 or JWT.
gotcha Client depends on Django settings for OAuth2 authentication. Ensure `django.conf.settings` is configured before importing `OAuth2Client`. ↓
fix Set `DJANGO_SETTINGS_MODULE` environment variable or configure Django settings early.
Imports
- EdxRestApiClient
from edx_rest_api_client.client import EdxRestApiClient - OAuth2Client
from edx_rest_api_client.auth import OAuth2Client
Quickstart
from edx_rest_api_client.client import EdxRestApiClient
client = EdxRestApiClient(
url='https://api.example.com',
jwt='your-jwt-token'
)
response = client.courses.get()
print(response)