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.

module documentation

Measure field values, inspect emptiness and read uploaded file content.

Function is_empty Recognize empty text, containers, numbers and uploaded files.
Function is_file Report whether a value behaves like an uploaded file.
Function measure Compute the comparable size of a value.
Async Function read_content Read uploaded-file content without blocking the event loop.
Constant _FILE_ATTRIBUTES Attributes an uploaded file exposes, used for structural detection so the schema layer stays decoupled from the HTTP payload package.
Constant KILOBYTE Bytes per kilobyte, the unit size rules use to express file sizes.
def is_empty(value: object) -> bool: (source)

Recognize empty text, containers, numbers and uploaded files.

Treat None, whitespace-only strings, numeric zero and False as empty. Sized values are empty when their length is zero, and uploaded files when their byte size is zero. Do not consume unsized iterables.

Parameters
value:objectValue whose emptiness is checked without changing its contents.
Returns
boolWhether the value satisfies the shared emptiness definition.
def is_file(value: object) -> bool: (source)

Report whether a value behaves like an uploaded file.

Parameters
value:objectValue to inspect.
Returns
boolReturn True when the value exposes the uploaded-file protocol.
def measure(value: object) -> Decimal | float | None: (source)

Compute the comparable size of a value.

Numbers are compared by their own magnitude, strings and collections by their length, and uploaded files by their size in kilobytes.

Parameters
value:objectValue whose size is required.
Returns
decimal.Decimal | float | NoneComparable size preserving decimal precision, or None when the value has no measurable size. Represent decimal NaNs as a floating-point NaN so ordinary ordered comparisons fail without signaling an exception.
async def read_content(value: object) -> bytes | None: (source)

Read uploaded-file content without blocking the event loop.

Invoke the upload's synchronous read protocol in a worker and leave ownership with its caller. Finish any running read before propagating cancellation so the caller can safely release the upload afterward.

Parameters
value:objectUploaded file to read.
Returns
bytes | NoneRaw content, or None when the value is not a readable file.
_FILE_ATTRIBUTES: tuple[str, ...] = (source)

Attributes an uploaded file exposes, used for structural detection so the schema layer stays decoupled from the HTTP payload package.

Value
('read', 'size', 'filename')
KILOBYTE: int = (source)

Bytes per kilobyte, the unit size rules use to express file sizes.

Value
1024