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

Represent a single part within a multipart HTTP request body.

Method __init__ Initialize a new MultipartPart from its MIME headers.
Method _parseContentDisposition Parse a Content-Disposition header into a key-value dict.
Method finalize Return this part's content in its final form.
Method write Append chunk to this part's data buffer.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _write Callable used to append bytes to the current multipart part.
Instance Variable content_type Content type produced by headers.get.
Instance Variable data Select the file or field buffer writer for this part.
Instance Variable filename Filename used when rendering or storing the resource.
Instance Variable headers Lowercased headers for this multipart part.
Instance Variable is_file A part is treated as a file upload when a filename is declared.
Instance Variable name Assign field metadata extracted from the disposition attributes.
def __init__(self, headers: dict[str, str], memory_threshold: int): (source)

Initialize a new MultipartPart from its MIME headers.

Parameters
headers:dict[str, str]Lowercased headers for this multipart part.
memory_threshold:intMaximum in-memory bytes before spilling to disk.
Returns
NoneConfigures instance attributes; no value is returned.
def _parseContentDisposition(self, disposition: str) -> dict[str, str]: (source)

Parse a Content-Disposition header into a key-value dict.

Preserve semicolons within single- or double-quoted values and prefer successfully decoded extended attributes over plain values.

Parameters
disposition:strRaw Content-Disposition header value.
Returns
dict[str, str]Lowercased attribute names mapped to unquoted values.
def finalize(self) -> UploadedFile | str: (source)

Return this part's content in its final form.

For field parts, applies Content-Transfer-Encoding decoding (base64 or quoted-printable) and decodes to a string using the charset declared in the part's Content-Type header, falling back to UTF-8.

Returns
orionis.http.payload.uploaded_file.UploadedFile | strThe UploadedFile handle for file parts, or the decoded string for field parts.
def write(self, chunk: bytes | bytearray | memoryview): (source)

Append chunk to this part's data buffer.

Parameters
chunk:bytesRaw bytes received from the multipart stream.
Returns
NoneDelegates to the pre-bound write callable; no value returned.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Callable used to append bytes to the current multipart part.

content_type: str | None = (source)

Content type produced by headers.get.

Select the file or field buffer writer for this part.

filename: str | None = (source)

Filename used when rendering or storing the resource.

Lowercased headers for this multipart part.

A part is treated as a file upload when a filename is declared.

Assign field metadata extracted from the disposition attributes.