topmark.registry.processors¶
topmark / registry / processors
Advanced public registry for processor definitions.
This module exposes read-oriented views and limited mutation hooks for the
composed processor registry used by TopMark. Most callers should prefer the
stable facade in topmark.registry.registry.Registry;
this module primarily serves advanced integrations, plugins, and tests.
Notes
- Public views such as
as_mapping()anditer_meta()are derived from a composed registry (base built-ins + local overlays - removals) and are exposed asMappingProxyTypewhere appropriate. register()andunregister()apply overlay-only changes; they do not mutate the base processor-definition registry built from explicit built-in bindings.- The canonical identity-oriented processor view is keyed by canonical
processor key and exposed via
as_mapping(). - When the environment variable
TOPMARK_VALIDATEis set to a truthy value (1,true,yes), lightweight developer validations run on the composed processor mapping.
HeaderProcessorRegistry ¶
Composed registry view for processor definitions.
Notes
- Only validated
HeaderProcessorsubclasses are admitted to the effective registry. - Mutation hooks are intended for plugin authors and test scaffolding. Most integrations should consume metadata and read-only views instead.
qualified_keys
classmethod
¶
Return qualified keys of all registered processor definitions.
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
Sorted tuple of processor qualified keys. |
Source code in src/topmark/registry/processors.py
namespaces
classmethod
¶
Return namespaces represented in the processor-definition registry.
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
Sorted tuple of unique processor namespaces. |
Source code in src/topmark/registry/processors.py
get
classmethod
¶
Return a processor definition by canonical processor key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
processor_key
|
str
|
Canonical processor key. |
required |
Returns:
| Type | Description |
|---|---|
ProcessorDefinition | None
|
Matching |
Source code in src/topmark/registry/processors.py
as_mapping
classmethod
¶
Return the canonical processor-definition mapping keyed by qualified key.
Returns:
| Type | Description |
|---|---|
Mapping[str, ProcessorDefinition]
|
Mapping of canonical processor key to |
Notes
The returned mapping is a MappingProxyType and must not be mutated.
Source code in src/topmark/registry/processors.py
iter_meta
classmethod
¶
Iterate over stable metadata for processor definitions.
Yields:
| Type | Description |
|---|---|
ProcessorMeta
|
Serializable |
ProcessorMeta
|
processor definition. |
Source code in src/topmark/registry/processors.py
register
classmethod
¶
Register a processor definition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
processor_class
|
type[HeaderProcessor]
|
Concrete |
required |
Returns:
| Type | Description |
|---|---|
ProcessorDefinition
|
The registered |
Raises:
| Type | Description |
|---|---|
DuplicateProcessorRegistrationError
|
If the effective registry already contains a processor for the same qualified key. |
TypeError
|
If |
ReservedNamespaceError
|
If the reserved built-in |
Source code in src/topmark/registry/processors.py
unregister
classmethod
¶
Remove a processor definition from the effective registry by canonical processor key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
processor_key
|
str
|
Canonical processor key to remove. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
registry, else |
Notes
This mutates process-global registry overlay state.