edX CCX Keys

raw JSON →
2.0.2 verified Mon Apr 27 auth: no python

Opaque key support for Custom Courses on edX (CCX). Provides key classes to identify CCX objects within the edX platform. Current version 2.0.2, release cadence is sporadic.

pip install edx-ccx-keys
error InvalidKeyError: Invalid key string: 'ccx-v1:...'
cause The key string format is incorrect or malformed.
fix
Use the correct format: 'ccx-v1:org+course+ccx@ccx_id'.
error ModuleNotFoundError: No module named 'ccx_keys'
cause The package is not installed.
fix
Run 'pip install edx-ccx-keys'.
breaking Version 2.0.0 dropped support for Python 3.8. Python 3.9+ is required.
fix Upgrade Python to 3.9+.
gotcha CcxLocator.from_string() expects a string in the format 'ccx-v1:org+course+ccx@ccx_id'. Incorrect formats will raise InvalidKeyError.
fix Ensure the string matches exactly 'ccx-v1:...' or use the constructor directly.

Basic usage of CcxLocator: parsing and creating CCX keys.

from ccx_keys.locator import CcxLocator

# Parse a CCX key string
key = CcxLocator.from_string('ccx-v1:org+course+ccx@ccx_id')
print(key)

# Create a new CCX key
course_key = CcxLocator('org', 'course', 'run', 'ccx_id')
print(course_key)