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

Resolve and execute registered console commands.

Async Method __call Execute a command within a scoped application context.
Method __init__ Initialize the command dispatcher and its services.
Method __parseCommandArgs Parse command arguments and omit values marked as missing.
Async Method call Execute a command in an isolated failure-reporting context.
Method command Register a command and return its fluent configuration.
Async Method hasCommand Check whether a command signature is registered.
Async Method info Return cached metadata for non-internal commands.
Instance Variable __app Application instance for command processing.
Instance Variable __cache_info Initialize cache for command information.
Instance Variable __catch Catch instance for handling exceptions.
Instance Variable __executer Executor instance for managing command output.
Instance Variable __loader Loader instance for managing command loading.
Instance Variable __logger Logger instance for logging command execution details.
Instance Variable __performance_counter PerformanceCounter instance for measuring command execution time.
async def __call(self, signature: str, args: list[str] | None = None) -> int: (source)

Execute a command within a scoped application context.

Parse arguments, resolve the handler, and report execution status and handled failures.

Parameters
signature:strRegistered command signature to execute.
args:list[str] or None, optionalCommand-line tokens to parse; use an empty list when None.
Returns
intHandler exit code, 0 for non-integer results, or 1 after handling a dispatch or execution error.
Raises
SystemExitIf argument parsing fails or command help is requested.
ExceptionIf scope management, initial timing, or failure reporting fails.
def __init__(self, app: IApplication, loader: Loader, executer: Executor, logger: ILogger, catch: ICatch, performance_counter: PerformanceCounter): (source)

Initialize the command dispatcher and its services.

Parameters
app:orionis.foundation.contracts.application.IApplicationApplication container used to resolve and invoke command handlers.
loader:orionis.console.core.loader.LoaderLoader used to register and discover commands.
executer:orionis.console.output.executor.ExecutorOutput service used to display command execution status.
logger:orionis.logging.contracts.logger.ILoggerLogger used to record command outcomes.
catch:orionis.failure.contracts.catch.ICatchException handler used to present command failures.
performance_counter:orionis.support.performance.counter.PerformanceCounterTimer used to measure command execution.
Returns
NoneInitialize the dispatcher with an empty metadata cache.
def __parseCommandArgs(self, command: Command, args: list[str] | None = None) -> dict: (source)

Parse command arguments and omit values marked as missing.

Parameters
command:orionis.console.entities.command.CommandCommand whose argument parser supplies the parsed values.
args:list[str] or None, optionalCommand-line tokens to parse; use an empty list when None.
Returns
dictParsed arguments without MISSING values, or an empty dictionary when the command has no argument parser.
Raises
SystemExitIf argument parsing fails or help is requested.
async def call(self, signature: str, args: list[str] | None = None) -> int: (source)

Execute a command in an isolated failure-reporting context.

Parameters
signature:strRegistered command signature to execute.
args:list[str] or None, optionalCommand-line tokens to parse; use an empty list when None.
Returns
intHandler exit code, 0 for non-integer results, or 1 for failures handled during dispatch.
Raises
SystemExitIf argument parsing fails or command help is requested.
ExceptionIf dispatch or failure reporting raises an unhandled error.
def command(self, signature: str, handler: list[type[Any] | str | None] | str) -> ICommand: (source)

Register a command and return its fluent configuration.

Parameters
signature:strSignature used to identify the command.
handler:list[type[typing.Any] | str | None] | strHandler definition forwarded to the loader; default the method to __call__ when omitted.
Returns
orionis.console.fluent.contracts.command.ICommandFluent command definition for further configuration.
Raises
TypeErrorIf the handler class or method name has an invalid type.
ValueErrorIf the handler list is empty.
AttributeErrorIf the handler method is missing or not callable.
async def hasCommand(self, signature: str) -> bool: (source)

Check whether a command signature is registered.

Parameters
signature:strSignature of the command to locate.
Returns
boolTrue if the loader finds the command, otherwise False.
async def info(self) -> list[dict]: (source)

Return cached metadata for non-internal commands.

Exclude signatures enclosed in double underscores and cache the result after the first lookup.

Returns
list[dict]Dictionaries containing timestamps, signature, description, arguments, object, and method, sorted by signature.

Application instance for command processing.

__cache_info: list[dict] | None = (source)

Initialize cache for command information.

Catch instance for handling exceptions.

__executer = (source)

Executor instance for managing command output.

__loader = (source)

Loader instance for managing command loading.

__logger = (source)

Logger instance for logging command execution details.

__performance_counter = (source)

PerformanceCounter instance for measuring command execution time.