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

Undocumented

Class _DepthBucket No class docstring; 0/3 instance variable, 0/1 class variable, 1/1 method documented
Class _PrefixIndex Select the first distinct segment after a shared static path prefix.
Class RouteResolver Resolve compiled routes using static maps and ordered dynamic buckets.
Function _build_depth_bucket Build a depth matcher, splitting literal prefixes when useful.
Function _build_extractors Build parameter extraction tuples from route converters.
Function _build_matching_bucket Build an ordered matcher and extractors for dynamic routes.
Function _build_overlapping_index Merge wildcard candidates into literal branches in route order.
Function _extract_converter_fallback Try later matching routes after a parameter conversion failure.
Function _extract_result Extract a resolved route and convert its matched parameters.
Function _partition_route_segments Partition literal and wildcard path segments in candidate order.
Function _path_allowed_for_method Check whether a method has a static or regex match for a path.
Function _select_bucket Select a dynamic route bucket by path depth and literal segments.
Constant _GROUP_NAME_RE Undocumented
Constant _METHOD_MAP Undocumented
Type Alias BucketEntry Undocumented
Type Alias Extractor Undocumented
Type Alias ParamConverter Undocumented
def _build_depth_bucket(routes: list[CompiledRoute], start: int = 1) -> _DepthBucket | _PrefixIndex: (source)

Build a depth matcher, splitting literal prefixes when useful.

Parameters
routes:list[CompiledRoute]Dynamic candidates at one depth, sorted by compiler priority.
start:int, optionalCharacter offset of the next path segment to partition. Defaults to 1.
Returns
_DepthBucket | _PrefixIndexShared matcher or prefix index preserving route priority and overlap.
def _build_extractors(converters: dict[str, ParamConverter], prefix: str, groupindex: dict[str, int]) -> list[Extractor]: (source)

Build parameter extraction tuples from route converters.

Parameters
converters:dict[str, ParamConverter]Parameter names mapped to converter callables, in extraction order.
prefix:strPrefix prepended to parameter names in the regex capture groups.
groupindex:dict[str, int]Named capture groups mapped to their numeric indices.
Returns
list[Extractor]Ordered list of (param_name, group_index, converter) tuples.
Raises
KeyErrorIf a prefixed parameter name is absent from groupindex.
def _build_matching_bucket(routes: list[CompiledRoute]) -> _DepthBucket: (source)

Build an ordered matcher and extractors for dynamic routes.

Parameters
routes:list[CompiledRoute]Dynamic candidates at one depth, sorted by compiler priority.
Returns
_DepthBucketRegex matcher with per-route extractors and optional alternative markers.
Raises
re.PatternErrorIf rewritten route patterns cannot form a valid combined regex.
KeyErrorIf a converter has no corresponding named capture group.
def _build_overlapping_index(routes: list[CompiledRoute], start: int, branches: dict[str, list[tuple[int, CompiledRoute]]], wildcards: list[tuple[int, CompiledRoute]]) -> _DepthBucket | _PrefixIndex: (source)

Merge wildcard candidates into literal branches in route order.

Reuse a shared matcher when fewer than two literal branches exist or more than eight wildcard candidates would be duplicated.

Parameters
routes:list[CompiledRoute]Complete candidate list in priority order for the shared matcher.
start:intCharacter offset of the segment used to select a literal branch.
branches:dict[str, list[tuple[int, CompiledRoute]]]Literal segment values mapped to sorted (index, route) pairs.
wildcards:list[tuple[int, CompiledRoute]]Wildcard candidates with original indices, in priority order.
Returns
_DepthBucket | _PrefixIndexPrefix index with a wildcard fallback, or the shared ordered matcher.
def _extract_converter_fallback(path: str, bucket: _DepthBucket, match: re.Match[str]) -> ResolvedRoute | None: (source)

Try later matching routes after a parameter conversion failure.

Skip candidates whose converters raise ValueError or OverflowError.

Parameters
path:strNormalized request path to match against later routes.
bucket:_DepthBucketOrdered routes in the selected dynamic bucket.
match:re.Match[str]Match whose parameter converter failed.
Returns
ResolvedRoute | NoneFirst later route whose parameters convert successfully, or None.
def _extract_result(match: re.Match[str], bucket: _DepthBucket) -> ResolvedRoute: (source)

Extract a resolved route and convert its matched parameters.

Parameters
match:re.Match[str]Successful match against the bucket's regex.
bucket:_DepthBucketOrdered route candidates and their parameter extraction metadata.
Returns
ResolvedRouteCompiled route with its extracted and converted parameter mapping.
Raises
RouteNotFoundIf a combined match lacks its identifying route marker.
ValueError, OverflowErrorIf a parameter converter rejects a captured value.
def _partition_route_segments(routes: list[CompiledRoute], start: int) -> tuple[dict[str, list[tuple[int, CompiledRoute]]], list[tuple[int, CompiledRoute]]] | None: (source)

Partition literal and wildcard path segments in candidate order.

Parameters
routes:list[CompiledRoute]Candidates sorted by compiler priority.
start:intCharacter offset of the path segment to partition.
Returns
tuple | NoneLiteral branches and wildcard candidates as (index, route) pairs, or None if any selected segment is empty.
def _path_allowed_for_method(static_table: dict[str, ResolvedRoute], dynamic_table: DepthTable, path: str, depth: int) -> bool: (source)

Check whether a method has a static or regex match for a path.

Inspect lookup structures without extracting or converting parameters.

Parameters
static_table:dict[str, ResolvedRoute]Static paths mapped to resolved routes for one HTTP method.
dynamic_table:DepthTableDynamic candidates grouped by depth for the same method.
path:strNormalized request path to check.
depth:intNumber of path separators, or zero for the root path.
Returns
boolTrue if a static path or dynamic pattern matches; otherwise, False.
def _select_bucket(table: DepthTable, path: str, depth: int) -> _DepthBucket | None: (source)

Select a dynamic route bucket by path depth and literal segments.

Parameters
table:DepthTableDynamic candidates grouped by depth for one HTTP method.
path:strNormalized request path used to traverse literal prefix branches.
depth:intNumber of path separators, or zero for the root path.
Returns
_DepthBucket | NoneBucket selected by depth and prefix, or None if no branch or fallback applies. The bucket's regex is not evaluated.
_GROUP_NAME_RE: re.Pattern = (source)

Undocumented

Value
re.compile(r'\(\?P<(\w+)>')
_METHOD_MAP: dict[str, str] = (source)

Undocumented

Value
{'GET': 'GET',
 'HEAD': 'GET',
 'POST': 'POST',
 'PUT': 'PUT',
 'DELETE': 'DELETE',
 'PATCH': 'PATCH',
 'QUERY': 'QUERY',
...
BucketEntry = (source)

Undocumented

Value
tuple[list[Extractor], CompiledRoute]
Extractor = (source)

Undocumented

Value
tuple[str, int, ParamConverter]
ParamConverter = (source)

Undocumented

Value
Callable[[str], object]