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
Use one verified SMTP connection per message, entirely on a worker.
Cancelling the awaiting task does not stop the worker and does not prove that the server refused the message. There are no automatic retries.
| Method | __init__ |
Retain validated settings without opening a connection. |
| Method | _result |
Report exactly the recipients accepted by a completed transaction. |
| Method | _send |
Own one SMTP session for the complete bounded batch. |
| Method | _send |
Connect, negotiate, authenticate, transmit, and always close. |
| Async Method | send |
Run the complete blocking SMTP cycle outside the event loop. |
| Async Method | send |
Send a bounded batch using one authenticated connection and no retries. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _settings |
Immutable effective connection options. |
Retain validated settings without opening a connection.
| Parameters | |
settings:orionis.mail.entities.SmtpSettings | Immutable effective connection options. |
| Returns | |
None | Store transport configuration only. |
def _result(self:
Self, message: PreparedMail, mailer: str, driver: str, refused: Mapping[ str, tuple[ int, bytes | str]]) -> MailResult:
(source)
¶
Report exactly the recipients accepted by a completed transaction.
| Parameters | |
message:orionis.mail.entities.PreparedMail | Intended recipient union and message identifier. |
mailer:str | Selected configuration name. |
driver:str | Registered driver name. |
refused:collections.abc.Mapping[str, tuple[int, bytes | str]] | Recipient rejections returned after the transaction succeeded. |
| Returns | |
orionis.mail.entities.MailResult | Accepted or partial, with sanitized immutable rejection metadata. |
| Raises | |
orionis.mail.exceptions.MailTransportException | If no recipient was accepted. |
def _sendBatchSync(self:
Self, messages: tuple[ PreparedMail, ...], mailer: str, driver: str) -> tuple[ MailResult, ...]:
(source)
¶
Own one SMTP session for the complete bounded batch.
| Parameters | |
messages:tuple[orionis.mail.entities.PreparedMail, ...] | Prepared messages to send through one SMTP session. |
mailer:str | Configured mailer name attached to delivery results. |
driver:str | Transport driver name attached to delivery results. |
| Returns | |
tuple[orionis.mail.entities.MailResult, ...] | Delivery results in message order after the complete batch succeeds. |
def _sendSync(self:
Self, message: PreparedMail, mailer: str, driver: str) -> MailResult:
(source)
¶
Connect, negotiate, authenticate, transmit, and always close.
| Parameters | |
message:orionis.mail.entities.PreparedMail | Complete operation-local message. |
mailer:str | Selected configuration name. |
driver:str | Registered driver name. |
| Returns | |
orionis.mail.entities.MailResult | Confirmed recipient acceptance after a successful transaction. |
| Raises | |
orionis.mail.exceptions.MailTransportException | Sanitized failure identifying stage, exception type, and SMTP code. |
async def send(self:
Self, message: PreparedMail, *, mailer: str, driver: str) -> MailResult:
(source)
¶
Run the complete blocking SMTP cycle outside the event loop.
| Parameters | |
message:orionis.mail.entities.PreparedMail | Already materialized MIME and a validated separate envelope. |
mailer:str | Configuration name reported in the result. |
driver:str | Registered transport name reported in the result. |
| Returns | |
orionis.mail.entities.MailResult | Total or partial acceptance confirmed by the SMTP transaction. |
| Raises | |
orionis.mail.exceptions.MailTransportException | If the transaction fails or every recipient is rejected. |
async def sendMany(self:
Self, messages: Iterable[ PreparedMail], *, mailer: str, driver: str) -> tuple[ MailResult, ...]:
(source)
¶
Send a bounded batch using one authenticated connection and no retries.
| Parameters | |
messages:collections.abc.Iterable[orionis.mail.entities.PreparedMail] | At most 100 already-composed messages with these transport settings. |
mailer:str | Mailer identifier included in results. |
driver:str | Driver identifier included in results. |
| Returns | |
tuple[orionis.mail.entities.MailResult, ...] | Ordered delivery results. MailBatchException retains completed results and the uncertain message index if the batch aborts. Cancellation waits for the accepted batch before closing resources. |