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

Reject every incoming request with 503 while in maintenance mode.

The response format (HTML or JSON) is selected by inspecting the Accept header of the incoming request via adapter.wantsJson().

Method __init__ Initialize with the maintenance flag and default response handler.
Async Method handle Return a 503 response if the application is under maintenance.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable __default_responses Handler used to build the 503 response.
Instance Variable __under_maintenance True when the application is in maintenance mode.
def __init__(self, *, under_maintenance: bool, default_responses: IDefaultResponses): (source)

Initialize with the maintenance flag and default response handler.

Parameters
under_maintenance:boolTrue when the application is in maintenance mode.
default_responses:orionis.http.default.contracts.responses.IDefaultResponsesHandler used to build the 503 response.
Returns
NoneInitialize with the maintenance flag and default response handler.
async def handle(self, adapter: TransportAdapter, *, under_maintenance: bool | None = None) -> Response | None: (source)

Return a 503 response if the application is under maintenance.

Parameters
adapter:orionis.http.adapters.request.contracts.transport.TransportAdapterTransport adapter providing header access and client-preference detection via wantsJson().
under_maintenance:bool | None, optionalCurrent application state; uses the constructor value when omitted.
Returns
orionis.http.Response | NoneA 503 response when the application is in maintenance mode, None otherwise.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

__default_responses: IDefaultResponses = (source)

Handler used to build the 503 response.

__under_maintenance: bool = (source)

True when the application is in maintenance mode.