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.
Undocumented
| Class | _ |
No class docstring; 0/3 instance variable, 0/1 class variable, 1/1 method documented |
| Class | _ |
Select the first distinct segment after a shared static path prefix. |
| Class | |
Resolve compiled routes using static maps and ordered dynamic buckets. |
| Function | _build |
Build a depth matcher, splitting literal prefixes when useful. |
| Function | _build |
Build parameter extraction tuples from route converters. |
| Function | _build |
Build an ordered matcher and extractors for dynamic routes. |
| Function | _build |
Merge wildcard candidates into literal branches in route order. |
| Function | _extract |
Try later matching routes after a parameter conversion failure. |
| Function | _extract |
Extract a resolved route and convert its matched parameters. |
| Function | _partition |
Partition literal and wildcard path segments in candidate order. |
| Function | _path |
Check whether a method has a static or regex match for a path. |
| Function | _select |
Select a dynamic route bucket by path depth and literal segments. |
| Constant | _GROUP |
Undocumented |
| Constant | _METHOD |
Undocumented |
| Type Alias | |
Undocumented |
| Type Alias | |
Undocumented |
| Type Alias | |
Undocumented |
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, optional | Character offset of the next path segment to partition. Defaults to 1. |
| Returns | |
_DepthBucket | _PrefixIndex | Shared matcher or prefix index preserving route priority and overlap. |
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:str | Prefix 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 | |
KeyError | If a prefixed parameter name is absent from groupindex. |
Build an ordered matcher and extractors for dynamic routes.
| Parameters | |
routes:list[CompiledRoute] | Dynamic candidates at one depth, sorted by compiler priority. |
| Returns | |
_DepthBucket | Regex matcher with per-route extractors and optional alternative markers. |
| Raises | |
re.PatternError | If rewritten route patterns cannot form a valid combined regex. |
KeyError | If a converter has no corresponding named capture group. |
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:int | Character 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 | _PrefixIndex | Prefix index with a wildcard fallback, or the shared ordered matcher. |
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:str | Normalized request path to match against later routes. |
bucket:_DepthBucket | Ordered routes in the selected dynamic bucket. |
match:re.Match[str] | Match whose parameter converter failed. |
| Returns | |
ResolvedRoute | None | First later route whose parameters convert successfully, or None. |
Extract a resolved route and convert its matched parameters.
| Parameters | |
match:re.Match[str] | Successful match against the bucket's regex. |
bucket:_DepthBucket | Ordered route candidates and their parameter extraction metadata. |
| Returns | |
ResolvedRoute | Compiled route with its extracted and converted parameter mapping. |
| Raises | |
RouteNotFound | If a combined match lacks its identifying route marker. |
ValueError, OverflowError | If a parameter converter rejects a captured value. |
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:int | Character offset of the path segment to partition. |
| Returns | |
tuple | None | Literal branches and wildcard candidates as (index, route) pairs, or None if any selected segment is empty. |
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 | |
staticdict[str, ResolvedRoute] | Static paths mapped to resolved routes for one HTTP method. |
dynamicDepthTable | Dynamic candidates grouped by depth for the same method. |
path:str | Normalized request path to check. |
depth:int | Number of path separators, or zero for the root path. |
| Returns | |
bool | True if a static path or dynamic pattern matches; otherwise, False. |
Select a dynamic route bucket by path depth and literal segments.
| Parameters | |
table:DepthTable | Dynamic candidates grouped by depth for one HTTP method. |
path:str | Normalized request path used to traverse literal prefix branches. |
depth:int | Number of path separators, or zero for the root path. |
| Returns | |
_DepthBucket | None | Bucket selected by depth and prefix, or None if no branch or fallback applies. The bucket's regex is not evaluated. |