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 attachment_name Validate the visible basename of an attachment.
Function freeze_owned Snapshot containers without copying arbitrary user objects.
Function header_value Validate a single unstructured header value.
Function media_type Validate a bare MIME type without header parameters.
Function sanitize_reason Remove controls and configured secrets from a transport diagnostic.
Constant _HEADER_CONTROLS Undocumented
Constant _MAX_REASON_LENGTH Undocumented
Constant _MEDIA_TYPE_PARTS Undocumented
Constant _TOKEN_CHARS Undocumented
def attachment_name(value: str) -> str: (source)

Validate the visible basename of an attachment.

Parameters
value:strName exposed in the Content-Disposition header.
Returns
strThe validated name.
Raises
MailAttachmentExceptionIf the name is empty, unsafe, or contains a path.
def freeze_owned(value: object, active: frozenset[int] = frozenset()) -> object: (source)

Snapshot containers without copying arbitrary user objects.

Parameters
value:objectA container tree or an opaque context value.
active:frozenset[int]Ancestors used to reject cyclic container structures.
Returns
objectRead-only copied containers; opaque values retain identity.
Raises
MailCompositionExceptionIf a container cycle prevents an immutable snapshot.
def header_value(value: str, label: str) -> str: (source)

Validate a single unstructured header value.

Parameters
value:strHeader text, including an intentionally empty subject.
label:strPublic field name used in diagnostics.
Returns
strThe unchanged safe value.
Raises
MailCompositionExceptionIf the value is not text or contains control characters.
def media_type(value: str) -> str: (source)

Validate a bare MIME type without header parameters.

Parameters
value:strExplicit or storage-provided MIME type.
Returns
strA lowercase type/subtype pair.
Raises
MailAttachmentExceptionIf either token is invalid or parameters are present.
def sanitize_reason(value: str | bytes, sensitive: tuple[str, ...] = ()) -> str: (source)

Remove controls and configured secrets from a transport diagnostic.

Parameters
value:str | bytesServer response, decoded with replacement when needed.
sensitive:tuple[str, ...]Credentials and credential-bearing URL representations to redact.
Returns
strA bounded single-line diagnostic.
_HEADER_CONTROLS = (source)

Undocumented

Value
frozenset(set(['Cc', 'Cf', 'Cs', 'Zl', 'Zp']))
_MAX_REASON_LENGTH: int = (source)

Undocumented

Value
512
_MEDIA_TYPE_PARTS: int = (source)

Undocumented

Value
2
_TOKEN_CHARS = (source)

Undocumented

Value
frozenset((ascii_letters + digits + '!#$%&\'*+-.^_`|~'))