Name Description Size
__init__.py Rich text and beautiful formatting in the terminal. 6066
__main__.py Get a renderable that demonstrates a number of features. 8333
_cell_widths.py 10209
_emoji_codes.py 140235
_emoji_replace.py Replace emoji code in text. 1064
_export_format.py \ <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style> {stylesheet} body {{ color: {foreground}; background-color: {background}; }} </style> </head> <body> <pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace"><code style="font-family:inherit">{code}</code></pre> </body> </html> 2128
_extension.py 241
_fileno.py Get fileno() from a file, accounting for poorly implemented file-like objects. Args: file_like (IO): A file-like object. Returns: int | None: The result of fileno if available, or None if operation failed. 799
_inspect.py Get the first paragraph from a docstring. 9655
_log_render.py 3213
_loop.py Iterate and generate a tuple with a flag for first value. 1236
_null_file.py 1394
_palettes.py 7063
_pick.py Pick the first non-none bool or return the last value. Args: *values (bool): Any number of boolean or None values. Returns: bool: First non-none boolean. 423
_ratio.py Any object that defines an edge (such as Layout). 5459
_spinners.py Spinners are from: * cli-spinners: MIT License Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19919
_stack.py A small shim over builtin list. 351
_timer.py Timer context manager, only used in debug. 417
_win32_console.py Light wrapper around the Win32 Console API - this module should only be imported on Windows The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions 22719
_windows.py Windows features available. 1901
_windows_renderer.py Makes appropriate Windows Console API calls based on the segments in the buffer. Args: buffer (Iterable[Segment]): Iterable of Segments to convert to Win32 API calls. term (LegacyWindowsTerm): Used to call the Windows Console API. 2759
_wrap.py Yields each word from the text as a tuple containing (start_index, end_index, word). A "word" in this context may include the actual word and any whitespace to the right. 3404
abc.py An abstract base class for Rich renderables. Note that there is no need to extend this class, the intended use is to check if an object supports the Rich renderable protocol. For example:: if isinstance(my_object, RichRenderable): console.print(my_object) 878
align.py Align a renderable by adding spaces if necessary. Args: renderable (RenderableType): A console renderable. align (AlignMethod): One of "left", "center", or "right"" style (StyleType, optional): An optional style to apply to the background. vertical (Optional[VerticalAlignMethod], optional): Optional vertical align, one of "top", "middle", or "bottom". Defaults to None. pad (bool, optional): Pad the right with spaces. Defaults to True. width (int, optional): Restrict contents to given width, or None to use default width. Defaults to None. height (int, optional): Set height of align renderable, or None to fit to contents. Defaults to None. Raises: ValueError: if ``align`` is not one of the expected values. 10421
ansi.py (?:\x1b[0-?])| (?:\x1b\](.*?)\x1b\\)| (?:\x1b([(@-Z\\-_]|\[[0-?]*[ -/]*[@-~])) 6921
bar.py Renders a solid block bar. Args: size (float): Value for the end of the bar. begin (float): Begin point (between 0 and size, inclusive). end (float): End point (between 0 and size, inclusive). width (int, optional): Width of the bar, or ``None`` for maximum width. Defaults to None. color (Union[Color, str], optional): Color of the bar. Defaults to "default". bgcolor (Union[Color, str], optional): Color of bar background. Defaults to "default". 3263
box.py Defines characters to render boxes. ┌─┬┐ top │ ││ head ├─┼┤ head_row │ ││ mid ├─┼┤ row ├─┼┤ foot_row │ ││ foot └─┴┘ bottom Args: box (str): Characters making up box. ascii (bool, optional): True if this box uses ascii characters only. Default is False. 10783
cells.py Get the number of cells required to display text. This method always caches, which may use up a lot of memory. It is recommended to use `cell_len` over this method. Args: text (str): Text to display. Returns: int: Get the number of cells required to display text. 5130
color.py One of the 3 color system supported by terminals. 18211
color_triplet.py The red, green, and blue components of a color. 1054
columns.py Display renderables in neat columns. Args: renderables (Iterable[RenderableType]): Any number of Rich renderables (including str). width (int, optional): The desired width of the columns, or None to auto detect. Defaults to None. padding (PaddingDimensions, optional): Optional padding around cells. Defaults to (0, 1). expand (bool, optional): Expand columns to full width. Defaults to False. equal (bool, optional): Arrange in to equal sized columns. Defaults to False. column_first (bool, optional): Align items from top to bottom (rather than left to right). Defaults to False. right_to_left (bool, optional): Start column from right hand side. Defaults to False. align (str, optional): Align value ("left", "right", or "center") or None for default. Defaults to None. title (TextType, optional): Optional title for Columns. 7131
console.py Size of the terminal. 100493
constrain.py Constrain the width of a renderable to a given number of characters. Args: renderable (RenderableType): A renderable object. width (int, optional): The maximum width (in characters) to render. Defaults to 80. 1288
containers.py A list subclass which renders its contents to the console. 5502
control.py A renderable that inserts a control code (non printable but may move cursor). Args: *codes (str): Positional arguments are either a :class:`~rich.segment.ControlType` enum or a tuple of ControlType and an integer parameter 6606
default_styles.py 8221
diagnose.py Print a report to the terminal with debugging information 950
emoji.py No emoji by that name. 2465
errors.py An error in console operation. 642
file_proxy.py Wraps a file (e.g. sys.stdout) and redirects writes to a console. 1683
filesize.py Functions for reporting filesizes. Borrowed from https://github.com/PyFilesystem/pyfilesystem2 The functions declared in this module should cover the different use cases needed to generate a string representation of a file size using several different units. Since there are many standards regarding file size units, three different functions have been implemented. See Also: * `Wikipedia: Binary prefix <https://en.wikipedia.org/wiki/Binary_prefix>`_ 2484
highlighter.py .*?(?<!\\) 9586
json.py A renderable which pretty prints JSON. Args: json (str): JSON encoded data. indent (Union[None, int, str], optional): Number of characters to indent by. Defaults to 2. highlight (bool, optional): Enable highlighting. Defaults to True. skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False. ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False. check_circular (bool, optional): Check for circular references. Defaults to True. allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True. default (Callable, optional): A callable that converts values that can not be encoded in to something that can be JSON encoded. Defaults to None. sort_keys (bool, optional): Sort dictionary keys. Defaults to False. 5019
jupyter.py \ <pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre> 3228
layout.py An individual layout render. 13944
live.py A thread that calls refresh() at regular intervals. 14270
live_render.py Creates a renderable that may be updated. Args: renderable (RenderableType): Any renderable object. style (StyleType, optional): An optional style to apply to the renderable. Defaults to "". 3654
logging.py A logging handler that renders output with Rich. The time / level / message and file are displayed in columns. The level is color coded, and the message is syntax highlighted. Note: Be careful when enabling console markup in log messages if you have configured logging for libraries not under your control. If a dependency writes messages containing square brackets, it may not produce the intended output. Args: level (Union[int, str], optional): Log level. Defaults to logging.NOTSET. console (:class:`~rich.console.Console`, optional): Optional console instance to write logs. Default will use a global console instance writing to stdout. show_time (bool, optional): Show a column for the time. Defaults to True. omit_repeated_times (bool, optional): Omit repetition of the same time. Defaults to True. show_level (bool, optional): Show a column for the level. Defaults to True. show_path (bool, optional): Show the path to the original log call. Defaults to True. enable_link_path (bool, optional): Enable terminal link of path column to file. Defaults to True. highlighter (Highlighter, optional): Highlighter to style log messages, or None to use ReprHighlighter. Defaults to None. markup (bool, optional): Enable console markup in log messages. Defaults to False. rich_tracebacks (bool, optional): Enable rich tracebacks with syntax highlighting and formatting. Defaults to False. tracebacks_width (Optional[int], optional): Number of characters used to render tracebacks, or None for full width. Defaults to None. tracebacks_code_width (int, optional): Number of code characters used to render tracebacks, or None for full width. Defaults to 88. tracebacks_extra_lines (int, optional): Additional lines of code to render tracebacks, or None for full width. Defaults to None. tracebacks_theme (str, optional): Override pygments theme used in traceback. tracebacks_word_wrap (bool, optional): Enable word wrapping of long tracebacks lines. Defaults to True. tracebacks_show_locals (bool, optional): Enable display of locals in tracebacks. Defaults to False. tracebacks_suppress (Sequence[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback. tracebacks_max_frames (int, optional): Optional maximum number of frames returned by traceback. locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to 10. locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80. log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%x %X] ". keywords (List[str], optional): List of words to highlight instead of ``RichHandler.KEYWORDS``. 12446
markdown.py Factory to create markdown element, Args: markdown (Markdown): The parent Markdown object. token (Token): A node from markdown-it. Returns: MarkdownElement: A new markdown element 25969
markup.py ((\\*)\[([a-z#/@][^[]*?)]) 8427
measure.py Stores the minimum and maximum widths (in characters) required to render an object. 5305
padding.py Draw space around content. Example: >>> print(Padding("Hello", (2, 4), style="on blue")) Args: renderable (RenderableType): String or other renderable. pad (Union[int, Tuple[int]]): Padding for top, right, bottom, and left borders. May be specified with 1, 2, or 4 integers (CSS style). style (Union[str, Style], optional): Style for padding characters. Defaults to "none". expand (bool, optional): Expand padding to fit available width. Defaults to True. 4896
pager.py Base class for a pager. 828
palette.py A palette of available colors. 3288
panel.py A console renderable that draws a border around its contents. Example: >>> console.print(Panel("Hello, World!")) Args: renderable (RenderableType): A console renderable object. box (Box): A Box instance that defines the look of the border (see :ref:`appendix_box`. Defaults to box.ROUNDED. title (Optional[TextType], optional): Optional title displayed in panel header. Defaults to None. title_align (AlignMethod, optional): Alignment of title. Defaults to "center". subtitle (Optional[TextType], optional): Optional subtitle displayed in panel footer. Defaults to None. subtitle_align (AlignMethod, optional): Alignment of subtitle. Defaults to "center". safe_box (bool, optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True. expand (bool, optional): If True the panel will stretch to fill the console width, otherwise it will be sized to fit the contents. Defaults to True. style (str, optional): The style of the panel (border and contents). Defaults to "none". border_style (str, optional): The style of the border. Defaults to "none". width (Optional[int], optional): Optional width of panel. Defaults to None to auto-detect. height (Optional[int], optional): Optional height of panel. Defaults to None to auto-detect. padding (Optional[PaddingDimensions]): Optional padding around renderable. Defaults to 0. highlight (bool, optional): Enable automatic highlighting of panel title (if str). Defaults to False. 11225
pretty.py Check if an object was created with attrs module. 36355
progress.py A thread to periodically update progress. 60333
progress_bar.py Renders a (progress) bar. Used by rich.progress. Args: total (float, optional): Number of steps in the bar. Defaults to 100. Set to None to render a pulsing animation. completed (float, optional): Number of steps completed. Defaults to 0. width (int, optional): Width of the bar, or ``None`` for maximum width. Defaults to None. pulse (bool, optional): Enable pulse effect. Defaults to False. Will pulse if a None total was passed. style (StyleType, optional): Style for the bar background. Defaults to "bar.back". complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete". finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished". pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse". animation_time (Optional[float], optional): Time in seconds to use for animation, or None to use system time. 8162
prompt.py Exception base class for prompt related errors. 12435
protocol.py aihwerij235234ljsdnp34ksodfipwoe234234jlskjdf 1367
py.typed 0
region.py Defines a rectangular region of the screen. 166
repr.py An error occurred when attempting to build a repr. 4419
rule.py A console renderable to draw a horizontal rule (line). Args: title (Union[str, Text], optional): Text to render in the rule. Defaults to "". characters (str, optional): Character(s) used to draw the line. Defaults to "─". style (StyleType, optional): Style of Rule. Defaults to "rule.line". end (str, optional): Character at end of Rule. defaults to "\\\\n" align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center". 4590
scope.py Render python variables in a given scope. Args: scope (Mapping): A mapping containing variable names and values. title (str, optional): Optional title. Defaults to None. sort_keys (bool, optional): Enable sorting of items. Defaults to True. indent_guides (bool, optional): Enable indentation guides. Defaults to False. max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to None. max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None. Returns: ConsoleRenderable: A renderable object. 2831
screen.py A renderable that fills the terminal screen and crops excess. Args: renderable (RenderableType): Child renderable. style (StyleType, optional): Optional background style. Defaults to None. 1579
segment.py Non-printable control codes which typically translate to ANSI codes. 24707
spinner.py A spinner animation. Args: name (str): Name of spinner (run python -m rich.spinner). text (RenderableType, optional): A renderable to display at the right of the spinner (str or Text typically). Defaults to "". style (StyleType, optional): Style for spinner animation. Defaults to None. speed (float, optional): Speed factor for animation. Defaults to 1.0. Raises: KeyError: If name isn't one of the supported spinner animations. 4364
status.py Displays a status indicator with a 'spinner' animation. Args: status (RenderableType): A status renderable (str or Text typically). console (Console, optional): Console instance to use, or None for global console. Defaults to None. spinner (str, optional): Name of spinner animation (see python -m rich.spinner). Defaults to "dots". spinner_style (StyleType, optional): Style of spinner. Defaults to "status.spinner". speed (float, optional): Speed factor for spinner animation. Defaults to 1.0. refresh_per_second (float, optional): Number of refreshes per second. Defaults to 12.5. 4424
style.py A descriptor to get/set a style attribute bit. 27059
styled.py Apply a style to a renderable. Args: renderable (RenderableType): Any renderable. style (StyleType): A style to apply across the entire renderable. 1234
syntax.py Base class for a syntax theme. 35655
table.py Defines a column within a ~Table. Args: title (Union[str, Text], optional): The title of the table rendered at the top. Defaults to None. caption (Union[str, Text], optional): The table caption rendered below. Defaults to None. width (int, optional): The width in characters of the table, or ``None`` to automatically fit. Defaults to None. min_width (Optional[int], optional): The minimum width of the table, or ``None`` for no minimum. Defaults to None. box (box.Box, optional): One of the constants in box.py used to draw the edges (see :ref:`appendix_box`), or ``None`` for no box lines. Defaults to box.HEAVY_HEAD. safe_box (Optional[bool], optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True. padding (PaddingDimensions, optional): Padding for cells (top, right, bottom, left). Defaults to (0, 1). collapse_padding (bool, optional): Enable collapsing of padding around cells. Defaults to False. pad_edge (bool, optional): Enable padding of edge cells. Defaults to True. expand (bool, optional): Expand the table to fit the available space if ``True``, otherwise the table width will be auto-calculated. Defaults to False. show_header (bool, optional): Show a header row. Defaults to True. show_footer (bool, optional): Show a footer row. Defaults to False. show_edge (bool, optional): Draw a box around the outside of the table. Defaults to True. show_lines (bool, optional): Draw lines between every row. Defaults to False. leading (int, optional): Number of blank lines between rows (precludes ``show_lines``). Defaults to 0. style (Union[str, Style], optional): Default style for the table. Defaults to "none". row_styles (List[Union, str], optional): Optional list of row styles, if more than one style is given then the styles will alternate. Defaults to None. header_style (Union[str, Style], optional): Style of the header. Defaults to "table.header". footer_style (Union[str, Style], optional): Style of the footer. Defaults to "table.footer". border_style (Union[str, Style], optional): Style of the border. Defaults to None. title_style (Union[str, Style], optional): Style of the title. Defaults to None. caption_style (Union[str, Style], optional): Style of the caption. Defaults to None. title_justify (str, optional): Justify method for title. Defaults to "center". caption_justify (str, optional): Justify method for caption. Defaults to "center". highlight (bool, optional): Highlight cell contents (if str). Defaults to False. 40025
terminal_theme.py A color theme used when exporting console content. Args: background (Tuple[int, int, int]): The background color. foreground (Tuple[int, int, int]): The foreground (text) color. normal (List[Tuple[int, int, int]]): A list of 8 normal intensity colors. bright (List[Tuple[int, int, int]], optional): A list of 8 bright colors, or None to repeat normal intensity. Defaults to None. 3370
text.py A plain string or a :class:`Text` instance. 47540
theme.py A container for style information, used by :class:`~rich.console.Console`. Args: styles (Dict[str, Style], optional): A mapping of style names on to styles. Defaults to None for a theme with no styles. inherit (bool, optional): Inherit default styles. Defaults to True. 3771
themes.py 102
traceback.py Yield start and end positions per line. Args: start: Start position. end: End position. Returns: Iterable of (LINE, COLUMN1, COLUMN2). 35098
tree.py A renderable for a tree structure. Attributes: ASCII_GUIDES (GuideType): Guide lines used when Console.ascii_only is True. TREE_GUIDES (List[GuideType, GuideType, GuideType]): Default guide lines. Args: label (RenderableType): The renderable or str for the tree label. style (StyleType, optional): Style of this tree. Defaults to "tree". guide_style (StyleType, optional): Style of the guide lines. Defaults to "tree.line". expanded (bool, optional): Also display children. Defaults to True. highlight (bool, optional): Highlight renderable (if str). Defaults to False. hide_root (bool, optional): Hide the root node. Defaults to False. 9391