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

Asynchronous wrapper around a lazily opened binary handle.

The underlying handle is produced by opener on first use (or on __aenter__) and every blocking operation is executed on a worker thread, keeping the event loop responsive. Drivers may provide an on_close callback to persist buffered data before the handle is released.

Async Method __aenter__ Open the underlying handle and return the stream.
Async Method __aexit__ Close the stream when leaving the async context.
Async Method __ensureHandle Open the underlying handle on first use and return it.
Method __init__ Initialize the stream with its handle factory.
Async Method close Flush pending data and release the underlying handle.
Async Method read Read up to size bytes from the stream.
Async Method seek Move the stream position to offset.
Async Method write Write data to the stream at the current position.
Class Variable __slots__ Undocumented
Instance Variable _handle Undocumented
Instance Variable _on_close Undocumented
Instance Variable _opener Undocumented
async def __aenter__(self) -> IStorageStream: (source)

Open the underlying handle and return the stream.

Returns
IStorageStreamThe stream itself, ready for I/O operations.
async def __aexit__(self, exc_type: type[BaseException] | None, exc: BaseException | None, traceback: TracebackType | None): (source)

Close the stream when leaving the async context.

Parameters
exc_type:type[BaseException] | NoneException class raised inside the context, if any.
exc:BaseException | NoneException instance raised inside the context, if any.
traceback:TracebackType | NoneTraceback of the raised exception, if any.
Returns
NoneUndocumented
async def __ensureHandle(self) -> BinaryIO: (source)

Open the underlying handle on first use and return it.

Returns
BinaryIOThe open binary handle backing this stream.
def __init__(self, opener: Callable[[], BinaryIO], on_close: Callable[[BinaryIO], None] | None = None): (source)

Initialize the stream with its handle factory.

Parameters
opener:Callable[[], BinaryIO]Zero-argument callable returning the binary handle. It is invoked lazily on a worker thread.
on_close:Callable[[BinaryIO], None] | NoneOptional callback executed with the open handle right before it is closed.
Returns
NoneUndocumented
async def close(self): (source)

Flush pending data and release the underlying handle.

Invokes the on_close callback (when provided) before closing the handle. Closing an unopened or already closed stream is a no-op.

Returns
NoneUndocumented
async def read(self, size: int = -1) -> bytes: (source)

Read up to size bytes from the stream.

Parameters
size:intMaximum number of bytes to read. -1 reads until EOF.
Returns
bytesBytes read from the current position; empty at EOF.
async def seek(self, offset: int, whence: int = 0) -> int: (source)

Move the stream position to offset.

Parameters
offset:intTarget offset relative to whence.
whence:intAnchor point: 0 start, 1 current, 2 end.
Returns
intThe new absolute position within the stream.
async def write(self, data: bytes) -> int: (source)

Write data to the stream at the current position.

Parameters
data:bytesRaw bytes to write.
Returns
intNumber of bytes written.
_handle: BinaryIO | None = (source)

Undocumented

_on_close = (source)

Undocumented

Undocumented