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

Define the contract for an uploaded file held in memory or on disk.

Implementations buffer incoming bytes via write(), optionally spill to a temporary file, and expose content through read() and save().

Method chunks Iterate over the file content in fixed-size chunks.
Method close Close the file handle and release all associated resources.
Method read Read the entire file content from the beginning.
Method replace Replace the file content with data and update the byte counter.
Method save Write the file contents to path on the local filesystem.
Method write Append chunk to the file buffer.
Class Variable __slots__ Declare that this class introduces no additional instance slots.
Property extension Return the file extension derived from filename, in lowercase.
Property size Return the total number of bytes written so far.
def chunks(self, size: int = 65536) -> Iterator[bytes]: (source)

Iterate over the file content in fixed-size chunks.

Parameters
size:intMaximum number of bytes per yielded chunk.
Returns
collections.abc.Iterator[bytes]Iterator yielding consecutive chunks from the beginning of the buffered content.
def close(self): (source)

Close the file handle and release all associated resources.

Returns
NoneClose the file handle and release all associated resources.
def read(self) -> bytes: (source)

Read the entire file content from the beginning.

Returns
bytesFull file contents.
def replace(self, data: bytes): (source)

Replace the file content with data and update the byte counter.

Parameters
data:bytesNew file content that replaces previously written data.
Returns
NoneReplace the file content with data and update the byte counter.
def save(self, path: str | Path): (source)

Write the file contents to path on the local filesystem.

Parameters
path:str or pathlib.PathDestination path for the saved file.
Returns
NoneWrite the file contents to path on the local filesystem.

Append chunk to the file buffer.

Append at the end even when a previous read moved the cursor.

Parameters
chunk:bytes | bytearray | memoryviewRaw bytes to append.
Returns
NoneAppend chunk to the file buffer.
__slots__: tuple = (source)

Declare that this class introduces no additional instance slots.

Return the file extension derived from filename, in lowercase.

Returns
strLowercase suffix including the leading dot (e.g. ".png"). Empty string if the filename has no extension.

Return the total number of bytes written so far.

Returns
intCumulative byte count across all write calls.