THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class MetaCompiler: (source)
Compile Orionis metadata annotations into a field constraint descriptor.
Act as the single integration point between Orionis' public metadata API and the underlying serialization layer. Schema consumers (validation, JSON Schema generation, OpenAPI export) should use this compiler so that the serialization layer remains an implementation detail invisible to application code.
| Static Method | _build |
Construct the field constraint descriptor from the validated metadata index. |
| Static Method | _index |
Build a type → instance mapping and reject duplicate types. |
| Static Method | _validate |
Validate the indexed metadata for all semantic conflicts in a single pass. |
| Static Method | compile |
Compile metadata annotations into a field constraint descriptor. |
| Class Variable | __slots__ |
Undocumented |
Construct the field constraint descriptor from the validated metadata index.
Built in a single pass over seen to avoid allocating intermediate dictionaries. All fourteen msgspec.Meta parameters are populated here in one go, each guarded by an O(1) dict look-up.
| Parameters | |
seen:dict[type[ValidationMetadata], ValidationMetadata] | The conflict-free metadata index produced by _index. |
| Returns | |
msgspec.Meta | The fully configured field constraint descriptor. |
list[ ValidationMetadata]) -> dict[ type[ ValidationMetadata], ValidationMetadata]:
(source)
¶
Build a type → instance mapping and reject duplicate types.
| Parameters | |
metadata:list[ValidationMetadata] | Raw annotation list from the caller. |
| Returns | |
dict[type[ValidationMetadata], ValidationMetadata] | Mapping from each concrete metadata type to its single instance. |
| Raises | |
MetadataConflictError | If the same concrete type appears more than once. |
Validate the indexed metadata for all semantic conflicts in a single pass.
Checks are applied in order: ambiguous bounds, impossible numeric ranges, impossible length ranges, mutually exclusive timezone flags, and invalid individual values. All checks are inlined to eliminate five separate staticmethod call overheads and to consolidate shared seen.get() calls (MinLength and MaxLength are looked up once instead of twice).
| Parameters | |
seen:dict[type[ValidationMetadata], ValidationMetadata] | The indexed metadata mapping produced by _index. |
| Returns | |
None | Complete the documented operation without returning a value. |
| Raises | |
MetadataConflictError | On any detected conflict. |
Compile metadata annotations into a field constraint descriptor.
| Parameters | |
metadata:list[ValidationMetadata] | The list of field-level metadata annotations to compile. Order does not matter; each concrete type may appear at most once. |
| Returns | |
msgspec.Meta | A field constraint descriptor configured with all provided constraints and documentation properties. |
| Raises | |
MetadataConflictError | If any duplicate or logically conflicting metadata is detected before the descriptor is constructed. |