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

Enforce binary access modes while owning a buffered storage payload.

Method __init__ Own a buffer and apply the driver's validated binary mode.
Method _requireOpen Reject operations after the buffer has closed.
Method _requireReadable Reject reads disallowed by the selected mode.
Method _requireWritable Reject writes disallowed by the selected mode.
Method close Close the wrapper and its owned buffer while preserving failures.
Method flush Flush the underlying buffer without exposing prohibited reads.
Method read Read at most the requested number of bytes.
Method read1 Read one logical block from the already buffered payload.
Method readable Report whether the selected mode permits reading.
Method readinto Read into a writable byte buffer when reading is permitted.
Method readline Read one line within the selected mode's permissions.
Method seek Move the position without changing append-mode write behavior.
Method seekable Report whether the owned buffer supports seeking.
Method tell Return the current position of the owned buffer.
Method truncate Resize the buffer only when the selected mode permits writing.
Method writable Report whether the selected mode permits writing.
Method write Write permitted bytes and force append-mode writes to EOF.
Class Variable __slots__ Reserve the binary mode and the owned underlying buffer.
Instance Variable _mode Store the binary mode controlling the wrapper's I/O permissions.
Instance Variable raw Keep the underlying buffer available to persistence callbacks.
Property closed Report whether the wrapper or its owned buffer has closed.
def __init__(self, raw: BinaryIO, mode: str): (source)

Own a buffer and apply the driver's validated binary mode.

Parameters
raw:typing.BinaryIOBuffer used by internal persistence callbacks.
mode:strValidated binary read, write or append mode.
Returns
NoneNo return value.
def _requireOpen(self): (source)

Reject operations after the buffer has closed.

Returns
NoneNo return value.
def _requireReadable(self): (source)

Reject reads disallowed by the selected mode.

Returns
NoneNo return value.
def _requireWritable(self): (source)

Reject writes disallowed by the selected mode.

Returns
NoneNo return value.
def close(self): (source)

Close the wrapper and its owned buffer while preserving failures.

Returns
NoneNo return value.
def flush(self): (source)

Flush the underlying buffer without exposing prohibited reads.

Returns
NoneNo return value.
def read(self, size: int = -1) -> bytes: (source)

Read at most the requested number of bytes.

Parameters
size:intByte limit, or -1 to read the remaining content.
Returns
bytesContent read from the current position.
def read1(self, size: int = -1) -> bytes: (source)

Read one logical block from the already buffered payload.

Parameters
size:intMaximum bytes to return, or -1 for all remaining bytes.
Returns
bytesContent read from the current position.
def readable(self) -> bool: (source)

Report whether the selected mode permits reading.

Returns
boolWhether reads are permitted on the open buffer.
def readinto(self, buffer: bytearray | memoryview) -> int: (source)

Read into a writable byte buffer when reading is permitted.

Parameters
buffer:bytearray | memoryviewDestination buffer receiving the content.
Returns
intNumber of bytes copied into the destination.
def readline(self, size: int = -1) -> bytes: (source)

Read one line within the selected mode's permissions.

Parameters
size:intMaximum bytes to return, or -1 for an unrestricted line.
Returns
bytesThe next line or an empty byte string at EOF.
def seek(self, offset: int, whence: int = 0) -> int: (source)

Move the position without changing append-mode write behavior.

Parameters
offset:intPosition relative to the selected anchor.
whence:intStart, current position or end anchor.
Returns
intThe resulting absolute position.
def seekable(self) -> bool: (source)

Report whether the owned buffer supports seeking.

Returns
boolWhether the open buffer supports random access.
def tell(self) -> int: (source)

Return the current position of the owned buffer.

Returns
intAbsolute byte position.
def truncate(self, size: int | None = None) -> int: (source)

Resize the buffer only when the selected mode permits writing.

Parameters
size:int | NoneNew length, or None to use the current position.
Returns
intNew buffer length.
def writable(self) -> bool: (source)

Report whether the selected mode permits writing.

Returns
boolWhether writes are permitted on the open buffer.
def write(self, data: bytes) -> int: (source)

Write permitted bytes and force append-mode writes to EOF.

Parameters
data:bytesContent to persist in the buffer.
Returns
intNumber of bytes written.
__slots__: tuple[str, ...] = (source)

Reserve the binary mode and the owned underlying buffer.

Store the binary mode controlling the wrapper's I/O permissions.

Keep the underlying buffer available to persistence callbacks.

Report whether the wrapper or its owned buffer has closed.

Returns
boolWhether further I/O is unavailable.