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.
Prepare all bodies and attachments before any transport side effect.
The composer is shared and stateless: every operation keeps its envelope, rendered bodies, and attachment payloads in local variables.
| Static Method | _compose |
Build and serialize MIME on a worker using the standard email library. |
| Method | __init__ |
Inject the configured framework engines without using facades. |
| Async Method | _read |
Read one backend-independent binary stream and close it reliably. |
| Async Method | _render |
Render a view to text without constructing an HTTP response. |
| Async Method | _resolve |
Own an attachment task until its stream is closed, even on cancellation. |
| Async Method | prepare |
Validate, render, load attachments, and compose one immutable message. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _storage |
Undocumented |
| Instance Variable | _view |
Undocumented |
Envelope, text: str | None, html: str | None, attachments: tuple[ LoadedAttachment, ...]) -> PreparedMail:
(source)
¶
Build and serialize MIME on a worker using the standard email library.
| Parameters | |
envelope:Envelope | Validated final envelope. |
text:str | None | Rendered or literal plain-text body. |
html:str | None | Rendered or literal HTML body. |
attachments:tuple[LoadedAttachment, ...] | Fully materialized storage attachments. |
| Returns | |
PreparedMail | Message-ID, bytes without Bcc, and a separate recipient union. |
| Raises | |
MailCompositionException | If the envelope carries no sender. |
Inject the configured framework engines without using facades.
| Parameters | |
view:IViewEngine | Existing text-rendering view engine. |
storage:IStorageManager | Existing default/named disk resolver. |
| Returns | |
None | Store only shared services, never operation state. |
Read one backend-independent binary stream and close it reliably.
| Parameters | |
attachment:Attachment | Logical path and optional metadata. |
| Returns | |
LoadedAttachment | The full payload, including a valid zero-byte payload. |
| Raises | |
MailAttachmentException | If a driver returns a non-binary failure value. |
Exception | Propagate storage failures to the owning task for translation. |
str | None, literal: str | None, content: Content) -> str | None:
(source)
¶
Render a view to text without constructing an HTTP response.
| Parameters | |
template:str | None | Optional view identifier. |
literal:str | None | Unchanged literal when no view was declared. |
content:Content | Owner of the isolated explicit view context. |
| Returns | |
str | None | Rendered text, literal text, or an undeclared body. |
| Raises | |
MailCompositionException | If the configured view engine fails or does not return text. |
Own an attachment task until its stream is closed, even on cancellation.
| Parameters | |
attachment:Attachment | Deferred storage declaration. |
| Returns | |
LoadedAttachment | Declaration, binary data, and optional storage MIME type. |
| Raises | |
MailAttachmentException | If storage fails to open, read, inspect, or close the attachment. |
asyncio.CancelledError | After in-progress storage work finishes and releases its stream. |
Envelope, content: Content, attachments: tuple[ Attachment, ...]) -> PreparedMail:
(source)
¶
Validate, render, load attachments, and compose one immutable message.
| Parameters | |
envelope:Envelope | Final merged headers and intended recipients. |
content:Content | Validated literals or views with explicit context. |
attachments:tuple[Attachment, ...] | Deferred storage declarations in attachment order. |
| Returns | |
PreparedMail | Complete MIME bytes and transport envelope. |
| Raises | |
MailCompositionException | If the envelope, view rendering, or MIME encoding fails. |
MailAttachmentException | If any attachment cannot be read or has unsafe metadata. |