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

Undocumented

Method __getCachePersistence Build the cache persistence handle for compiled routes.
Method __importFluentRoutes Import a route file by kind so its fluent registrations run.
Method __init__ Initialise the RouteLoader with its required collaborators.
Method __loadRoutes Load compiled routes, using the persistent cache when available.
Method load Return all compiled routes, loading them first if necessary.
Constant _KINDS Undocumented
Instance Variable __app Undocumented
Instance Variable __app_middleware Undocumented
Instance Variable __cache Undocumented
Instance Variable __compiler Undocumented
Instance Variable __fallback Undocumented
Instance Variable __loaded Undocumented
Instance Variable __persistence Undocumented
Instance Variable __router Undocumented
Instance Variable __routes Undocumented
Instance Variable __use_cache Undocumented
Property fallback Return the registered fallback handler, if any.
def __getCachePersistence(self) -> IFileBasedCache | None: (source)

Build the cache persistence handle for compiled routes.

Returns
IFileBasedCache | NoneA FileBasedCache instance when the application has a compiled cache directory configured, None otherwise.
def __importFluentRoutes(self, kind: str): (source)

Import a route file by kind so its fluent registrations run.

Parameters
kind:strRoute group kind, e.g. 'web' or 'api'.
Returns
NoneImports the module as a side-effect; no value is returned.
def __init__(self, app: IApplication, router: IRouter, compiler: RouteCompiler, cache: RouteCache): (source)

Initialise the RouteLoader with its required collaborators.

Parameters
app:IApplicationApplication instance used to resolve paths and settings.
router:IRouterRouter that holds the raw registered routes.
compiler:RouteCompilerCompiler that converts raw routes to CompiledRoute objects.
cache:RouteCacheSerialiser/deserialiser for the compiled route cache.
Returns
NoneThe instance is initialised; no value is returned.
def __loadRoutes(self): (source)

Load compiled routes, using the persistent cache when available.

On a cache hit the routes and fallback are deserialised directly. On a cache miss all route files are imported (which registers routes in the router), the compiler builds CompiledRoute objects, and the result is persisted for subsequent requests. An absent fallback is normalized to None before persistence, matching the representation restored from cache.

Returns
NonePopulates self.__routes and self.__fallback in place; no value is returned.
def load(self) -> dict[str, dict]: (source)

Return all compiled routes, loading them first if necessary.

Returns
dict[str, dict]Mapping of HTTP method to a dict with keys 'static' ({path: CompiledRoute}) and 'dynamic' ([CompiledRoute, ...]).
_KINDS: tuple[str, ...] = (source)

Undocumented

Value
('web', 'api')

Undocumented

Undocumented

Undocumented

__compiler = (source)

Undocumented

__fallback: tuple | None = (source)

Undocumented

__loaded: bool = (source)

Undocumented

__persistence: IFileBasedCache | None = (source)

Undocumented

__router = (source)

Undocumented

Undocumented

__use_cache: bool = (source)

Undocumented

Return the registered fallback handler, if any.

The fallback is used when no route matches the incoming request. Accessing this property triggers route loading if it has not already occurred.

Returns
tuple | None(class, method_name) for controller-based fallbacks, (None, callable) for callable-based fallbacks, or None if no fallback has been registered, whether routes are compiled on demand or restored from cache.