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

Define the contract for route compiler implementations.

Static Method compilePath Determine whether a path is static or dynamic and compile its regex.
Method compile Compile a list of raw route dicts into a ready-to-dispatch structure.

Determine whether a path is static or dynamic and compile its regex.

This method is intentionally public so that orionis.http.routes.route_cache.RouteCache can call it during cache deserialisation to reconstruct regex and converters without ever persisting callable objects.

Parameters
path:strThe route path, e.g. '/users/{id:int}'.
Returns
tuple[bool, re.Pattern | None, dict[str, collections.abc.Callable]](is_static, regex, converters) — regex and converters are None / empty for static paths.
def compile(self, routes: list[dict], fallback: tuple | None, app_middleware: list[type] | None = None) -> tuple[dict[str, dict], tuple | None]: (source)

Compile a list of raw route dicts into a ready-to-dispatch structure.

Parameters
routes:list[dict]Raw route dicts as returned by Router.export()["routes"].
fallback:tuple | NoneRaw fallback tuple from Router.export()["fallback"].
app_middleware:list[type] | None, optionalGlobal middleware classes to prepend to every route's middleware stack before route-specific middleware is applied.
Returns
tuple[dict[str, dict], tuple | None]A pair (compiled_routes, fallback) where compiled_routes maps each HTTP method to {"static": {path: CompiledRoute}, "dynamic": [CompiledRoute, ...]}. Dynamic lists are sorted descending by priority_score so more-specific patterns are matched first.
Raises
ValueErrorIf two dynamic routes produce the same structural URL pattern (collision).
TypeErrorIf an invokable class does not define __call__.