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

Metaclass discovering model columns and building their metadata.

At class creation time the metaclass collects column definitions (including inherited ones), removes them from the class namespace so instance attribute access reaches the attribute store, derives the table name and primary key, and precompiles cast handlers.

Static Method _behaviourEntry Classify a method name as an accessor, mutator, or local scope.
Static Method _collectBehaviours Discover accessors, mutators, and local scopes of a model.
Static Method _collectCasts Merge cast declarations across the model hierarchy.
Static Method _collectColumns Collect column definitions from bases and the class namespace.
Static Method _collectPending Collect and detach column declarations from an abstract class.
Static Method _inheritEvents Copy the lifecycle listeners declared by ancestor models.
Static Method _inheritGlobalScopes Copy the global scopes declared by ancestor models.
Static Method _resolvePrimaryKey Resolve the primary key from declarations or column flags.
Static Method _resolveTable Resolve the shared table definition or inline model columns.
Static Method _resolveTableName Resolve the table name from the declaration or the class name.
Method __getattr__ Forward chainable builder entry points from the model class.
Method __new__ Create the model class and attach its metadata.
def _behaviourEntry(name: str) -> tuple[str, str] | None: (source)

Classify a method name as an accessor, mutator, or local scope.

Parameters
name:strMethod name declared on the model.
Returns
tuple of (str, str) or NoneThe behaviour kind ("accessor", "mutator", or "scope") and the key it registers under, or None when the name follows no convention.
def _collectBehaviours(owner: type) -> tuple[dict[str, str], dict[str, str], dict[str, str]]: (source)

Discover accessors, mutators, and local scopes of a model.

Parameters
owner:typeClass being created.
Returns
tuple of dictAccessors, mutators, and local scopes, each mapping their public key to the declaring method name.
def _collectCasts(owner: type) -> dict[str, str]: (source)

Merge cast declarations across the model hierarchy.

Parameters
owner:typeClass being created.
Returns
dict of str to strCast names keyed by attribute name.
def _collectColumns(owner: type, namespace: dict[str, Any]) -> dict[str, ColumnDefinition]: (source)

Collect column definitions from bases and the class namespace.

Own declarations are removed from the class so instance access is served by the model attribute store.

Parameters
owner:typeClass being created.
namespace:dictClass namespace as declared in the class body.
Returns
dict of str to ColumnDefinitionColumn definitions keyed by attribute name.
def _collectPending(owner: type, namespace: dict[str, Any]) -> dict[str, ColumnDefinition]: (source)

Collect and detach column declarations from an abstract class.

Parameters
owner:typeAbstract class being created.
namespace:dictClass namespace as declared in the class body.
Returns
dict of str to ColumnDefinitionColumns deferred to concrete descendants.
def _inheritEvents(owner: type) -> dict[str, tuple[tuple[object, Callable[..., Any]], ...]]: (source)

Copy the lifecycle listeners declared by ancestor models.

Parameters
owner:typeClass being created.
Returns
dict of str to tupleListener snapshots with their registration identities.
def _inheritGlobalScopes(owner: type) -> dict[str, Callable[[Any], None]]: (source)

Copy the global scopes declared by ancestor models.

Parameters
owner:typeClass being created.
Returns
dict of str to CallableGlobal scopes the new class starts with.
def _resolvePrimaryKey(owner: type, namespace: dict[str, Any], columns: dict[str, ColumnDefinition]) -> str: (source)

Resolve the primary key from declarations or column flags.

Parameters
owner:typeClass being created.
namespace:dictClass namespace as declared in the class body.
columns:dict of str to ColumnDefinitionCollected column definitions.
Returns
strPrimary key column name.
def _resolveTable(owner: type, name: str, namespace: dict[str, Any]) -> TableDefinition: (source)

Resolve the shared table definition or inline model columns.

Parameters
owner:typeModel class being created.
name:strName of the model class.
namespace:dict of str to AnyAttributes declared in the model class body.
Returns
TableDefinitionResolved table definition for the model.
Raises
OrmConfigurationExceptionIf the shared definition is invalid, conflicts with model settings, or is combined with inline column declarations.
def _resolveTableName(owner: type, name: str, namespace: dict[str, Any]) -> str: (source)

Resolve the table name from the declaration or the class name.

Parameters
owner:typeClass being created.
name:strName of the class being created.
namespace:dictClass namespace as declared in the class body.
Returns
strLogical table name.
def __getattr__(cls, name: str) -> Any: (source)

Forward chainable builder entry points from the model class.

Enables the Eloquent-style static API, e.g. User.where(...) starts a builder transparently.

Parameters
clsUndocumented
name:strAttribute name requested on the model class.
Returns
AnyBound builder method for whitelisted entry points, or a bound local scope declared by the model.
Raises
AttributeErrorIf the attribute is neither a forwarded builder method nor a local scope.
def __new__(mcs: type[ModelMeta], name: str, bases: tuple[type, ...], namespace: dict[str, Any], **kwargs: Any) -> type: (source)

Create the model class and attach its metadata.

Parameters
mcs:type[ModelMeta]Metaclass creating the model, including specialized subclasses.
name:strName of the class being created.
bases:tuple of typeBase classes of the class being created.
namespace:dictClass namespace as declared in the class body.
**kwargs:AnyAdditional keyword arguments forwarded to type.
Returns
typeThe created model class with __meta__ attached.