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.
Measure field values, inspect emptiness and read uploaded file content.
| Function | is |
Recognize empty text, containers, numbers and uploaded files. |
| Function | is |
Report whether a value behaves like an uploaded file. |
| Function | measure |
Compute the comparable size of a value. |
| Async Function | read |
Read uploaded-file content without blocking the event loop. |
| Constant | _FILE |
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. |
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:object | Value whose emptiness is checked without changing its contents. |
| Returns | |
bool | Whether the value satisfies the shared emptiness definition. |
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:object | Value whose size is required. |
| Returns | |
decimal.Decimal | float | None | Comparable 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. |
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:object | Uploaded file to read. |
| Returns | |
bytes | None | Raw content, or None when the value is not a readable file. |