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

Adapt a Granian RSGI scope to the transport adapter contract.

Returns
NoneThis class exposes request data accessors and state overrides.
Method __buildHeadersRSGI Build headers from the scope and cache them.
Method __contains__ Check whether a state key exists.
Method __delitem__ Remove a state value by key.
Method __getitem__ Return a cached state value by key.
Method __init__ Initialize the adapter with a Granian RSGI scope.
Method __setitem__ Store a state value under a key.
Method client Return the remote client IP parsed from the scope.
Method getScope Build and return a dictionary view of the request scope.
Method headers Return parsed request headers.
Method method Return the HTTP method.
Method path Return the request path.
Method scheme Return the request scheme.
Method setClient Set the remote client IP in the override state.
Method setScheme Set the request scheme in the override state.
Method setState Store a custom value in the override state.
Method wantsJson Determine whether the request prefers a JSON response.
Class Variable __slots__ Undocumented
Instance Variable __client Undocumented
Instance Variable __headers Undocumented
Instance Variable __overrides Undocumented
Instance Variable __scope Undocumented
Instance Variable __wants_json Undocumented
def __buildHeadersRSGI(self) -> Headers: (source)

Build headers from the scope and cache them.

Returns
HeadersReturn parsed headers as lowercase name/value pairs.
def __contains__(self, key: str) -> bool: (source)

Check whether a state key exists.

Parameters
key:strThe key to check for existence in the cache.
Returns
boolReturn True when the key exists, otherwise False.
def __delitem__(self, key: str): (source)

Remove a state value by key.

Parameters
key:strThe key to remove from the cache.
Returns
NoneReturn None after removing the key when present.
def __getitem__(self, key: str) -> object | None: (source)

Return a cached state value by key.

Parameters
key:strThe key to look up in the cache.
Returns
object | NoneReturn the stored value when present, otherwise None.
def __init__(self, scope: Scope): (source)

Initialize the adapter with a Granian RSGI scope.

Parameters
scope:ScopeThe Granian RSGI scope object.
Returns
NoneReturn None after preparing internal caches and state.
def __setitem__(self, key: str, value: object): (source)

Store a state value under a key.

Parameters
key:strThe key under which to store the value.
value:objectThe value to store in the cache.
Returns
NoneReturn None after writing the value.
def client(self) -> str | None: (source)

Return the remote client IP parsed from the scope.

Returns
str | NoneReturn the client IP without IPv6 brackets, or None when unavailable.
def getScope(self) -> dict: (source)

Build and return a dictionary view of the request scope.

Returns
dictReturn base scope fields merged with override values.
def headers(self) -> Headers: (source)

Return parsed request headers.

Returns
HeadersReturn the cached Headers instance built at initialization.
def method(self) -> str | None: (source)

Return the HTTP method.

Returns
str | NoneReturn the override value when set, else the scope method.
def path(self) -> str | None: (source)

Return the request path.

Returns
str | NoneReturn the scope path value, which can be None.
def scheme(self) -> str | None: (source)

Return the request scheme.

Returns
str | NoneReturn the override value when set, else the scope scheme.
def setClient(self, ip: str): (source)

Set the remote client IP in the override state.

Parameters
ip:strThe client IP address to assign.
Returns
NoneReturn None after updating the cached client value.
def setScheme(self, value: str): (source)

Set the request scheme in the override state.

Parameters
value:strThe scheme to apply (e.g. 'http', 'https').
Returns
NoneReturn None after storing the scheme override.
def setState(self, key: str, value: Any): (source)

Store a custom value in the override state.

Parameters
key:strThe attribute name to set.
value:AnyThe value to store.
Returns
NoneReturn None after writing the state entry.
def wantsJson(self) -> bool: (source)

Determine whether the request prefers a JSON response.

Returns
boolReturn True when the Accept header indicates JSON support.
__client: Any = (source)

Undocumented

Undocumented

__overrides: dict[str, Any] = (source)

Undocumented

__scope: Scope = (source)

Undocumented

__wants_json: Any = (source)

Undocumented