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

Undocumented

Method auth Register the built-in web authentication routes.
Method delete Register a DELETE route.
Method export Export all registered routes and the fallback handler.
Method fallback Register the fallback handler for unmatched routes (HTTP 404).
Method get Register a GET route.
Method group Register a group of routes with a shared prefix and middleware.
Method hub Register a Hub connection endpoint with a fixed wire codec.
Method patch Register a PATCH route.
Method post Register a POST route.
Method put Register a PUT route.
Method query Register a QUERY route.
Method view Register a GET route that renders a template with no controller.
Method websocket Register a WebSocket connection handler independently of HTTP routes.
Class Variable __slots__ Undocumented
def auth(self, login_controller: type | None = None, register_controller: type | None = None, forgot_password_controller: type | None = None): (source)

Register the built-in web authentication routes.

Parameters
login_controller:type | None, optionalController for login and logout. Defaults to the built-in controller.
register_controller:type | None, optionalController for registration and email verification. Defaults to the built-in controller.
forgot_password_controller:type | None, optionalController for forgot-password and password-reset routes. Defaults to the built-in controller.
Returns
NoneRoutes are registered on this router.
Raises
ValueErrorIf registration is attempted outside the web route context.
def delete(self, path: str, action: RouteAction | None = None) -> FluentRoute: (source)

Register a DELETE route.

Parameters
path:strURL path for the route.
action:RouteAction | None, optionalCallable, invokable controller class (defining __call__), or [ControllerClass, 'method_name'] list. If omitted or None, call action(controller, handler) on the returned route before exporting the router.
Returns
FluentRouteThe registered FluentRoute instance.
def export(self) -> dict: (source)

Export all registered routes and the fallback handler.

Returns
dict

A dictionary with two keys:

  • 'routes': list of all registered routes as dicts.
  • 'fallback': tuple (class_or_None, handler_or_callable).
Raises
ValueErrorIf a registered route still has no action or view.
def fallback(self, action: RouteAction): (source)

Register the fallback handler for unmatched routes (HTTP 404).

Only one fallback may be registered; a second call raises FallbackRouteAlreadyRegisteredException.

Parameters
action:RouteActionCallable, invokable controller class (defining __call__), or [ControllerClass, 'method_name'] list. Required because fallback registration does not return a fluent route builder.
Returns
NoneThe fallback is stored on the instance; no value is returned.
Raises
FallbackRouteAlreadyRegisteredExceptionIf a fallback handler has already been registered.
TypeErrorIf the action is None or is not an accepted handler form.
ValueErrorIf a controller pair has an invalid length or names a missing method.
def get(self, path: str, action: RouteAction | None = None) -> FluentRoute: (source)

Register a GET route.

Parameters
path:strURL path for the route.
action:RouteAction | None, optionalCallable, invokable controller class (defining __call__), or [ControllerClass, 'method_name'] list. If omitted or None, call action(controller, handler) on the returned route before exporting the router.
Returns
FluentRouteThe registered FluentRoute instance.
def group(self, *, prefix: str | None = None, middleware: MiddlewareInput | None = None, without_middleware: MiddlewareInput | None = None, routes: Sequence[FluentRoute | RouteGroup] | None = None, public: bool | None = None) -> RouteGroup: (source)

Register a group of routes with a shared prefix and middleware.

Parameters
prefix:str | None, optionalURL prefix prepended to every route path in the group.
middleware:MiddlewareInput | None, optionalMiddleware classes to attach to every route in the group. Accepts a single class or a container of classes.
without_middleware:MiddlewareInput | None, optionalMiddleware classes to exclude from every route in the group. Accepts a single class or a container of classes.
routes:Sequence[FluentRoute | RouteGroup] | None, optionalRoutes or nested groups to include.
public:bool | None, optionalStateless profile inherited by descendants without an explicit choice.
Returns
RouteGroupFlattened membership for composition by another group.
Raises
ValueErrorIf routes is empty or None.
ValueErrorIf prefix is not a str.
ValueErrorIf any entry in middleware or without_middleware is not a BaseMiddleware subclass.
TypeErrorIf membership contains neither routes nor groups.
def hub(self, path: str, hub: type[Hub], *, protocol: str = 'json') -> FluentRoute: (source)

Register a Hub connection endpoint with a fixed wire codec.

Parameters
path:strWebSocket route path, with optional converted parameters.
hub:type[Hub]Hub subclass resolved through the application container.
protocol:str, optionaljson by default, or msgpack for binary frames.
Returns
FluentRouteRegistered Hub route builder.
def patch(self, path: str, action: RouteAction | None = None) -> FluentRoute: (source)

Register a PATCH route.

Parameters
path:strURL path for the route.
action:RouteAction | None, optionalCallable, invokable controller class (defining __call__), or [ControllerClass, 'method_name'] list. If omitted or None, call action(controller, handler) on the returned route before exporting the router.
Returns
FluentRouteThe registered FluentRoute instance.
def post(self, path: str, action: RouteAction | None = None) -> FluentRoute: (source)

Register a POST route.

Parameters
path:strURL path for the route.
action:RouteAction | None, optionalCallable, invokable controller class (defining __call__), or [ControllerClass, 'method_name'] list. If omitted or None, call action(controller, handler) on the returned route before exporting the router.
Returns
FluentRouteThe registered FluentRoute instance.
def put(self, path: str, action: RouteAction | None = None) -> FluentRoute: (source)

Register a PUT route.

Parameters
path:strURL path for the route.
action:RouteAction | None, optionalCallable, invokable controller class (defining __call__), or [ControllerClass, 'method_name'] list. If omitted or None, call action(controller, handler) on the returned route before exporting the router.
Returns
FluentRouteThe registered FluentRoute instance.
def query(self, path: str, action: RouteAction | None = None) -> FluentRoute: (source)

Register a QUERY route.

Parameters
path:strURL path for the route.
action:RouteAction | None, optionalCallable, invokable controller class (defining __call__), or [ControllerClass, 'method_name'] list. If omitted or None, call action(controller, handler) on the returned route before exporting the router.
Returns
FluentRouteThe registered FluentRoute instance.
def view(self, path: str, view: str) -> FluentRoute: (source)

Register a GET route that renders a template with no controller.

Parameters
path:strURL path for the route.
view:strTemplate name in dot notation (e.g. 'welcome')
Returns
FluentRouteThe registered FluentRoute instance.
def websocket(self, path: str, action: RouteAction | None = None) -> FluentRoute: (source)

Register a WebSocket connection handler independently of HTTP routes.

Parameters
path:strConnection path with optional converted parameters.
action:RouteAction | None, optionalFunction, controller action, or invokable controller.
Returns
FluentRouteRegistered connection route builder.
__slots__: tuple = (source)

Undocumented