Skip to content

Commit 110dc06

Browse files
kdmccormickclaude
andcommitted
docs: claude tone pass at opaquekeys section
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bffe51e commit 110dc06

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

oeps/best-practices/oep-0068-bp-content-identifiers.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -202,26 +202,26 @@ with a regex validator. A factory function is available at ``openedx_django_lib.
202202
OpaqueKeys
203203
==========
204204

205-
An OpaqueKey (defined in `openedx/opaque-keys`_) is an immutable Python object
206-
that bundles together a "key type" and one or more codes to uniquely identify a
207-
resource across an entire Open edX instance. Think of it as a structured,
208-
semi-human-readable string ID. ``OpaqueKey`` itself is an abstract base class
209-
organized into a hierarchy: abstract intermediate classes represent broad
210-
concepts (like ``LearningContextKey`` and ``UsageKey``), while concrete
211-
subclasses represent specific resource types (like ``CourseLocator`` and
212-
``LibraryUsageLocatorV2``). Each concrete type serializes to a predictable
213-
string format.
214-
215-
OpaqueKeys are designed to identify a resource on a single instance, but
216-
identical OpaqueKeys can naturally occur across instances. For example, if you
217-
export a course from one instance and import it into another with the same
218-
org/course/run codes, all blocks' OpaqueKeys will match. External tools like
219-
catalog integrations, sync workflows, and reporting scripts may rely on
220-
OpaqueKeys to associate data across instances. But, there are limitations:
221-
content can diverge over time, learner data is always
222-
instance-specific, and Open edX itself doesn't enforce any meaning to OpaqueKeys
223-
across instance boundaries. If you need truly global, unambiguous identity
224-
across all instances, use UUIDs instead.
205+
An ``OpaqueKey`` (defined in `openedx/opaque-keys`_) is an immutable Python object that
206+
bundles a "key type" and one or more codes to uniquely identify a resource within an Open edX
207+
instance. Think of it as a structured, semi-human-readable instance-scoped identifier.
208+
209+
``OpaqueKey`` is an abstract base class organized into a hierarchy: abstract intermediate
210+
classes represent broad concepts (like ``LearningContextKey`` and ``UsageKey``), while concrete
211+
subclasses represent specific resource types (like ``CourseLocator`` and ``LibraryUsageLocatorV2``).
212+
Each concrete type serializes to a predictable string format.
213+
214+
**A note on cross-instance usage:** OpaqueKeys are designed for use within a single instance,
215+
but the same OpaqueKey can naturally appear in multiple instances. For example, if you export a
216+
course with org code ``Axim``, course code ``Chem101``, and run code ``Spring2026`` from one
217+
instance and import it elsewhere using the same codes, all the blocks will have identical
218+
OpaqueKeys. This is useful: external tools like catalog integrations, sync workflows, and
219+
reporting scripts can use OpaqueKeys to correlate data across instances.
220+
221+
However, OpaqueKeys have limits. Content can diverge after import, learner data stays
222+
instance-specific, and Open edX doesn't enforce any global meaning to OpaqueKeys across
223+
boundaries. If you need an identifier that is truly unique across all instances, use UUIDs
224+
instead.
225225

226226
For example:
227227

0 commit comments

Comments
 (0)