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.
Define application configuration, lifecycle and runtime entry points.
| Async Method | boot |
Create the application and await eager providers for headless use. |
| Method | compile |
Configure the directory and source paths for compiled application state. |
| Method | config |
Get or set an application configuration value. |
| Method | create |
Bootstrap and initialize the application framework. |
| Async Method | get |
Retrieve the registered exception handler instance. |
| Method | get |
Retrieve the list of registered middleware classes. |
| Async Method | get |
Retrieve the currently registered scheduler instance. |
| Async Method | handle |
Run a CLI command through the configured command kernel. |
| Method | is |
Determine if the application is running in debug mode. |
| Method | is |
Determine if the application is running in a production environment. |
| Method | on |
Register callbacks for a specific application lifespan event. |
| Method | path |
Retrieve an application path by key or return all paths. |
| Method | reset |
Reset the runtime configuration to a mutable copy of the bootstrap config. |
| Method | routing |
Retrieve routing file paths from configuration. |
| Method | under |
Determine if the application is currently in maintenance mode. |
| Method | with |
Configure application settings using keyword arguments. |
| Method | with |
Configure authentication subsystem using keyword arguments. |
| Method | with |
Configure the cache subsystem using keyword arguments. |
| Method | with |
Configure the database subsystem using keyword arguments. |
| Method | with |
Configure the filesystems subsystem using keyword arguments. |
| Method | with |
Configure the HTTP subsystem using keyword arguments. |
| Method | with |
Configure logging subsystem using keyword arguments. |
| Method | with |
Configure mail subsystem using keyword arguments. |
| Method | with |
Configure MCP protocol limits and the explicit Origin allowlist. |
| Method | with |
Set and resolve application directory paths. |
| Method | with |
Configure the queue subsystem using keyword arguments. |
| Method | with |
Configure session subsystem using keyword arguments. |
| Method | with |
Configure the testing subsystem using keyword arguments. |
| Method | with |
Register a custom exception handler class for the application. |
| Method | with |
Register middleware for the application. |
| Method | with |
Register service providers for the application. |
| Method | with |
Configure routing paths for the application. |
| Method | with |
Register a custom scheduler class for the application. |
| Class Variable | __slots__ |
Undocumented |
| Property | are |
Check whether every eager provider has finished startup. |
| Property | base |
Return the base path of the application. |
| Property | compiled |
Indicate whether the application is running in compiled mode. |
| Property | compiled |
Return the list of directory paths monitored for cache invalidation. |
| Property | compiled |
Return the list of file paths monitored for cache invalidation. |
| Property | compiled |
Return the path where compiled cache files are stored. |
| Property | entry |
Return the entry point module path where the application was created. |
| Property | is |
Check whether configuration and provider registration have completed. |
| Property | is |
Check whether configuration and service registration are complete. |
| Property | is |
Check whether eager providers and both HTTP handlers are ready. |
| Property | route |
Return the health check route for the application. |
| Property | start |
Return the application startup timestamp in nanoseconds. |
Inherited from IContainer:
| Method | begin |
Begin a new scope context manager for scoped services. |
| Method | bound |
Determine if a key is bound in the container or current scope. |
| Async Method | build |
Build and return an instance of the specified type. |
| Async Method | call |
Invoke a method on an object instance with automatic dependency injection. |
| Method | get |
Get the current active scope context for scoped services. |
| Method | instance |
Register an object instance as a singleton in the container. |
| Async Method | invoke |
Invoke a callable with automatic dependency injection. |
| Async Method | make |
Resolve and return a service instance by key. |
| Method | scoped |
Register a scoped service binding. |
| Method | singleton |
Register a singleton service binding. |
| Method | transient |
Register a transient service binding. |
orionis.ApplicationCreate the application and await eager providers for headless use.
| Returns | |
Self | The application after successful eager provider startup. |
| Raises | |
Exception | Propagate configuration or provider startup failures for retry. |
str | None = None, invalidation_paths: list[ str] | None = None):
(source)
¶
orionis.ApplicationConfigure the directory and source paths for compiled application state.
| Parameters | |
path:str or None, optional | Directory used to store the compiled application cache. |
invalidationlist of str or None, optional | Paths monitored for changes that invalidate the cache. |
| Returns | |
None | Configure compiled application state in place. |
str | None = None, value: object = _SENTINEL) -> object:
(source)
¶
orionis.ApplicationGet or set an application configuration value.
| Parameters | |
key:str or None, optional | Dot-notated key specifying the configuration value to get or set. If None and value is not provided, returns the entire configuration. |
value:object, optional | Value to set at the specified key. If not provided, retrieves the value. |
| Returns | |
object | The configuration value for the given key, or the entire configuration if no key is provided. If setting a value, returns the value set. |
| Raises | |
RuntimeError | If the application configuration is not initialized. |
TypeError | If the configuration key is not a string. |
orionis.ApplicationBootstrap and initialize the application framework.
Register the application instance, load all configurations, set timezone and locale, and mark the application as booted.
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationRetrieve the registered exception handler instance.
| Parameters | |
self:Application | The current application instance. |
| Returns | |
IBaseExceptionHandler | The registered exception handler instance. If none is set, returns the default BaseExceptionHandler instance. |
| Raises | |
RuntimeError | If called before the application is booted. |
orionis.ApplicationRetrieve the list of registered middleware classes.
| Returns | |
list[type[IBaseMiddleware]] | A list of middleware classes registered in the application. |
orionis.ApplicationRetrieve the currently registered scheduler instance.
| Returns | |
IBaseScheduler | The registered scheduler instance. |
| Raises | |
RuntimeError | If the application is not booted. |
orionis.ApplicationRun a CLI command through the configured command kernel.
| Parameters | |
args:list of str or None, optional | Command-line arguments passed to the CLI kernel. |
| Returns | |
int | Exit code returned by the command kernel. |
| Raises | |
RuntimeError | If the CLI kernel is not configured. |
TypeError | If the configured kernel does not implement the CLI interface. |
orionis.ApplicationDetermine if the application is running in debug mode.
| Returns | |
bool | True if debug mode is enabled in the configuration, otherwise False. |
| Raises | |
RuntimeError | If the application configuration is not initialized. |
orionis.ApplicationDetermine if the application is running in a production environment.
Checks the 'app.env' configuration value to see if it contains 'prod'. This is useful for toggling production-specific features.
| Returns | |
bool | True if the application environment contains 'prod', otherwise False. |
| Raises | |
RuntimeError | If the application configuration is not initialized. |
Lifespan, *callbacks: Callable[ ..., Any] | Callable[ ..., Awaitable[ Any]], runtime: Runtime | None = None) -> Self:
(source)
¶
orionis.ApplicationRegister callbacks for a specific application lifespan event.
Notes
Callbacks are stored as-is and executed during the specified lifespan event. Lambdas and dynamic callables are supported.
| Parameters | |
lifespan:Lifespan | The application lifespan event to register callbacks for. |
*callbacks:Callable[..., Any] | Callable[..., Awaitable[Any]] | One or more callback functions to execute during the event. |
runtime:Runtime | None, optional | The runtime environment for which to register the callbacks. If None, callbacks are registered for all runtimes. |
| Returns | |
Self | The current Application instance for method chaining. |
| Raises | |
TypeError | If lifespan is not a Lifespan enum or any callback is not callable. |
ValueError | If no callbacks are provided. |
str | None = None) -> Path | Mapping[ str, Path] | None:
(source)
¶
orionis.ApplicationRetrieve an application path by key or return all paths.
| Parameters | |
key:str | None, optional | The key for the desired path. If None, returns all paths. |
| Returns | |
Path | Mapping[str, Path] | None | The resolved path for the given key, all paths as a read-only mapping, or None if the key does not exist. |
| Raises | |
RuntimeError | If the application configuration is not initialized. |
TypeError | If the key is not a string. |
orionis.ApplicationReset the runtime configuration to a mutable copy of the bootstrap config.
Resets the application's runtime configuration to a mutable and isolated copy of the bootstrap configuration. The application remains booted and subsequent accesses use the restored runtime values.
| Returns | |
bool | True if the configuration was reset successfully. |
str | None = None) -> list[ Path] | dict | None:
(source)
¶
orionis.ApplicationRetrieve routing file paths from configuration.
Only 'api', 'web', and 'console' routing types are supported. The health-check route is exposed through the routeHealthCheck property and is not accessible via this method.
| Parameters | |
key:str | None, optional | Routing type to retrieve: 'api', 'web', or 'console'. If None, returns the complete routing configuration dictionary. |
| Returns | |
list[Path] | dict | None | List of Path objects for the specified routing type, the complete routing configuration dictionary if no key is provided, or None if the key is not one of the valid routing types. |
| Raises | |
RuntimeError | If the application configuration is not initialized. |
TypeError | If the key is not a string or None. |
orionis.ApplicationDetermine if the application is currently in maintenance mode.
| Returns | |
bool | True if configuration or the runtime marker enables maintenance. |
| Raises | |
RuntimeError | If the application configuration is not initialized. |
orionis.ApplicationConfigure application settings using keyword arguments.
| Parameters | |
**appobject | Configuration parameters for the application. Keys must match the field names and types expected by the App dataclass from orionis.foundation.config.app.entities.app.App. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure authentication subsystem using keyword arguments.
| Parameters | |
**authobject | Keyword arguments for authentication configuration. Keys must match
the fields of the Auth dataclass from
orionis.foundation.config.auth.entities.auth.Auth. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure the cache subsystem using keyword arguments.
| Parameters | |
**cacheobject | Keyword arguments representing cache configuration options. Keys must
match the field names and types expected by the Cache dataclass from
orionis.foundation.config.cache.entities.cache.Cache. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure the database subsystem using keyword arguments.
| Parameters | |
**databaseobject | Keyword arguments for database configuration. Keys must match the
fields of the Database dataclass from
orionis.foundation.config.database.entities.database.Database. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure the filesystems subsystem using keyword arguments.
| Parameters | |
**filesystemsobject | Keyword arguments for filesystems configuration. Keys must match the
fields of the Filesystems dataclass from
orionis.foundation.config.filesystems.entitites.filesystems.Filesystems. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure the HTTP subsystem using keyword arguments.
| Parameters | |
**httpobject | Keyword arguments for HTTP configuration. Keys must match the field
names and types expected by the HTTP dataclass from
orionis.foundation.config.http.entitites.http.HTTP. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure logging subsystem using keyword arguments.
| Parameters | |
**loggingobject | Keyword arguments for logging configuration. Keys must match the
fields of the Logging dataclass from
orionis.foundation.config.logging.entities.logging.Logging. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure mail subsystem using keyword arguments.
| Parameters | |
**mailobject | Keyword arguments for mail configuration. Keys must match the fields
of the Mail dataclass from
orionis.foundation.config.mail.entities.mail.Mail. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure MCP protocol limits and the explicit Origin allowlist.
| Parameters | |
**mcpobject | Fields accepted by the native McpConfig entity. |
| Returns | |
Self | The application for further configuration. |
orionis.ApplicationSet and resolve application directory paths.
| Parameters | |
**paths:str | Path | None | Optional directory path overrides. Valid keys are 'app', 'console', 'exceptions', 'http', 'models', 'providers', 'notifications', 'services', 'jobs', 'bootstrap', 'config', 'database', 'resources', 'routes', 'storage' and 'tests'. The root always comes from basePath. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure the queue subsystem using keyword arguments.
| Parameters | |
**queueobject | Keyword arguments representing queue configuration options. Keys must
match the field names and types expected by the Queue dataclass from
orionis.foundation.config.queue.entities.queue.Queue. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure session subsystem using keyword arguments.
| Parameters | |
**sessionobject | Keyword arguments for session configuration. Keys must match the
fields of the Session dataclass from
orionis.foundation.config.session.entities.session.Session. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationConfigure the testing subsystem using keyword arguments.
| Parameters | |
**testingobject | Keyword arguments for testing configuration. Keys must match the
fields of the Testing dataclass from
orionis.foundation.config.testing.entities.testing.Testing. |
| Returns | |
Self | The current Application instance for method chaining. |
type[ IBaseExceptionHandler]) -> Self:
(source)
¶
orionis.ApplicationRegister a custom exception handler class for the application.
Notes
Stores the handler class for later instantiation. Any previously registered handler is silently replaced.
| Parameters | |
handler:type[IBaseExceptionHandler] | Exception handler class to use. Must inherit from BaseExceptionHandler. |
| Returns | |
Self | The current Application instance for method chaining. |
| Raises | |
TypeError | If the handler is not a class or not a subclass of BaseExceptionHandler. |
RuntimeError | If attempting to set handler after application has been booted. |
orionis.ApplicationRegister middleware for the application.
| Parameters | |
*middleware:tuple[type[IBaseMiddleware], ...] | Middleware classes to register. Each must inherit from IBaseMiddleware. |
| Returns | |
Self | The current Application instance for method chaining. |
orionis.ApplicationRegister service providers for the application.
| Parameters | |
*providers:tuple[type[IServiceProvider], ...] | Service provider classes to register. Each must inherit from IServiceProvider. |
| Returns | |
Self | The current Application instance for method chaining. |
| Raises | |
TypeError | If any argument is not a class or does not inherit from IServiceProvider. |
str | list[ str] | None = None, web: str | list[ str] | None = None, console: str | list[ str] | None = None, health: str | None = None, ai: str | list[ str] | None = None, *, websocket: str | list[ str] | None = None) -> Self:
(source)
¶
orionis.ApplicationConfigure routing paths for the application.
| Parameters | |
api:str | list[str] | None, optional | Path(s) to API routing files. |
web:str | list[str] | None, optional | Path(s) to web routing files. |
console:str | list[str] | None, optional | Path(s) to console routing files. |
health:str | None, optional | Path to health check route. |
ai:str | list[str] | None, optional | MCP registration files loaded for HTTP and CLI runtimes. |
websocket:str | list[str] | None, optional | WebSocket and Hub route files using the web middleware profile. |
| Returns | |
Self | The current Application instance for method chaining. |
| Raises | |
TypeError | If routing arguments are of invalid types or do not contain valid routing definitions. |
FileNotFoundError | If a specified routing file does not exist. |
orionis.ApplicationRegister a custom scheduler class for the application.
Notes
Stores the scheduler class metadata for later instantiation. Any previously registered scheduler is silently replaced.
| Parameters | |
scheduler:type[IBaseScheduler] | The scheduler class to be used. Must inherit from IBaseScheduler. |
| Returns | |
Self | The current Application instance for method chaining. |
| Raises | |
RuntimeError | If attempting to set scheduler after application has been booted. |
TypeError | If the provided scheduler is not a subclass of IBaseScheduler. |
orionis.ApplicationCheck whether every eager provider has finished startup.
| Returns | |
bool | True after creation and eager startup; deferred providers remain lazy. |
orionis.ApplicationReturn the base path of the application.
| Returns | |
Path | The base directory path of the application. |
orionis.ApplicationIndicate whether the application is running in compiled mode.
| Returns | |
bool | True if the application is configured to run in compiled mode, otherwise False. |
orionis.ApplicationReturn the list of directory paths monitored for cache invalidation.
| Returns | |
list of Path | List of directory paths monitored for cache invalidation. |
orionis.ApplicationReturn the list of file paths monitored for cache invalidation.
| Returns | |
list of Path | List of file paths monitored for cache invalidation. |
orionis.ApplicationReturn the path where compiled cache files are stored.
| Returns | |
Path or None | The directory path for compiled cache storage, or None if not configured. |
orionis.ApplicationReturn the entry point module path where the application was created.
| Returns | |
str | None | The module path in the format 'folder.subfolder.file:app' where the application instance was created, or None if not available. |
orionis.ApplicationCheck whether configuration and provider registration have completed.
| Returns | |
bool | True after create() completes. Asynchronous provider startup and HTTP kernel readiness complete during the server lifespan startup. |
orionis.ApplicationCheck whether configuration and service registration are complete.
| Returns | |
bool | Alias of the legacy isBooted configuration-stage flag. |
orionis.ApplicationCheck whether eager providers and both HTTP handlers are ready.
| Returns | |
bool | HTTP kernel readiness, excluding sockets and deployment health. |
orionis.ApplicationReturn the health check route for the application.
| Returns | |
str | The configured health check route path. Returns "/up" if not set. |