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.

module documentation

Undocumented

Function _split_header_parameters Split header segments at semicolons outside quoted parameter values.
Function parse_binary Return a binary payload unchanged.
Function parse_content_type Parse a Content-Type header into a media-type and parameter dict.
Function parse_json Decode a JSON payload using msgspec.
Function parse_msgpack Decode a MessagePack payload using msgspec.
Function parse_text Decode a UTF-8 text payload.
Function parse_urlencoded Decode an application/x-www-form-urlencoded payload.
Function parse_urlencoded_multi Decode a URL-encoded payload, preserving duplicate-key semantics.
Function parse_xml Parse an XML payload with entity declarations disabled.
def _split_header_parameters(header: str, *, quote_chars: str = '"') -> list[str]: (source)

Split header segments at semicolons outside quoted parameter values.

Quotes open only at the first non-whitespace character after the first equals sign in a segment. Escaped characters cannot close a quoted value. Segments retain their whitespace, quotes and escapes for the caller. An unterminated quoted value consumes the remainder of the header.

Parameters
header:strHeader or parameter text to split.
quote_chars:str, optionalCharacters that may delimit a quoted value; double quotes by default.
Returns
list[str]Original segments, excluding their separating semicolons.
def parse_binary(raw: bytes) -> bytes: (source)

Return a binary payload unchanged.

Parameters
raw:bytesRaw body bytes.
Returns
bytesThe same bytes object, unmodified.
def parse_content_type(header: str) -> tuple[str, dict[str, str]]: (source)

Parse a Content-Type header into a media-type and parameter dict.

Semicolons inside double-quoted parameter values are preserved.

Parameters
header:strRaw Content-Type value, e.g. "multipart/form-data; boundary=----WebKit".
Returns
tuple[str, dict[str, str]](media_type, params) where media_type is lowercase and params maps lowercase parameter names to unquoted values.
def parse_json(raw: bytes) -> object: (source)

Decode a JSON payload using msgspec.

Parameters
raw:bytesRaw JSON bytes.
Returns
objectDecoded Python object (dict, list, str, int, float, bool, or None).
Raises
msgspec.DecodeErrorIf raw is not valid JSON.
def parse_msgpack(raw: bytes) -> object: (source)

Decode a MessagePack payload using msgspec.

Parameters
raw:bytesRaw MessagePack bytes.
Returns
objectDecoded Python object.
Raises
msgspec.DecodeErrorIf raw is not valid MessagePack.
def parse_text(raw: bytes) -> str: (source)

Decode a UTF-8 text payload.

Parameters
raw:bytesRaw body bytes.
Returns
strUTF-8 decoded string.
def parse_urlencoded(raw: bytes) -> dict[str, str]: (source)

Decode an application/x-www-form-urlencoded payload.

Parameters
raw:bytesURL-encoded bytes.
Returns
dict[str, str]Parsed key-value pairs; blank values are preserved.
def parse_urlencoded_multi(raw: bytes) -> dict[str, str | list[str]]: (source)

Decode a URL-encoded payload, preserving duplicate-key semantics.

A key that appears once yields a plain string value. A key that appears more than once yields a list of strings in insertion order.

Parameters
raw:bytesURL-encoded bytes.
Returns
dict[str, str | list[str]]Parsed fields where single occurrences are scalars and repeated occurrences are lists.
def parse_xml(raw: bytes) -> XMLElement: (source)

Parse an XML payload with entity declarations disabled.

Uses defusedxml to reject internal and external entity declarations. DTDs without entity declarations are allowed; external resources are not resolved.

Parameters
raw:bytesRaw XML bytes.
Returns
xml.etree.ElementTree.ElementRoot element of the parsed document.
Raises
xml.etree.ElementTree.ParseErrorIf raw is malformed XML.
defusedxml.common.EntitiesForbiddenIf the document declares an internal or external entity. This is a subclass of defusedxml.common.DefusedXmlException, not ParseError.