Open edX Events
raw JSON → 11.2.0 verified Mon Apr 27 auth: no python
Open edX Events provides a set of event definitions and utilities for the Hooks Extensions Framework (HEF) in Open edX. Version 11.2.0 is the latest release, with frequent updates. It defines structured events for signaling actions in the Open edX platform.
pip install openedx-events Common errors
error ImportError: cannot import name 'OpenEdxPublicSignal' from 'openedx_events' ↓
cause The symbol is not top-level; it's in the tooling submodule.
fix
Use:
from openedx_events.tooling import OpenEdxPublicSignal error AttributeError: module 'openedx_events' has no attribute 'OrgEvents' ↓
cause OrgEvents is located in the event_bus submodule.
fix
Use:
from openedx_events.event_bus import OrgEvents Warnings
breaking In version 11.0.0, the event_bus module was refactored. `OrgEvents` is now imported from `openedx_events.event_bus` instead of the old location. ↓
fix Update imports: `from openedx_events.event_bus import OrgEvents`.
deprecated The `EVENT_ORDER_CREATED` event type was deprecated in 10.0.0; use `ORDER_CREATED` instead. ↓
fix Replace `EVENT_ORDER_CREATED` with `ORDER_CREATED` in event data.
gotcha When defining a custom signal, the event_type must follow the convention `org.your_org.your_event` or it may be rejected by the event bus. ↓
fix Use a fully qualified event type with at least three segments separated by dots.
Imports
- OpenEdxPublicSignal wrong
from openedx_events import OpenEdxPublicSignalcorrectfrom openedx_events.tooling import OpenEdxPublicSignal - OrgEvents wrong
from openedx_events import OrgEventscorrectfrom openedx_events.event_bus import EventBus, OrgEvents
Quickstart
from openedx_events.tooling import OpenEdxPublicSignal
from openedx_events.learning.data import UserData, CourseData
# Define a custom signal
custom_signal = OpenEdxPublicSignal(
event_type="org.myorg.my.event",
data={
"user": UserData,
"course": CourseData,
}
)
# Send the signal
custom_signal.send_event(
user=UserData(id=1, email="user@example.com"),
course=CourseData(course_key="course-v1:Org+Course+2025")
)