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 Reactor(IReactor): (source)
Constructor: Reactor(app, loader, executer, logger, ...)
Undocumented
| Method | __init__ |
Initialize Reactor instance for command discovery and management. |
| Method | __parse |
Parse command-line arguments for a command using its ArgumentParser. |
| Async Method | call |
Execute a registered command by its signature. |
| Method | command |
Register a fluent command with the given signature and handler. |
| Async Method | has |
Check whether a command signature is registered. |
| Async Method | info |
Return registered commands metadata. |
| Instance Variable | __app |
Undocumented |
| Instance Variable | __cache |
Undocumented |
| Instance Variable | __catch |
Undocumented |
| Instance Variable | __executer |
Undocumented |
| Instance Variable | __loader |
Undocumented |
| Instance Variable | __logger |
Undocumented |
| Instance Variable | __performance |
Undocumented |
IApplication, loader: Loader, executer: Executor, logger: ILogger, catch: ICatch, performance_counter: PerformanceCounter):
(source)
¶
Initialize Reactor instance for command discovery and management.
Set up the command processing environment, establish the application context, and initialize internal registries for command lookup and execution.
| Parameters | |
app:IApplication | Application instance for command processing. |
loader:Loader | Loader instance for managing command loading. |
executer:Executor | Executor instance for managing command output. |
logger:ILogger | Logger instance for logging command execution details. |
catch:ICatch | Catch instance for handling exceptions. |
performancePerformanceCounter | PerformanceCounter instance for measuring command execution time. |
| Returns | |
None | This constructor does not return any value. |
Parse command-line arguments for a command using its ArgumentParser.
| Parameters | |
command:Command | Command object containing the argument parser and metadata. |
args:Optional[list[str]], default None | List of command-line arguments to parse. If None, an empty list is used. |
| Returns | |
dict | Dictionary with parsed argument names and values. Returns an empty dict if no arguments are expected or provided. |
| Raises | |
SystemExit | Raised by argparse if argument parsing fails or help is requested. |
RuntimeError | Raised if argument parsing fails for reasons other than SystemExit. |
Execute a registered command by its signature.
| Parameters | |
signature:str | Command signature to execute. |
args:list of str or None, optional | Arguments to pass to the command. |
| Returns | |
int | The output produced by the command execution. |
| Raises | |
ValueError | If the command is not found. |
Exception | If command execution fails. |
str, handler: list[ type[ Any] | str | None] | str) -> ICommand:
(source)
¶
Return registered commands metadata.
Retrieve all loaded commands from the internal registry, skipping internal commands (those with double underscores). Each command is represented as a dictionary containing its signature and description.
| Returns | |
list of dict | List of dictionaries with 'signature' and 'description' for each command. |