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

class _JsonBody: (source)

Constructor: _JsonBody(limit)

View In Hierarchy

Write strict JSON directly into a size-limited buffer.

The byte budget also applies while escaping individual strings.

Method __init__ Allocate an empty buffer with a fixed byte ceiling.
Method append Append bytes only when they fit the remaining budget.
Method members Encode the members and delimiters of a JSON object or array.
Method string Write an escaped JSON string in bounded chunks.
Method visit Encode one JSON value within the depth and element limits.
Instance Variable count Number of JSON values visited during serialization.
Instance Variable limit Maximum number of bytes the buffer may hold.
Instance Variable output UTF-8 bytes accumulated during serialization.
def __init__(self, limit: int): (source)

Allocate an empty buffer with a fixed byte ceiling.

Parameters
limit:intMaximum byte count allowed for this operation.
Returns
NoneInitialize the output buffer and its byte and element counters.
def append(self, chunk: bytes): (source)

Append bytes only when they fit the remaining budget.

Parameters
chunk:bytesBytes to append to the output.
Returns
NoneExtend the output buffer by the accepted bytes.
def members(self, obj: dict | list, depth: int): (source)

Encode the members and delimiters of a JSON object or array.

Parameters
obj:dict | listContainer whose children are being serialized.
depth:intCurrent nesting level, counted from the root.
Returns
NoneAppend the container and its encoded children to the output buffer.
def string(self, value: str): (source)

Write an escaped JSON string in bounded chunks.

Parameters
value:strString whose escapes and quotes are written to the buffer.
Returns
NoneAppend the quoted UTF-8 representation to the output buffer.
def visit(self, item: object, depth: int): (source)

Encode one JSON value within the depth and element limits.

Parameters
item:objectJSON value at the current nesting level.
depth:intCurrent nesting level, counted from the root.
Returns
NoneAppend the encoded value to the output buffer.

Number of JSON values visited during serialization.

Maximum number of bytes the buffer may hold.

UTF-8 bytes accumulated during serialization.