rs_rich¶
Generated from the type stubs by scripts/gen_python_api.py; do not edit.
Rich-compatible terminal rendering, backed by the rs-rich Rust port.
Every class here is implemented in Rust (rs_rich._native); these modules
only re-export them under Rich's module paths, so a program can move from
rich by changing its imports. See the supported surface in the README.
Console ¶
print ¶
print(*objects: Any, sep: str = ' ', end: str = '\n', style: Optional[StyleType] = None, justify: Optional[JustifyMethod] = None, overflow: Optional[OverflowMethod] = None, no_wrap: Optional[bool] = None, emoji: Optional[bool] = None, markup: Optional[bool] = None, highlight: Optional[bool] = None, width: Optional[int] = None, height: Optional[int] = None, crop: bool = True, soft_wrap: Optional[bool] = None, new_line_start: bool = False) -> None
out ¶
out(*objects: Any, sep: str = ' ', end: str = '\n', style: Optional[StyleType] = None, highlight: Optional[bool] = None) -> None
log ¶
log(*objects: Any, sep: str = ' ', end: str = '\n', style: Optional[StyleType] = None, justify: Optional[JustifyMethod] = None, emoji: Optional[bool] = None, markup: Optional[bool] = None, highlight: Optional[bool] = None, log_locals: bool = False, _stack_offset: int = 1) -> None
rule ¶
rule(title: str = '', *, characters: str = '─', style: Optional[StyleType] = None, align: AlignMethod = 'center') -> None
update_screen ¶
update_screen(renderable: RenderableType, *, region: Optional[Tuple[int, int, int, int]] = None, options: Optional[ConsoleOptions] = None) -> None
update_screen_lines ¶
input ¶
input(prompt: Union[str, Text, None] = None, *, markup: bool = True, emoji: bool = True, password: bool = False, stream: Optional[IO[str]] = None) -> str
print_json ¶
print_json(json: Optional[str] = None, *, data: Any = None, indent: Union[None, int, str] = 2, highlight: bool = True, skip_keys: bool = False, ensure_ascii: bool = False, check_circular: bool = True, allow_nan: bool = True, default: Optional[Callable[[Any], Any]] = None, sort_keys: bool = False) -> None
measure ¶
render ¶
render_lines ¶
render_lines(renderable: RenderableType, options: Optional[ConsoleOptions] = None, *, style: Optional[StyleType] = None, pad: bool = True, new_lines: bool = False) -> List[List[Segment]]
render_str ¶
render_str(text: str, *, style: Optional[StyleType] = None, justify: Optional[JustifyMethod] = None, overflow: Optional[OverflowMethod] = None, emoji: Optional[bool] = None, markup: Optional[bool] = None, highlight: Optional[bool] = None) -> Text
export_html ¶
export_html(*, theme: Optional[TerminalTheme] = None, clear: bool = True, code_format: Optional[str] = None, inline_styles: bool = False) -> str
save_html ¶
save_html(path: str, *, theme: Optional[TerminalTheme] = None, clear: bool = True, code_format: Optional[str] = None, inline_styles: bool = False) -> None
export_svg ¶
export_svg(*, title: str = 'Rich', theme: Optional[TerminalTheme] = None, clear: bool = True, code_format: Optional[str] = None, font_aspect_ratio: float = 0.61, unique_id: Optional[str] = None) -> str
save_svg ¶
save_svg(path: str, *, title: str = 'Rich', theme: Optional[TerminalTheme] = None, clear: bool = True, code_format: Optional[str] = None, font_aspect_ratio: float = 0.61, unique_id: Optional[str] = None) -> None
get_console ¶
The global console rs_rich.print writes to, created on first use.
reconfigure ¶
rich.reconfigure: replace the global console with Console(**kwargs).
Rich changes the existing console in place; rs_rich's native console
cannot be, so get_console() returns a new object afterwards.
print ¶
print(*objects: Any, sep: str = ' ', end: str = '\n', file: Optional[IO[str]] = None, flush: bool = False) -> None
rich.print: print objects to the global console (or to file).
print_json ¶
rich.print_json: pretty-print JSON on the global console.
inspect ¶
rich.inspect: provided by _native.inspect once the code area adds it.