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 VarDumper(IVarDumper): (source)

Constructor: VarDumper()

View In Hierarchy

Undocumented

Method __forceExit Terminate the program if the force exit flag is set.
Method __init__ Initialize the VarDumper instance with default configuration.
Method __makeConsole Create and return a configured Console instance for output formatting.
Method __makePanel Create a Rich Panel with a pretty-printed representation of the value.
Method __printLine Print a blank line to the console if requested.
Method __redirectOutput Redirect standard output and error streams temporarily.
Method __resolveCallerInfo Resolve and set the caller's module path and line number.
Method __storeClonedValue Clone the given value using deep copy and store its type information.
Method expandAll Set whether to expand all nested data structures.
Method forceExit Set whether to terminate the program after dumping.
Method lineNumber Set the line number for header display.
Method maxDepth Set the maximum depth for nested structures.
Method modulePath Set the module path to display in the header.
Method print Print the stored values in a formatted manner and return HTML output.
Method redirectOutput Set whether to temporarily restore stdout/stderr during output.
Method showIndex Set whether to display an index number for each argument.
Method showTypes Set whether to display the type of each argument in the panel title.
Method toHtml Generate the HTML representation of the dumped output.
Method value Add a value to be dumped.
Method values Receive and store multiple values to be dumped.
Instance Variable __args Undocumented
Instance Variable __console Undocumented
Instance Variable __expand_all Undocumented
Instance Variable __force_exit Undocumented
Instance Variable __last_index Undocumented
Instance Variable __line_number Undocumented
Instance Variable __max_depth Undocumented
Instance Variable __module_path Undocumented
Instance Variable __original_stderr Undocumented
Instance Variable __original_stdout Undocumented
Instance Variable __redirect_output Undocumented
Instance Variable __redirected_output Undocumented
Instance Variable __show_header Undocumented
Instance Variable __show_index Undocumented
Instance Variable __show_types Undocumented
def __forceExit(self): (source)

Terminate the program if the force exit flag is set.

If the internal force exit flag is True, terminate the program using os._exit(1) or sys.exit(1) depending on the redirect output flag.

Returns
NoneThis method does not return any value.
def __init__(self): (source)

Initialize the VarDumper instance with default configuration.

Sets up internal state for variable dumping, including display options, output formatting, and argument storage.

Returns
NoneThis method does not return a value.
def __makeConsole(self) -> Console: (source)

Create and return a configured Console instance for output formatting.

Returns
ConsoleA Console object with a custom theme for variable dumping and recording enabled.
def __makePanel(self, value: type[T], _type: str) -> Panel: (source)

Create a Rich Panel with a pretty-printed representation of the value.

Notes

Uses internal configuration for indentation, expansion, and panel width.

Parameters
value:type[T]Object to be pretty-printed inside the panel.
_type:strType name of the value for display in the panel title.
Returns
PanelRich Panel object displaying the formatted content.
def __printLine(self, *, insert_line: bool = False): (source)

Print a blank line to the console if requested.

Notes

Prints a blank line to the standard output if insert_line is True.

Parameters
insert_line:bool, optionalIf True, print a blank line. Default is False.
Returns
NoneThis method does not return a value.
def __redirectOutput(self): (source)

Redirect standard output and error streams temporarily.

If output redirection is enabled and not already redirected, this method saves the current stdout and stderr, then redirects them to the original system streams. If already redirected, it restores stdout and stderr to their previously saved values.

Returns
NoneThis method does not return a value.
def __resolveCallerInfo(self): (source)

Resolve and set the caller's module path and line number.

If the internal module path or line number is not set, this method uses the inspect module to retrieve the caller's frame and extract the relevant information. If the frame is unavailable, it sets default values.

Returns
NoneThis method does not return any value.
def __storeClonedValue(self, value: type[T]): (source)

Clone the given value using deep copy and store its type information.

Notes

The type information is obtained from the __name__ attribute of the value's type.

Parameters
value:type[T]Value to be cloned.
Returns
NoneThis method does not return a value.
def expandAll(self, *, expand: bool = True) -> VarDumper: (source)

Set whether to expand all nested data structures.

