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

Read/write abstraction over a protocol scope (ASGI or RSGI).

Decouples middleware logic from the underlying transport protocol, allowing all middlewares to operate against a single unified interface regardless of whether the server speaks ASGI or RSGI.

Method client Return the remote client address parsed from the RSGI/ASGI scope.
Method getScope Return the underlying protocol scope object.
Method headers Return the request headers as a Headers object.
Method method Return the HTTP method of the current request.
Method path Return the URL path of the current request.
Method scheme Return the URL scheme of the current request.
Method setClient Set the remote client address in the scope.
Method setScheme Set the URL scheme of the current request.
Method setState Store an arbitrary value in the scope under the given key.
Method wantsJson Determine if the client prefers a JSON response based on the Accept header.
Class Variable __slots__ Undocumented
def client(self) -> str | None: (source)

Return the remote client address parsed from the RSGI/ASGI scope.

Returns
str | NoneThe client IP address as a string, or None if not available.
def getScope(self) -> dict: (source)

Return the underlying protocol scope object.

Returns the scope as adjusted by the use of other methods in this adapter. Reflects any modifications made through setClient, setScheme, setState, etc.

Returns
dictA dict representation of the scope with any overrides applied. The original scope object is never mutated.
def headers(self) -> Headers: (source)

Return the request headers as a Headers object.

Returns
HeadersThe headers parsed from the scope, decoded to strings.
def method(self) -> str | None: (source)

Return the HTTP method of the current request.

Returns
str | NoneThe HTTP method (e.g. 'GET', 'POST'), or None.
def path(self) -> str | None: (source)

Return the URL path of the current request.

Returns
str | NoneThe request path, or None if unavailable.
def scheme(self) -> str | None: (source)

Return the URL scheme of the current request.

Returns
str | NoneThe scheme (e.g. 'http', 'https'), or None.
def setClient(self, ip: str): (source)

Set the remote client address in the scope.

Parameters
ip:strThe client IP address to assign.
Returns
NoneNo value is returned.
def setScheme(self, value: str): (source)

Set the URL scheme of the current request.

Parameters
value:strThe scheme to apply (e.g. 'http', 'https').
Returns
NoneNo value is returned.
def setState(self, key: str, value: Any): (source)

Store an arbitrary value in the scope under the given key.

Parameters
key:strThe attribute or dict key to set.
value:AnyThe value to store.
Returns
NoneNo value is returned.
def wantsJson(self) -> bool: (source)

Determine if the client prefers a JSON response based on the Accept header.

Returns
boolTrue if the Accept header indicates JSON is preferred, otherwise False.