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.
Format Python values for structured console inspection.
| Method | __force |
Terminate the program if the force exit flag is set. |
| Method | __init__ |
Initialize the VarDumper instance with default configuration. |
| Method | __make |
Create and return a configured Console instance for output formatting. |
| Method | __make |
Create a Rich Panel with a pretty-printed representation of the value. |
| Method | __make |
Format a value consistently for terminal and HTML output. |
| Method | __print |
Print a blank line to the console if requested. |
| Method | __redirect |
Redirect standard output and error streams temporarily. |
| Method | __render |
Render the stored values to the selected console without exiting. |
| Method | __resolve |
Resolve and set the caller's module path and line number. |
| Method | __store |
Clone the given value using deep copy and store its type information. |
| Method | expand |
Set whether to expand all nested data structures. |
| Method | force |
Set whether to terminate the program after dumping. |
| Method | line |
Set the line number for header display. |
| Method | max |
Set the maximum depth for nested structures. |
| Method | module |
Set the module path to display in the header. |
| Method | print |
Print the stored values to the console in a formatted manner. |
| Method | redirect |
Set whether to temporarily restore stdout/stderr during output. |
| Method | show |
Set whether to display an index number for each argument. |
| Method | show |
Set whether to display the type of each argument in the panel title. |
| Method | to |
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 |
Store the arguments to be dumped. |
| Instance Variable | __console |
Create a Console instance for output formatting. |
| Instance Variable | __expand |
Set whether to expand all nested structures. |
| Instance Variable | __force |
Set whether to force program exit after dumping. |
| Instance Variable | __html |
Current line number used when rendering inspected values as HTML. |
| Instance Variable | __html |
HTML capture must not replace the terminal's module header. |
| Instance Variable | __last |
Initialize the last index for tracking. |
| Instance Variable | __line |
Store the line number for display in the header. |
| Instance Variable | __max |
Set the maximum depth for nested structures; None means unlimited. |
| Instance Variable | __module |
Store the module path for display in the header. |
| Instance Variable | __original |
Standard-error stream restored after temporary redirection. |
| Instance Variable | __original |
Standard-output stream restored after temporary redirection. |
| Instance Variable | __redirect |
Set whether to redirect output streams during dumping. |
| Instance Variable | __redirected |
Redirected output flag used by VarDumper. |
| Instance Variable | __show |
Set whether to show index numbers in output. |
| Instance Variable | __show |
Set whether to show types in output. |
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 | |
None | This method does not return any value. |
Initialize the VarDumper instance with default configuration.
Sets up internal state for variable dumping, including display options, output formatting, and argument storage.
| Returns | |
None | This method does not return a value. |
Create and return a configured Console instance for output formatting.
| Parameters | |
file:typing.TextIO or None, optional | Output stream; None uses the terminal's standard output. |
| Returns | |
orionis.console.Console | A Console object with a custom theme for variable dumping and recording enabled. |
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[orionis.console.output.var_dumper.T] | Object to be pretty-printed inside the panel. |
_type:str | Type name of the value for display in the panel title. |
console:orionis.console.Console | Console whose width is used to size the panel. |
| Returns | |
rich.panel.Panel | Rich Panel object displaying the formatted content. |
Format a value consistently for terminal and HTML output.
| Parameters | |
value:object | Stored value to format. |
| Returns | |
rich.pretty.Pretty | Value formatted with the configured expansion and depth. |
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 | |
None | This method does not return a value. |
Render the stored values to the selected console without exiting.
| Parameters | |
console:orionis.console.Console | Destination for the formatted output. |
showbool | Whether to include the caller's module and line. |
| Returns | |
None | Write the formatted values to the selected console. |
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.
| Parameters | |
html:bool, optional | Capture the filename separately from the terminal's module name. |
| Returns | |
None | This method does not return any value. |
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[orionis.console.output.var_dumper.T] | Value to be cloned. |
| Returns | |
None | This method does not return a value. |
Set whether to expand all nested data structures.
| Parameters | |
expand:bool, optional | If True, expands all nested data structures. Default is True. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | The current instance with updated expand all setting. |
Set whether to terminate the program after dumping.
| Parameters | |
force:bool, optional | If True, the program will terminate after dumping. Default is True. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | Returns the current instance with the updated force exit setting. |
| Raises | |
TypeError | If 'force' is not of type bool. |
Set the line number for header display.
| Parameters | |
number:int or None | Line number to display in the header. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | Returns self with updated line number. |
| Raises | |
TypeError | If 'number' is not of type int or None. |
Set the maximum depth for nested structures.
| Parameters | |
depth:int or None | Maximum depth for nested structures. None means unlimited. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | Returns self with updated max depth. |
| Raises | |
TypeError | If 'depth' is not int or None. |
Set the module path to display in the header.
| Parameters | |
path:str or None | Module path to display in the header. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | Returns the current instance with updated module path. |
| Raises | |
TypeError | If 'path' is not of type str or None. |
Print the stored values to the console in a formatted manner.
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 | |
insertbool, optional | If True, insert a blank line before and after the output. Default is False. |
| Returns | |
None | This method does not return any value. |
Set whether to temporarily restore stdout/stderr during output.
| Parameters | |
redirect:bool, optional | If True, temporarily restores stdout and stderr to their original streams during output. Default is True. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | The current instance with the updated redirect output setting. |
| Raises | |
TypeError | If 'redirect' is not of type bool. |
Set whether to display an index number for each argument.
| Parameters | |
show:bool, optional | If True, show an index number for each argument. Default is True. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | The current instance with updated show index setting. |
Set whether to display the type of each argument in the panel title.
| Parameters | |
show:bool, optional | If True, display the type of each argument in the panel title. Default is True. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | The current instance with updated show types setting. |
Generate the HTML representation of the dumped output.
Notes
Renders to an isolated in-memory console and exports with a light diagnostic palette and native HTML panels with inline styles. Does not write to stdout or stderr, redirect streams, or terminate execution, regardless of console options. Panel headers show the source filename and line, using configured values or the first HTML export's caller. HTML source metadata and indices do not affect terminal output.
| Parameters | |
insertbool, optional | If True, insert a blank line before and after the output. Default is False. |
| Returns | |
str | HTML fragment containing the formatted dumped output. |
Add a value to be dumped.
Notes
The value is deep-copied and stored internally for later output.
| Parameters | |
value:type[orionis.console.output.var_dumper.T] | The value to be stored for dumping. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | Returns the current instance for method chaining. |
Receive and store multiple values to be dumped.
| Parameters | |
*args:tuple | Values to be dumped. |
| Returns | |
orionis.console.output.var_dumper.VarDumper | Returns the current instance for method chaining. |
| Raises | |
TypeError | If 'args' is not of type tuple or list. |