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 FluentRoute(IFluentRoute): (source)
Constructor: FluentRoute(method, path, action, view)
Undocumented
| Method | __init__ |
Initialize a FluentRoute instance. |
| Method | _hub |
Set the Hub class and its fixed connection codec. |
| Method | _kind |
Set the kind of the route (e.g., 'web', 'api'). |
| Method | action |
Set the controller class and handler for the route. |
| Method | export |
Export a complete route configuration as a plain dictionary. |
| Method | inherit |
Apply validated group context during registration. |
| Method | middleware |
Add middleware to the route. |
| Method | name |
Set the name for the route. |
| Method | prefix |
Prepend a path segment to the route's current path. |
| Method | public |
Select a stateless route without automatic session or identity setup. |
| Method | with |
Exclude one or more middleware classes from the route. |
| Constant | _ALLOWED |
Undocumented |
| Instance Variable | __callable |
Undocumented |
| Instance Variable | __class |
Undocumented |
| Instance Variable | __handler |
Undocumented |
| Instance Variable | __hub |
Undocumented |
| Instance Variable | __hub |
Undocumented |
| Instance Variable | __id |
Undocumented |
| Instance Variable | __kind |
Undocumented |
| Instance Variable | __method |
Undocumented |
| Instance Variable | __middleware |
Undocumented |
| Instance Variable | __name |
Undocumented |
| Instance Variable | __path |
Undocumented |
| Instance Variable | __public |
Undocumented |
| Instance Variable | __view |
Undocumented |
| Instance Variable | __without |
Undocumented |
| Property | id |
Return the unique identifier of the route. |
| Property | path |
Return the current canonical path, including inherited prefixes. |
str, path: str, action: RouteAction | None = None, *, view: str | None = None):
(source)
¶
Initialize a FluentRoute instance.
| Parameters | |
method:str | HTTP method (e.g., 'GET', 'POST'). |
path:str | Route path. |
action:RouteAction | None, optional | Action to execute. Three forms are accepted:
Ignored when view is provided. If omitted or None, set the controller and method with action() before exporting. |
view:str | None, optional | Template name rendered directly by the kernel. When given, the route carries no Python handler and action is not parsed. |
| Returns | |
None | The instance is initialized; no value is returned. |
| Raises | |
TypeError | If method or path is not a string, or a supplied action is invalid. |
ValueError | If method is unsupported, view is invalid, or a controller pair has an invalid length or names a missing method. |
Set the Hub class and its fixed connection codec.
| Parameters | |
hub:type[Hub] | Concrete Hub subclass resolved through the application container. |
protocol:str | Realtime codec name: json or msgpack. |
| Returns | |
Self | This connection route with an explicit Hub action. |
| Raises | |
TypeError | If the class does not inherit from Hub. |
ValueError | If the route is HTTP or the codec is unsupported. |
Export a complete route configuration as a plain dictionary.
| Returns | |
dict | Dictionary with keys: id, method, path, class, handler, callable_handler, view, name, middleware, without_middleware, kind, public, protocol, hub, and hub_protocol. |
| Raises | |
ValueError | If the route has neither a view nor an assigned action. |
str, middleware: tuple[ type[ BaseMiddleware], ...], without_middleware: frozenset[ type[ BaseMiddleware]], *, public: bool | None = None) -> Self:
(source)
¶
Apply validated group context during registration.
| Parameters | |
prefix:str | Canonical prefix without a trailing slash, or an empty string. |
middleware:tuple[type[BaseMiddleware], ...] | Parent middleware, in declaration order. |
withoutfrozenset[type[BaseMiddleware]] | Exclusions inherited by the route. |
public:bool | None, optional | Parent profile applied only when the route has no explicit profile. |
| Returns | |
Self | This route with the parent context prepended. |
Add middleware to the route.
| Parameters | |
*middleware:MiddlewareInput | One or more middleware classes (not instances) to attach. Classes may be passed individually or wrapped in a list, tuple or set. |
| Returns | |
Self | This FluentRoute instance for method chaining. |
Select a stateless route without automatic session or identity setup.
Global security, CORS, rate limits, and explicitly attached middleware still run. Web session, CSRF, and automatic identity resolution do not. Use this profile only for endpoints that do not use cookie credentials.
| Parameters | |
enabled:bool, optional | Whether to opt out of the default web or API context middleware. False explicitly retains that context inside a public group. |
| Returns | |
Self | This route with the requested execution profile. |
| Raises | |
TypeError | If enabled is not a boolean. |
Exclude one or more middleware classes from the route.
| Parameters | |
*middleware:MiddlewareInput | One or more middleware classes to exclude from this route. Classes may be passed individually or wrapped in a list, tuple or set. |
| Returns | |
Self | This FluentRoute instance for method chaining. |