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 numeric bounds, length ranges and individual metadata values. |
| Static Method | _validate |
Reject a minimum length greater than the declared maximum. |
| Static Method | _validate |
Reject ambiguous or impossible combinations of numeric bounds. |
| Static Method | _validate |
Reject conflicting timezones, nonpositive divisors and negative lengths. |
| Static Method | compile |
Compile metadata annotations into a field constraint descriptor. |
| Class Variable | __slots__ |
Declare that this class introduces no additional instance slots. |
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[orionis.schemas.meta.validation.ValidationMetadata] | Raw annotation list from the caller. |
| Returns | |
dict[type[ValidationMetadata], ValidationMetadata] | Mapping from each concrete metadata type to its single instance. |
| Raises | |
orionis.schemas.compiler.MetadataConflictError | If the same concrete type appears more than once. |
Validate numeric bounds, length ranges and individual metadata values.
| Parameters | |
seen:dict[type[ValidationMetadata], ValidationMetadata] | The indexed metadata mapping produced by _index. |
| Returns | |
None | No return value. |
| Raises | |
orionis.schemas.compiler.MetadataConflictError | On any detected conflict. |
Reject a minimum length greater than the declared maximum.
| Parameters | |
seen:dict[type[ValidationMetadata], ValidationMetadata] | Indexed declarations to compare. |
| Returns | |
None | No return value. |
| Raises | |
MetadataConflictError | If no length can satisfy both bounds. |
Reject ambiguous or impossible combinations of numeric bounds.
| Parameters | |
seen:dict[type[ValidationMetadata], ValidationMetadata] | Indexed declarations with at most one of each concrete metadata type. |
| Returns | |
None | No return value. |
| Raises | |
MetadataConflictError | If numeric bounds overlap ambiguously or permit no valid values. |
Reject conflicting timezones, nonpositive divisors and negative lengths.
| Parameters | |
seen:dict[type[ValidationMetadata], ValidationMetadata] | Indexed declarations whose individual values must be valid. |
| Returns | |
None | No return value. |
| Raises | |
MetadataConflictError | If timezone requirements conflict or an individual value is invalid. |
Compile metadata annotations into a field constraint descriptor.
| Parameters | |
metadata:list[orionis.schemas.meta.validation.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 | |
orionis.schemas.compiler.MetadataConflictError | If any duplicate or logically conflicting metadata is detected before the descriptor is constructed. |