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

Read a service contract's signatures without importing application modules.

Class _Annotations Use qualified imports so inherited methods cannot shadow each other's types.
Class _Module Names and class declarations visible in a Python module.
Function _bind_parameters Propagate type arguments to methods inherited from a specialized base.
Function _bind_receiver Replace the service receiver, preserving caller-supplied keyword names.
Function _declarations Include imports guarded by TYPE_CHECKING or version checks.
Function _declared_methods Select the public service methods and their overloads.
Function _load_module Find source directly, including packages whose initializers have side effects.
Function _parameters List parameters declared with Python generics or the Generic base.
Function _qualified_name Validate the module and class components before locating source files.
Function _signature Preserve parameter kinds, overloads, defaults and coroutine behavior.
Function interface_replacements Generate typing declarations for the contract identified by module and class.
Constant _TYPE_PARAMETERS Type parameter nodes supported in a Python generic declaration.
Type Alias Method Syntax node for a synchronous or asynchronous service method.
def _bind_parameters(marker: type, definition: ast.ClassDef, annotations: _Annotations, arguments: dict[type, list[ast.expr]], bases: list[tuple[type, ast.expr]]): (source)

Propagate type arguments to methods inherited from a specialized base.

Parameters
marker:typeClass representing this position in the service hierarchy.
definition:ast.ClassDefSource declaration for the current class.
annotations:_AnnotationsContext receiving the class's type substitutions.
arguments:dict[type, list[ast.expr]]Specialized type arguments indexed by hierarchy marker.
bases:list[tuple[type, ast.expr]]Parent markers paired with the source expressions for those bases.
Returns
NoneRecord substitutions for this class and its generic parents.
def _bind_receiver(node: Method, annotations: _Annotations, decorators: set[str]) -> tuple[ast.arg | None, ...]: (source)

Replace the service receiver, preserving caller-supplied keyword names.

Parameters
node:MethodCopy of the service method whose receiver will be replaced.
annotations:_AnnotationsContext that tracks the receiver's type parameter.
decorators:set[str]Names of the decorators on the service method.
Returns
tupleOriginal caller-supplied parameters, including variadic positions.
def _declarations(body: list[ast.stmt]) -> Iterator[ast.stmt]: (source)

Include imports guarded by TYPE_CHECKING or version checks.

Parameters
body:list[ast.stmt]Statements in the module or class being inspected.
Yields
ast.stmtEach statement, including declarations inside conditional blocks.
def _declared_methods(module: _Module, definition: ast.ClassDef, annotations: _Annotations) -> Iterator[tuple[str, list[str]]]: (source)

Select the public service methods and their overloads.

Parameters
module:_ModuleModule containing the class definition.
definition:ast.ClassDefClass providing the members to publish on the facade.
annotations:_AnnotationsContext used to render member types and imports.
Yields
tuplePublic member name and the stub declarations for that member.
def _load_module(name: str, roots: tuple[Path, ...]) -> _Module: (source)

Find source directly, including packages whose initializers have side effects.

Parameters
name:strQualified module name to locate.
roots:tuple[Path, ...]Directories searched in order for a package, stub or source module.
Returns
_ModuleParsed module with the declarations needed for signature resolution.
def _parameters(definition: ast.ClassDef, module: _Module) -> list[str]: (source)

List parameters declared with Python generics or the Generic base.

Parameters
definition:ast.ClassDefClass whose generic parameters are being inspected.
module:_ModuleModule used to resolve imported generic base classes.
Returns
list[str]Type parameter names in declaration order.
def _qualified_name(contract: str) -> str: (source)

Validate the module and class components before locating source files.

Parameters
contract:strPython class reference with a dot or colon before the class name.
Returns
strDotted module and class name used by the source loader.
def _signature(method: Method, annotations: _Annotations, decorators: set[str]) -> str: (source)

Preserve parameter kinds, overloads, defaults and coroutine behavior.

Parameters
method:MethodService method whose declaration is being copied.
annotations:_AnnotationsContext for resolving parameter and return annotations.
decorators:set[str]Names of decorators on the original declaration.
Returns
strPython stub declaration for the facade member.
def interface_replacements(contract: str | None, directory: Path) -> dict[str, str]: (source)

Generate typing declarations for the contract identified by module and class.

Parameters
contract:str | NoneQualified service class name, or None to generate an empty stub.
directory:PathApplication root searched before the interpreter's import paths.
Returns
dict[str, str]Import and member replacements for the facade interface template.
_TYPE_PARAMETERS = (source)

Type parameter nodes supported in a Python generic declaration.

Value
(ast.TypeVar, ast.ParamSpec, ast.TypeVarTuple)

Syntax node for a synchronous or asynchronous service method.

Value
ast.FunctionDef | ast.AsyncFunctionDef