Open edX Filters
raw JSON → 3.1.0 verified Mon Apr 27 auth: no python
Open edX Filters implement the Hooks Extensions Framework (OEP-50), allowing third-party plugins to hook into and modify Open edX platform behavior. Current version is 3.1.0, requiring Python >=3.12. The library is actively maintained by the Open edX community with regular releases.
pip install openedx-filters Common errors
error ImportError: cannot import name 'PipelineData' from 'openedx_filters' ↓
cause Outdated version of openedx-filters (<1.0.0) where PipelineData might not exist or is in a different module.
fix
Upgrade to latest: pip install --upgrade openedx-filters
error ModuleNotFoundError: No module named 'openedx_filters.learning' ↓
cause Using an older version of openedx-filters (<2.0.0) that didn't have the 'learning' subpackage.
fix
Upgrade to 2.0.0+ or import filters from the correct path for your version.
error AttributeError: 'PipelineData' object has no attribute 'update' ↓
cause Trying to use dict methods like .update() on a PipelineData object, which does not directly support it.
fix
Convert to dict first: dict(data).update(...) then return PipelineData(new_dict).
Warnings
breaking Python 3.12 minimum: version 3.0.0 dropped support for Python 3.8, 3.9, 3.10, and 3.11. ↓
fix Upgrade your environment to Python 3.12 or later.
gotcha Filter class names have changed over time; always use the latest naming as per the docs for your version. ↓
fix Refer to the official filter list at https://github.com/openedx/openedx-filters/tree/main/openedx_filters/learning/filters.
gotcha The PipelineData object is not a dict; treating it as one may break attribute access. ↓
fix Always use PipelineData(data_dict) and access via data.your_key or data['your_key'] (it supports both).
Imports
- PipelineData wrong
from openedx_filters.pipeline import PipelineDatacorrectfrom openedx_filters import PipelineData - ToolImplementationError wrong
from openedx_filters.errors import ToolImplementationErrorcorrectfrom openedx_filters import ToolImplementationError - AccountSettingsReadOnlyFieldsRequested wrong
from openedx_filters import AccountSettingsReadOnlyFieldsRequestedcorrectfrom openedx_filters.learning.filters import AccountSettingsReadOnlyFieldsRequested
Quickstart
import openedx_filters
from openedx_filters import PipelineData, ToolImplementationError
# Define a simple filter function that adds data
def my_filter(data, **kwargs):
data['extra'] = 'added by filter'
return PipelineData(data)
# Register the filter (typically in your plugin's app config)
# This assumes the filter is already defined in the Open edX pipeline.
print("Filter registered. See official docs for full example.")