Parameters
expand:bool, optionalIf True, expands all nested data structures. Default is True.
Returns
VarDumperThe current instance with updated expand all setting.
def forceExit(self, *, force: bool = True) -> VarDumper: (source)

Set whether to terminate the program after dumping.

Parameters
force:bool, optionalIf True, the program will terminate after dumping. Default is True.
Returns
VarDumperReturns the current instance with the updated force exit setting.
Raises
TypeErrorIf 'force' is not of type bool.
def lineNumber(self, number: int | None) -> VarDumper: (source)

Set the line number for header display.

Parameters
number:int or NoneLine number to display in the header.
Returns
VarDumperReturns self with updated line number.
Raises
TypeErrorIf 'number' is not of type int or None.
def maxDepth(self, depth: int | None) -> VarDumper: (source)

Set the maximum depth for nested structures.

Parameters
depth:int or NoneMaximum depth for nested structures. None means unlimited.
Returns
VarDumperReturns self with updated max depth.
Raises
TypeErrorIf 'depth' is not int or None.
def modulePath(self, path: str | None) -> VarDumper: (source)

Set the module path to display in the header.

Parameters
path:str or NoneModule path to display in the header.
Returns
VarDumperReturns the current instance with updated module path.
Raises
TypeErrorIf 'path' is not of type str or None.
def print(self, *, insert_line: bool = False): (source)

Print the stored values in a formatted manner and return HTML output.

Optionally inserts a blank line before and after the output, resolves caller information, prints a header with module and line details, and displays each stored value in a styled panel. Handles optional output redirection and program termination.

Parameters
insert_line:bool, optionalIf True, insert a blank line before and after the output. Default is False.
Returns
NoneThis method does not return any value.
def redirectOutput(self, *, redirect: bool = True) -> VarDumper: (source)

Set whether to temporarily restore stdout/stderr during output.

Parameters
redirect:bool, optionalIf True, temporarily restores stdout and stderr to their original streams during output. Default is True.
Returns
VarDumperThe current instance with the updated redirect output setting.
Raises
TypeErrorIf 'redirect' is not of type bool.
def showIndex(self, *, show: bool = True) -> VarDumper: (source)

Set whether to display an index number for each argument.

Parameters
show:bool, optionalIf True, show an index number for each argument. Default is True.
Returns
VarDumperThe current instance with updated show index setting.
def showTypes(self, *, show: bool = True) -> VarDumper: (source)

Set whether to display the type of each argument in the panel title.

Parameters
show:bool, optionalIf True, display the type of each argument in the panel title. Default is True.
Returns
VarDumperThe current instance with updated show types setting.
def toHtml(self, *, insert_line: bool = False) -> str: (source)

Generate the HTML representation of the dumped output.

Notes

Calls the print method to prepare the output and then exports it with a light terminal palette and inline styles, so the dump is readable and self-contained when embedded in a page. The module and line header is omitted from the HTML output.

Parameters
insert_line:bool, optionalIf True, insert a blank line before and after the output. Default is False.
Returns
strHTML fragment containing the formatted dumped output.
def value(self, value: type[T]) -> VarDumper: (source)

Add a value to be dumped.

Notes

The value is deep-copied and stored internally for later output.

Parameters
value:type[T]The value to be stored for dumping.
Returns
VarDumperReturns the current instance for method chaining.
def values(self, *args: tuple | list) -> VarDumper: (source)

Receive and store multiple values to be dumped.

Parameters
*args:tupleValues to be dumped.
Returns
VarDumperReturns the current instance for method chaining.
Raises
TypeErrorIf 'args' is not of type tuple or list.

Undocumented

__console: Console = (source)

Undocumented

__expand_all: bool = (source)

Undocumented

__force_exit: bool = (source)

Undocumented

__last_index: int = (source)

Undocumented

__line_number: int | None = (source)

Undocumented

__max_depth: int | None = (source)

Undocumented

__module_path: str | None = (source)

Undocumented

__original_stderr: Any = (source)

Undocumented

__original_stdout: Any = (source)

Undocumented

__redirect_output: bool = (source)

Undocumented

__redirected_output: bool = (source)

Undocumented

__show_header: bool = (source)

Undocumented

__show_index: bool = (source)

Undocumented

__show_types: bool = (source)

Undocumented