ORIONIS API REFERENCE

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 documentation

Map lowercased media-type strings to synchronous BodyParser callables.

multipart/form-data is intentionally absent: multipart parsing requires a streaming body rather than pre-buffered bytes. Request.payload() handles that case explicitly before consulting this registry.

Parameters
parsersInitial mapping of media types to parsers. Keys are lowercased automatically. Defaults to an empty mapping.
Method __init__ Initialise the registry with an optional media-type mapping.
Method extend Return a new registry that merges parsers over a copy of self.
Method get Return the parser registered for media_type, or None.
Method register Add or replace the parser for media_type in place.
Class Variable __slots__ Undocumented
Instance Variable _parsers Undocumented
def __init__(self, parsers: dict[str, BodyParser] | None = None): (source)

Initialise the registry with an optional media-type mapping.

Parameters
parsers:dict[str, BodyParser] | NoneInitial media-type-to-parser mapping. Keys are lowercased on ingestion. Pass None to start with an empty registry.
Returns
NoneUndocumented
def extend(self, parsers: dict[str, BodyParser]) -> MediaTypeRegistry: (source)

Return a new registry that merges parsers over a copy of self.

The original registry is not mutated. Use this pattern for middleware or provider-level overrides.

Parameters
parsers:dict[str, BodyParser]Additional or replacement media-type-to-parser entries.
Returns
MediaTypeRegistryNew registry containing all entries from self plus parsers.
def get(self, media_type: str) -> BodyParser | None: (source)

Return the parser registered for media_type, or None.

Parameters
media_type:strCase-insensitive media-type string.
Returns
BodyParser | NoneThe registered (bytes) -> object callable, or None when media_type has no registered parser.
def register(self, media_type: str, parser: BodyParser): (source)

Add or replace the parser for media_type in place.

Parameters
media_type:strCase-insensitive media-type string, e.g. "application/json".
parser:BodyParserSynchronous callable (bytes) -> object.
Returns
NoneUndocumented

Undocumented