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.

module documentation

Provide view globals operations.

Includes _compile_route_template, _build_route_path, _load_named_routes, _global_route.

Function _build_route_path Replace path placeholders with their values.
Function _compile_route_template Split a route template into literal chunks and placeholder names.
Async Function _load_named_routes Collect every named route as a mapping of name to path template.
Constant _MISSING Sentinel telling a missing placeholder apart from a legitimate None value.
Constant _ROUTE_PARAM_RE Matches route path placeholders such as {id} or {id:int}.
def _build_route_path(template: str, params: dict[str, Any]) -> tuple[str, dict[str, Any]]: (source)

Replace path placeholders with their values.

Parameters
template:strRoute path containing {name} or {name:type} segments.
params:dict[str, typing.Any]Values available to fill the placeholders.
Returns
tuple[str, dict[str, typing.Any]]The interpolated path and the parameters left unused, which the caller appends as a query string.
Raises
orionis.view.exceptions.ViewRouteExceptionIf a placeholder has no matching value in params.
@lru_cache(maxsize=1024)
def _compile_route_template(template: str) -> tuple[tuple[str, ...], tuple[str, ...]]: (source)

Split a route template into literal chunks and placeholder names.

Parameters
template:strRoute path containing {name} or {name:type} segments.
Returns
tuple[tuple[str, ...], tuple[str, ...]]Literal chunks surrounding each placeholder and the ordered placeholder names. Cache at most 1,024 pure plans, evicting the least recently used template when the cache reaches capacity.
async def _load_named_routes(app: IApplication) -> dict[str, str]: (source)

Collect every named route as a mapping of name to path template.

Parameters
app:orionis.IApplicationApplication container used to build the route loader.
Returns
dict[str, str]Route name mapped to its raw path, e.g. '/users/{id:int}'.
_MISSING: Any = (source)

Sentinel telling a missing placeholder apart from a legitimate None value.

Value
object()
_ROUTE_PARAM_RE: re.Pattern = (source)

Matches route path placeholders such as {id} or {id:int}.

Value
re.compile(r'\{(\w+)(?::\w+)?\}')