topmark.processors.bindings¶
topmark / processors / bindings
Declarative built-in processor binding helpers.
This module defines small value objects and expansion helpers used to declare
how HeaderProcessor
implementations are associated with file type names in TopMark's built-in
registry data.
The bindings are intentionally declarative: they describe built-in registry contents without relying on import-time decorator side effects.
ProcessorBinding
dataclass
¶
Declarative association between one file type name and one processor class.
kw_only=True keeps call sites explicit and readable when many bindings
are declared together.
Attributes:
| Name | Type | Description |
|---|---|---|
file_type_name |
str
|
Local key of the file type the processor should be bound to. |
processor_class |
type[HeaderProcessor]
|
Concrete |
namespace |
str
|
Namespace label identifying the binding source, usually the built-in TopMark namespace or a plugin namespace. |
bindings_for ¶
Expand one processor class across multiple file type names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
processor_class
|
type[HeaderProcessor]
|
Concrete |
required |
file_type_names
|
Iterable[str]
|
File type local keys that should resolve to the same processor class. |
required |
namespace
|
str
|
Namespace label identifying the binding source. |
required |
Returns:
| Type | Description |
|---|---|
ProcessorBinding
|
Tuple of |
...
|
objects preserving the input order of |