rich Documentation

Rich is a Python library for rich text and beautiful formatting in the terminal.

RAW Doc

1. Project Overview & Quickstart (Textualize/rich)

File: README.md




English readme
• 简体中文 readme
• 正體中文 readme
• Lengua española readme
• Deutsche readme
• Läs på svenska
• 日本語 readme
• 한국어 readme
• Français readme
• Schwizerdütsch readme
• हिन्दी readme
• Português brasileiro readme
• Italian readme
• Русский readme
• Indonesian readme
• فارسی readme
• Türkçe readme
• Polskie readme

Rich is a Python library for rich text and beautiful formatting in the terminal.

The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box.

For a video introduction to Rich see calmcode.io by @fishnets88.

See what people are saying about Rich.

Compatibility

Rich works with Linux, macOS and Windows. True color / emoji works with new Windows Terminal, classic terminal is limited to 16 colors. Rich requires Python 3.8 or later.

Rich works with Jupyter notebooks with no additional configuration required.

Installing

Install with pip or your favorite PyPI package manager.

sh
python -m pip install rich

Run the following to test Rich output on your terminal:

sh
python -m rich

Rich Print

To effortlessly add rich output to your application, you can import the rich print method, which has the same signature as the builtin Python function. Try this:

python
from rich import print

print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals())

Rich REPL

Rich can be installed in the Python REPL, so that any data structures will be pretty printed and highlighted.

python
>>> from rich import pretty
>>> pretty.install()

Using the Console

For more control over rich terminal content, import and construct a Console object.

python
from rich.console import Console

console = Console()

The Console object has a print method which has an intentionally similar interface to the builtin print function. Here's an example of use:

python
console.print("Hello", "World!")

As you might expect, this will print "Hello World!" to the terminal. Note that unlike the builtin print function, Rich will word-wrap your text to fit within the terminal width.

There are a few ways of adding color and style to your output. You can set a style for the entire output by adding a style keyword argument. Here's an example:

python
console.print("Hello", "World!", style="bold red")

The output will be something like the following:

That's fine for styling a line of text at a time. For more finely grained styling, Rich renders a special markup which is similar in syntax to bbcode. Here's an example:

python
console.print("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/i].")

You can use a Console object to generate sophisticated output with minimal effort. See the Console API docs for details.

Rich Inspect

Rich has an inspect function which can produce a report on any Python object, such as class, instance, or builtin.

python
>>> my_list = ["foo", "bar"]
>>> from rich import inspect
>>> inspect(my_list, methods=True)

See the inspect docs for details.

Rich Library

Rich contains a number of builtin renderables you can use to create elegant output in your CLI and help you debug your code.

Click the following headings for details:

Log

The Console object has a log() method which has a similar interface to print(), but also renders a column for the current time and the file and line which made the call. By default Rich will do syntax highlighting for Python structures and for repr strings. If you log a collection (i.e. a dict or a list) Rich will pretty print it so that it fits in the available space. Here's an example of some of these features.

python
from rich.console import Console
console = Console()

test_data = [
    {"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",},
    {"jsonrpc": "2.0", "method": "notify_hello", "params": [7]},
    {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"},
]

def test_log():
    enabled = False
    context = {
        "foo": "bar",
    }
    movies = ["Deadpool", "Rise of the Skywalker"]
    console.log("Hello from", console, "!")
    console.log(test_data, log_locals=True)


test_log()

The above produces the following output:

Note the log_locals argument, which outputs a table containing the local variables where the log method was called.

The log method could be used for logging to the terminal for long running applications such as servers, but is also a very nice debugging aid.

Logging Handler

You can also use the builtin Handler class to format and colorize output from Python's logging module. Here's an example of the output:

Emoji

To insert an emoji in to console output place the name between two colons. Here's an example:

python
>>> console.print(":smiley: :vampire: :pile_of_poo: :thumbs_up: :raccoon:")
😃 🧛 💩 👍 🦝

Please use this feature wisely.

Tables

Rich can render flexible tables with unicode box characters. There is a large variety of formatting options for borders, styles, cell alignment etc.

The animation above was generated with table_movie.py in the examples directory.

Here's a simpler table example:

python
from rich.console import Console
from rich.table import Table

console = Console()

table = Table(show_header=True, header_style="bold magenta")
table.add_column("Date", style="dim", width=12)
table.add_column("Title")
table.add_column("Production Budget", justify="right")
table.add_column("Box Office", justify="right")
table.add_row(
    "Dec 20, 2019", "Star Wars: The Rise of Skywalker", "$275,000,000", "$375,126,118"
)
table.add_row(
    "May 25, 2018",
    "[red]Solo[/red]: A Star Wars Story",
    "$275,000,000",
    "$393,151,347",
)
table.add_row(
    "Dec 15, 2017",
    "Star Wars Ep. VIII: The Last Jedi",
    "$262,000,000",
    "[bold]$1,332,539,889[/bold]",
)

console.print(table)

This produces the following output:

Note that console markup is rendered in the same way as print() and log(). In fact, anything that is renderable by Rich may be included in the headers / rows (even other tables).

The Table class is smart enough to resize columns to fit the available width of the terminal, wrapping text as required. Here's the same example, with the terminal made smaller than the table above:

Progress Bars

Rich can render multiple flicker-free progress bars to track long-running tasks.

For basic usage, wrap any sequence in the track function and iterate over the result. Here's an example:

python
from rich.progress import track

for step in track(range(100)):
    do_step(step)

It's not much harder to add multiple progress bars. Here's an example taken from the docs:

The columns may be configured to show any details you want. Built-in columns include percentage complete, file size, file speed, and time remaining. Here's another example showing a download in progress:

To try this out yourself, see examples/downloader.py which can download multiple URLs simultaneously while displaying progress.

Status

For situations where it is hard to calculate progress, you can use the status method which will display a 'spinner' animation and message. The animation won't prevent you from using the console as normal. Here's an example:

python
from time import sleep
from rich.console import Console

console = Console()
tasks = [f"task {n}" for n in range(1, 11)]

with console.status("[bold green]Working on tasks...") as status:
    while tasks:
        task = tasks.pop(0)
        sleep(1)
        console.log(f"{task} complete")

This generates the following output in the terminal.

The spinner animations were borrowed from cli-spinners. You can select a spinner by specifying the spinner parameter. Run the following command to see the available values:

text
python -m rich.spinner

The above command generates the following output in the terminal:

Tree

Rich can render a tree with guide lines. A tree is ideal for displaying a file structure, or any other hierarchical data.

The labels of the tree can be simple text or anything else Rich can render. Run the following for a demonstration:

text
python -m rich.tree

This generates the following output:

See the tree.py example for a script that displays a tree view of any directory, similar to the linux tree command.

Columns

Rich can render content in neat columns with equal or optimal width. Here's a very basic clone of the (MacOS / Linux) ls command which displays a directory listing in columns:

python
import os
import sys

from rich import print
from rich.columns import Columns

directory = os.listdir(sys.argv[1])
print(Columns(directory))

The following screenshot is the output from the columns example which displays data pulled from an API in columns:

Markdown

Rich can render markdown and does a reasonable job of translating the formatting to the terminal.

To render markdown import the Markdown class and construct it with a string containing markdown code. Then print it to the console. Here's an example:

python
from rich.console import Console
from rich.markdown import Markdown

console = Console()
with open("README.md") as readme:
    markdown = Markdown(readme.read())
console.print(markdown)

This will produce output something like the following:

Syntax Highlighting

Rich uses the pygments library to implement syntax highlighting. Usage is similar to rendering markdown; construct a Syntax object and print it to the console. Here's an example:

python
from rich.console import Console
from rich.syntax import Syntax

my_code = '''
def iter_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]:
    """Iterate and generate a tuple with a flag for first and last value."""
    iter_values = iter(values)
    try:
        previous_value = next(iter_values)
    except StopIteration:
        return
    first = True
    for value in iter_values:
        yield first, False, previous_value
        first = False
        previous_value = value
    yield first, True, previous_value
'''
syntax = Syntax(my_code, "python", theme="monokai", line_numbers=True)
console = Console()
console.print(syntax)

This will produce the following output:

Tracebacks

Rich can render beautiful tracebacks which are easier to read and show more code than standard Python tracebacks. You can set Rich as the default traceback handler so all uncaught exceptions will be rendered by Rich.

Here's what it looks like on OSX (similar on Linux):

All Rich renderables make use of the Console Protocol, which you can also use to implement your own Rich content.

Rich CLI

See also Rich CLI for a command line application powered by Rich. Syntax highlight code, render markdown, display CSVs in tables, and more, directly from the command prompt.

Textual

See also Rich's sister project, Textual, which you can use to build sophisticated User Interfaces in the terminal.

Toad

Toad is a unified interface for agentic coding. Built with Rich and Textual.


File: benchmarks/README.md

Benchmarking Rich

This directory contains benchmarks, for monitoring the performance of Rich over time.

View the benchmark dashboard here.

The benchmarks use a tool called Airspeed Velocity (asv),
and we've configured it in asv.conf.json.

Running Benchmarks

We strongly recommend running asv run --help for a full list of options, but
here are some common actions:

  • You can run the benchmarks against the master branch with asv run.
  • To test the most recent commit on your branch asv run HEAD^!.
  • To generate a static website for browsing the results, run asv publish. The resulting HTML can be found in benchmarks/html.

The asv docs have some more examples here.

Updating the Benchmark Website

  1. Ensure any tags you wish to benchmark are included in the file asvhashfile at the root of the repo.
  2. Run the benchmarks for those tags by running asv run HASHFILE:asvhashfile. This will take several minutes.
  3. Create the HTML locally for those benchmarks by running asv publish.
  4. Run asv preview to launch a local webserver that will let you preview the benchmarks dashboard. Navigate to the URL this command gives you and check everything looks fine.
  5. Checkout the rich-benchmarks repo from here and cd into it.
  6. Copy the HTML you generated earlier into the root of this repo, e.g. cp -r ../rich/benchmarks/html/* . (assuming you checked out rich-benchmarks alongside rich in your filesystem)
  7. When the HTML is merged into main, the benchmark dashboard will be updated automatically via a GitHub Action.

File: docs/source/appendix/box.rst

.. _appendix_box:

Box

Rich has a number of constants that set the box characters used to draw tables and panels. To select a box style import one of the constants below from rich.box. For example::

text
from rich import box
table = Table(box=box.SQUARE)

.. note::
Some of the box drawing characters will not display correctly on Windows legacy terminal (cmd.exe) with raster fonts, and are disabled by default. If you want the full range of box options on Windows legacy terminal, use a truetype font and set the safe_box parameter on the Table class to False.

The following table is generated with this command::

text
python -m rich.box

.. image:: ../../images/box.svg


File: docs/source/appendix/colors.rst

.. _appendix-colors:

Standard Colors

The following is a list of the standard 8-bit colors supported in terminals.

Note that the first 16 colors are generally defined by the system or your terminal software, and may not display exactly as rendered here.

.. raw:: html

text
╔════════════╤════════╤═══════════════════════╤═════════╤══════════════════╗
║ Color      │ Number │ Name                  │ Hex     │ RGB              ║
╟────────────┼────────┼───────────────────────┼─────────┼──────────────────╢
║            │      0 │ "black"               │         │                  ║
║            │      1 │ "red"                 │         │                  ║
║            │      2 │ "green"               │         │                  ║
║            │      3 │ "yellow"              │         │                  ║
║            │      4 │ "blue"                │         │                  ║
║            │      5 │ "magenta"             │         │                  ║
║            │      6 │ "cyan"                │         │                  ║
║            │      7 │ "white"               │         │                  ║
║            │      8 │ "bright_black"        │         │                  ║
║            │      9 │ "bright_red"          │         │                  ║
║            │     10 │ "bright_green"        │         │                  ║
║            │     11 │ "bright_yellow"       │         │                  ║
║            │     12 │ "bright_blue"         │         │                  ║
║            │     13 │ "bright_magenta"      │         │                  ║
║            │     14 │ "bright_cyan"         │         │                  ║
║            │     15 │ "bright_white"        │         │                  ║
║            │     16 │ "grey0"               │ #000000 │ rgb(0,0,0)       ║
║            │     17 │ "navy_blue"           │ #00005f │ rgb(0,0,95)      ║
║            │     18 │ "dark_blue"           │ #000087 │ rgb(0,0,135)     ║
║            │     20 │ "blue3"               │ #0000d7 │ rgb(0,0,215)     ║
║            │     21 │ "blue1"               │ #0000ff │ rgb(0,0,255)     ║
║            │     22 │ "dark_green"          │ #005f00 │ rgb(0,95,0)      ║
║            │     25 │ "deep_sky_blue4"      │ #005faf │ rgb(0,95,175)    ║
║            │     26 │ "dodger_blue3"        │ #005fd7 │ rgb(0,95,215)    ║
║            │     27 │ "dodger_blue2"        │ #005fff │ rgb(0,95,255)    ║
║            │     28 │ "green4"              │ #008700 │ rgb(0,135,0)     ║
║            │     29 │ "spring_green4"       │ #00875f │ rgb(0,135,95)    ║
║            │     30 │ "turquoise4"          │ #008787 │ rgb(0,135,135)   ║
║            │     32 │ "deep_sky_blue3"      │ #0087d7 │ rgb(0,135,215)   ║
║            │     33 │ "dodger_blue1"        │ #0087ff │ rgb(0,135,255)   ║
║            │     36 │ "dark_cyan"           │ #00af87 │ rgb(0,175,135)   ║
║            │     37 │ "light_sea_green"     │ #00afaf │ rgb(0,175,175)   ║
║            │     38 │ "deep_sky_blue2"      │ #00afd7 │ rgb(0,175,215)   ║
║            │     39 │ "deep_sky_blue1"      │ #00afff │ rgb(0,175,255)   ║
║            │     40 │ "green3"              │ #00d700 │ rgb(0,215,0)     ║
║            │     41 │ "spring_green3"       │ #00d75f │ rgb(0,215,95)    ║
║            │     43 │ "cyan3"               │ #00d7af │ rgb(0,215,175)   ║
║            │     44 │ "dark_turquoise"      │ #00d7d7 │ rgb(0,215,215)   ║
║            │     45 │ "turquoise2"          │ #00d7ff │ rgb(0,215,255)   ║
║            │     46 │ "green1"              │ #00ff00 │ rgb(0,255,0)     ║
║            │     47 │ "spring_green2"       │ #00ff5f │ rgb(0,255,95)    ║
║            │     48 │ "spring_green1"       │ #00ff87 │ rgb(0,255,135)   ║
║            │     49 │ "medium_spring_green" │ #00ffaf │ rgb(0,255,175)   ║
║            │     50 │ "cyan2"               │ #00ffd7 │ rgb(0,255,215)   ║
║            │     51 │ "cyan1"               │ #00ffff │ rgb(0,255,255)   ║
║            │     55 │ "purple4"             │ #5f00af │ rgb(95,0,175)    ║
║            │     56 │ "purple3"             │ #5f00d7 │ rgb(95,0,215)    ║
║            │     57 │ "blue_violet"         │ #5f00ff │ rgb(95,0,255)    ║
║            │     59 │ "grey37"              │ #5f5f5f │ rgb(95,95,95)    ║
║            │     60 │ "medium_purple4"      │ #5f5f87 │ rgb(95,95,135)   ║
║            │     62 │ "slate_blue3"         │ #5f5fd7 │ rgb(95,95,215)   ║
║            │     63 │ "royal_blue1"         │ #5f5fff │ rgb(95,95,255)   ║
║            │     64 │ "chartreuse4"         │ #5f8700 │ rgb(95,135,0)    ║
║            │     66 │ "pale_turquoise4"     │ #5f8787 │ rgb(95,135,135)  ║
║            │     67 │ "steel_blue"          │ #5f87af │ rgb(95,135,175)  ║
║            │     68 │ "steel_blue3"         │ #5f87d7 │ rgb(95,135,215)  ║
║            │     69 │ "cornflower_blue"     │ #5f87ff │ rgb(95,135,255)  ║
║            │     71 │ "dark_sea_green4"     │ #5faf5f │ rgb(95,175,95)   ║
║            │     73 │ "cadet_blue"          │ #5fafaf │ rgb(95,175,175)  ║
║            │     74 │ "sky_blue3"           │ #5fafd7 │ rgb(95,175,215)  ║
║            │     76 │ "chartreuse3"         │ #5fd700 │ rgb(95,215,0)    ║
║            │     78 │ "sea_green3"          │ #5fd787 │ rgb(95,215,135)  ║
║            │     79 │ "aquamarine3"         │ #5fd7af │ rgb(95,215,175)  ║
║            │     80 │ "medium_turquoise"    │ #5fd7d7 │ rgb(95,215,215)  ║
║            │     81 │ "steel_blue1"         │ #5fd7ff │ rgb(95,215,255)  ║
║            │     83 │ "sea_green2"          │ #5fff5f │ rgb(95,255,95)   ║
║            │     85 │ "sea_green1"          │ #5fffaf │ rgb(95,255,175)  ║
║            │     87 │ "dark_slate_gray2"    │ #5fffff │ rgb(95,255,255)  ║
║            │     88 │ "dark_red"            │ #870000 │ rgb(135,0,0)     ║
║            │     91 │ "dark_magenta"        │ #8700af │ rgb(135,0,175)   ║
║            │     94 │ "orange4"             │ #875f00 │ rgb(135,95,0)    ║
║            │     95 │ "light_pink4"         │ #875f5f │ rgb(135,95,95)   ║
║            │     96 │ "plum4"               │ #875f87 │ rgb(135,95,135)  ║
║            │     98 │ "medium_purple3"      │ #875fd7 │ rgb(135,95,215)  ║
║            │     99 │ "slate_blue1"         │ #875fff │ rgb(135,95,255)  ║
║            │    101 │ "wheat4"              │ #87875f │ rgb(135,135,95)  ║
║            │    102 │ "grey53"              │ #878787 │ rgb(135,135,135) ║
║            │    103 │ "light_slate_grey"    │ #8787af │ rgb(135,135,175) ║
║            │    104 │ "medium_purple"       │ #8787d7 │ rgb(135,135,215) ║
║            │    105 │ "light_slate_blue"    │ #8787ff │ rgb(135,135,255) ║
║            │    106 │ "yellow4"             │ #87af00 │ rgb(135,175,0)   ║
║            │    108 │ "dark_sea_green"      │ #87af87 │ rgb(135,175,135) ║
║            │    110 │ "light_sky_blue3"     │ #87afd7 │ rgb(135,175,215) ║
║            │    111 │ "sky_blue2"           │ #87afff │ rgb(135,175,255) ║
║            │    112 │ "chartreuse2"         │ #87d700 │ rgb(135,215,0)   ║
║            │    114 │ "pale_green3"         │ #87d787 │ rgb(135,215,135) ║
║            │    116 │ "dark_slate_gray3"    │ #87d7d7 │ rgb(135,215,215) ║
║            │    117 │ "sky_blue1"           │ #87d7ff │ rgb(135,215,255) ║
║            │    118 │ "chartreuse1"         │ #87ff00 │ rgb(135,255,0)   ║
║            │    120 │ "light_green"         │ #87ff87 │ rgb(135,255,135) ║
║            │    122 │ "aquamarine1"         │ #87ffd7 │ rgb(135,255,215) ║
║            │    123 │ "dark_slate_gray1"    │ #87ffff │ rgb(135,255,255) ║
║            │    125 │ "deep_pink4"          │ #af005f │ rgb(175,0,95)    ║
║            │    126 │ "medium_violet_red"   │ #af0087 │ rgb(175,0,135)   ║
║            │    128 │ "dark_violet"         │ #af00d7 │ rgb(175,0,215)   ║
║            │    129 │ "purple"              │ #af00ff │ rgb(175,0,255)   ║
║            │    133 │ "medium_orchid3"      │ #af5faf │ rgb(175,95,175)  ║
║            │    134 │ "medium_orchid"       │ #af5fd7 │ rgb(175,95,215)  ║
║            │    136 │ "dark_goldenrod"      │ #af8700 │ rgb(175,135,0)   ║
║            │    138 │ "rosy_brown"          │ #af8787 │ rgb(175,135,135) ║
║            │    139 │ "grey63"              │ #af87af │ rgb(175,135,175) ║
║            │    140 │ "medium_purple2"      │ #af87d7 │ rgb(175,135,215) ║
║            │    141 │ "medium_purple1"      │ #af87ff │ rgb(175,135,255) ║
║            │    143 │ "dark_khaki"          │ #afaf5f │ rgb(175,175,95)  ║
║            │    144 │ "navajo_white3"       │ #afaf87 │ rgb(175,175,135) ║
║            │    145 │ "grey69"              │ #afafaf │ rgb(175,175,175) ║
║            │    146 │ "light_steel_blue3"   │ #afafd7 │ rgb(175,175,215) ║
║            │    147 │ "light_steel_blue"    │ #afafff │ rgb(175,175,255) ║
║            │    149 │ "dark_olive_green3"   │ #afd75f │ rgb(175,215,95)  ║
║            │    150 │ "dark_sea_green3"     │ #afd787 │ rgb(175,215,135) ║
║            │    152 │ "light_cyan3"         │ #afd7d7 │ rgb(175,215,215) ║
║            │    153 │ "light_sky_blue1"     │ #afd7ff │ rgb(175,215,255) ║
║            │    154 │ "green_yellow"        │ #afff00 │ rgb(175,255,0)   ║
║            │    155 │ "dark_olive_green2"   │ #afff5f │ rgb(175,255,95)  ║
║            │    156 │ "pale_green1"         │ #afff87 │ rgb(175,255,135) ║
║            │    157 │ "dark_sea_green2"     │ #afffaf │ rgb(175,255,175) ║
║            │    159 │ "pale_turquoise1"     │ #afffff │ rgb(175,255,255) ║
║            │    160 │ "red3"                │ #d70000 │ rgb(215,0,0)     ║
║            │    162 │ "deep_pink3"          │ #d70087 │ rgb(215,0,135)   ║
║            │    164 │ "magenta3"            │ #d700d7 │ rgb(215,0,215)   ║
║            │    166 │ "dark_orange3"        │ #d75f00 │ rgb(215,95,0)    ║
║            │    167 │ "indian_red"          │ #d75f5f │ rgb(215,95,95)   ║
║            │    168 │ "hot_pink3"           │ #d75f87 │ rgb(215,95,135)  ║
║            │    169 │ "hot_pink2"           │ #d75faf │ rgb(215,95,175)  ║
║            │    170 │ "orchid"              │ #d75fd7 │ rgb(215,95,215)  ║
║            │    172 │ "orange3"             │ #d78700 │ rgb(215,135,0)   ║
║            │    173 │ "light_salmon3"       │ #d7875f │ rgb(215,135,95)  ║
║            │    174 │ "light_pink3"         │ #d78787 │ rgb(215,135,135) ║
║            │    175 │ "pink3"               │ #d787af │ rgb(215,135,175) ║
║            │    176 │ "plum3"               │ #d787d7 │ rgb(215,135,215) ║
║            │    177 │ "violet"              │ #d787ff │ rgb(215,135,255) ║
║            │    178 │ "gold3"               │ #d7af00 │ rgb(215,175,0)   ║
║            │    179 │ "light_goldenrod3"    │ #d7af5f │ rgb(215,175,95)  ║
║            │    180 │ "tan"                 │ #d7af87 │ rgb(215,175,135) ║
║            │    181 │ "misty_rose3"         │ #d7afaf │ rgb(215,175,175) ║
║            │    182 │ "thistle3"            │ #d7afd7 │ rgb(215,175,215) ║
║            │    183 │ "plum2"               │ #d7afff │ rgb(215,175,255) ║
║            │    184 │ "yellow3"             │ #d7d700 │ rgb(215,215,0)   ║
║            │    185 │ "khaki3"              │ #d7d75f │ rgb(215,215,95)  ║
║            │    187 │ "light_yellow3"       │ #d7d7af │ rgb(215,215,175) ║
║            │    188 │ "grey84"              │ #d7d7d7 │ rgb(215,215,215) ║
║            │    189 │ "light_steel_blue1"   │ #d7d7ff │ rgb(215,215,255) ║
║            │    190 │ "yellow2"             │ #d7ff00 │ rgb(215,255,0)   ║
║            │    192 │ "dark_olive_green1"   │ #d7ff87 │ rgb(215,255,135) ║
║            │    193 │ "dark_sea_green1"     │ #d7ffaf │ rgb(215,255,175) ║
║            │    194 │ "honeydew2"           │ #d7ffd7 │ rgb(215,255,215) ║
║            │    195 │ "light_cyan1"         │ #d7ffff │ rgb(215,255,255) ║
║            │    196 │ "red1"                │ #ff0000 │ rgb(255,0,0)     ║
║            │    197 │ "deep_pink2"          │ #ff005f │ rgb(255,0,95)    ║
║            │    199 │ "deep_pink1"          │ #ff00af │ rgb(255,0,175)   ║
║            │    200 │ "magenta2"            │ #ff00d7 │ rgb(255,0,215)   ║
║            │    201 │ "magenta1"            │ #ff00ff │ rgb(255,0,255)   ║
║            │    202 │ "orange_red1"         │ #ff5f00 │ rgb(255,95,0)    ║
║            │    204 │ "indian_red1"         │ #ff5f87 │ rgb(255,95,135)  ║
║            │    206 │ "hot_pink"            │ #ff5fd7 │ rgb(255,95,215)  ║
║            │    207 │ "medium_orchid1"      │ #ff5fff │ rgb(255,95,255)  ║
║            │    208 │ "dark_orange"         │ #ff8700 │ rgb(255,135,0)   ║
║            │    209 │ "salmon1"             │ #ff875f │ rgb(255,135,95)  ║
║            │    210 │ "light_coral"         │ #ff8787 │ rgb(255,135,135) ║
║            │    211 │ "pale_violet_red1"    │ #ff87af │ rgb(255,135,175) ║
║            │    212 │ "orchid2"             │ #ff87d7 │ rgb(255,135,215) ║
║            │    213 │ "orchid1"             │ #ff87ff │ rgb(255,135,255) ║
║            │    214 │ "orange1"             │ #ffaf00 │ rgb(255,175,0)   ║
║            │    215 │ "sandy_brown"         │ #ffaf5f │ rgb(255,175,95)  ║
║            │    216 │ "light_salmon1"       │ #ffaf87 │ rgb(255,175,135) ║
║            │    217 │ "light_pink1"         │ #ffafaf │ rgb(255,175,175) ║
║            │    218 │ "pink1"               │ #ffafd7 │ rgb(255,175,215) ║
║            │    219 │ "plum1"               │ #ffafff │ rgb(255,175,255) ║
║            │    220 │ "gold1"               │ #ffd700 │ rgb(255,215,0)   ║
║            │    222 │ "light_goldenrod2"    │ #ffd787 │ rgb(255,215,135) ║
║            │    223 │ "navajo_white1"       │ #ffd7af │ rgb(255,215,175) ║
║            │    224 │ "misty_rose1"         │ #ffd7d7 │ rgb(255,215,215) ║
║            │    225 │ "thistle1"            │ #ffd7ff │ rgb(255,215,255) ║
║            │    226 │ "yellow1"             │ #ffff00 │ rgb(255,255,0)   ║
║            │    227 │ "light_goldenrod1"    │ #ffff5f │ rgb(255,255,95)  ║
║            │    228 │ "khaki1"              │ #ffff87 │ rgb(255,255,135) ║
║            │    229 │ "wheat1"              │ #ffffaf │ rgb(255,255,175) ║
║            │    230 │ "cornsilk1"           │ #ffffd7 │ rgb(255,255,215) ║
║            │    231 │ "grey100"             │ #ffffff │ rgb(255,255,255) ║
║            │    232 │ "grey3"               │ #080808 │ rgb(8,8,8)       ║
║            │    233 │ "grey7"               │ #121212 │ rgb(18,18,18)    ║
║            │    234 │ "grey11"              │ #1c1c1c │ rgb(28,28,28)    ║
║            │    235 │ "grey15"              │ #262626 │ rgb(38,38,38)    ║
║            │    236 │ "grey19"              │ #303030 │ rgb(48,48,48)    ║
║            │    237 │ "grey23"              │ #3a3a3a │ rgb(58,58,58)    ║
║            │    238 │ "grey27"              │ #444444 │ rgb(68,68,68)    ║
║            │    239 │ "grey30"              │ #4e4e4e │ rgb(78,78,78)    ║
║            │    240 │ "grey35"              │ #585858 │ rgb(88,88,88)    ║
║            │    241 │ "grey39"              │ #626262 │ rgb(98,98,98)    ║
║            │    242 │ "grey42"              │ #6c6c6c │ rgb(108,108,108) ║
║            │    243 │ "grey46"              │ #767676 │ rgb(118,118,118) ║
║            │    244 │ "grey50"              │ #808080 │ rgb(128,128,128) ║
║            │    245 │ "grey54"              │ #8a8a8a │ rgb(138,138,138) ║
║            │    246 │ "grey58"              │ #949494 │ rgb(148,148,148) ║
║            │    247 │ "grey62"              │ #9e9e9e │ rgb(158,158,158) ║
║            │    248 │ "grey66"              │ #a8a8a8 │ rgb(168,168,168) ║
║            │    249 │ "grey70"              │ #b2b2b2 │ rgb(178,178,178) ║
║            │    250 │ "grey74"              │ #bcbcbc │ rgb(188,188,188) ║
║            │    251 │ "grey78"              │ #c6c6c6 │ rgb(198,198,198) ║
║            │    252 │ "grey82"              │ #d0d0d0 │ rgb(208,208,208) ║
║            │    253 │ "grey85"              │ #dadada │ rgb(218,218,218) ║
║            │    254 │ "grey89"              │ #e4e4e4 │ rgb(228,228,228) ║
║            │    255 │ "grey93"              │ #eeeeee │ rgb(238,238,238) ║
╚════════════╧════════╧═══════════════════════╧═════════╧══════════════════╝

2. Official Technical Reference & Guides (Textualize/website)

File: docs/about-us.md


hide:

  • navigation

- toc


About Us

We are a team of developers working from Edinburgh, Scotland; and remote.

The Team

Philosophy

We are strong advocates of Open Source software and embrace building in public. As developers building tools for developers, we know that trust can only built by sharing and contributing within the developer community.

We believe in inclusivity in computing and within our company.

--8<-- "docs/images/pride.svg"


File: docs/index.md


hide:

  • navigation

- toc


Textualize.io

!!! tip inline end "Mailing List"

text
Sign up to our [mailing list](http://eepurl.com/hL0BF1) for occasional news about Textualize.

We are building Textual — a Rapid Application Development framework for Python.

As the world's most popular programming language, Python has made a huge impact in a broad range of fields from data science to biology.
At the same time, web development has become more and more specialized, putting it out of reach for the majority of developers. We have a solution for that.

Textual leverages developers existing Python skills and the tools they already know, to build highly functional User Interfaces.
Making it possible for developers of all skill levels to build applications for their company or organisation.
No more slow, expensive out-sourcing.
Apps can be built in-house by a single developer that would previously have taken a team of specialists to build — and in a fraction of the time.

Textual apps run on MacOS, Linux, and Windows. In the terminal, the web, and Jupyter notebooks.

Want to know more?

Read about our plans for Textual, and upcoming web service.

:material-download: :material-file-pdf-box: The case for Textual

:material-download: :material-file-pdf-box: Textualize Cloud Service

Follow our progress on the Textual Blog or visit the Textual Website for more information.

Textual in action

A brief video of some of Textual's capabilities.


File: docs/projects.md


title: "Projects"
hide:

  • navigation

- toc


Projects

We are software developers, building software for other developers.

Here you will find the projects we work on.

Textual

Rapid Application Development, powered by Rich.

Expect a lot more from your terminal with this modern API to build interactive applications on par with the Web and Desktop.

!!! info "Coming Soon"

text
Run Textual apps in the browser as easily as the terminal. Build web apps with just your Python skills.

:material-github: Textual{ .md-button .md-button--primary } :fontawesome-brands-discord: Textual{ .md-button .md-button--primary }

Textual screenshots

text
<li>
        <a href="/images/textual-screenshots/cloudtrail.svg" target="blank">
        --8<-- "docs/images/textual-screenshots/cloudtrail.svg"
        </a>
        
            Visualize Amazon CloudTrail data.
        
    </li>
    <li>
        <a href="/images/textual-screenshots/datadog.svg" target="blank">
        --8<-- "docs/images/textual-screenshots/datadog.svg"
        </a>
        
            [DDQA](https://github.com/DataDog/ddqa) (by Datadog) is a tool for users of Jira to perform QA of anticipated releases of code on GitHub.
        
    </li>
    <li>
        <a href="/images/textual-screenshots/baca.svg" target="blank">
        --8<-- "docs/images/textual-screenshots/baca.svg"
        </a>
        
            [Baca](https://github.com/wustho/baca) &mdash; an Open Source TUI e-book reader.
        
    </li>
    <li>
        <a href="/images/textual-screenshots/markdown-viewer.svg" target="blank">
        --8<-- "docs/images/textual-screenshots/markdown-viewer.svg"
        </a>
        
            A remarkably full featured Markdown browser, that runs in your terminal.
        
    </li>
    <li>
        <a href="/images/textual-screenshots/twobee.svg" target="blank">
        --8<-- "docs/images/textual-screenshots/twobee.svg"
        </a>
        
            Explore DNA sequences stored in "2 bit" files.
        
    </li>
    <li>
        <a href="/images/textual-screenshots/mandelbrot.svg" target="blank">
        --8<-- "docs/images/textual-screenshots/mandelbrot.svg"
        </a>
        
            An experimental mandelbrot set explorer for the terminal.
        
    </li>

Rich

Rich for Python

text
<a href="/images/rich.svg" target="blank">
 --8<-- "docs/images/rich.svg"

The project which started it all.

In 2020, Will McGugan wrote the first line of Rich, a project which would become one of the most popular in the Python ecosystem, used by over seventy thousand projects.

Rich started out as a simple tool to colorize text, but has since grown in to a sophisticated library for beautiful formatting in terminal.

Rich has over 43,000 GitHub stars and counting, and is used

:material-github: Rich{ .md-button .md-button--primary }


File: docs/why-i-founded-textualize.md


hide:

  • navigation

- toc


Why I Founded Textualize

I founded Textualize with the express purpose of reversing what I saw as years of neglect in a critical developer tool: the terminal. That little window and flashing cursor that is the starting point and constant companion for many a software project.

Neglect may be nothing new in the tech world. When we collectively decide that the new generation of software has arrived, we neglect what came before it. It's a natural consequence of progress and no bad thing.

What's different about the terminal is that nobody got the memo that we should stop using it. The browser, with all its power, is seen as a companion to the terminal by developers, not as a rival. Terminals appear to reside in a niche they are so ideally suited for that tech Darwinism can't touch them. In a 2022 survey of developers, 89% responded that they have a terminal open at least half of the day. Clearly developers are as engaged with the terminal as much as the browser, and yet few tech companies give it more than a second thought.

Rich

Rich for Python

text
<a href="/images/rich.svg" target="_blank">
 --8<-- "docs/images/rich.svg"

I see the neglect in the terminal world as a mistaken assumption that whatever can be done in the terminal, has been done, and there is little to gain from attempting to enhance the terminal experience. My work on Rich made it clear to me that developers were delighted by any visual enhancements. Not only was innovation still possible with a technology older than most developers, but there was real demand for it.

Terminals and browsers coexist so comfortably in developer's minds because there are distinct use-cases for each; we instinctively know when to reach for one over the other. Yet there is a class of terminal application that defies such an obvious taxonomy. The TUI, or Text User Interface, is an application which takes over the terminal and can present windows, views, and dialogs. There was a time when these apps were the primary way of interacting with a computer. That era is long gone. Yet, like the terminal itself, TUIs survive to this day. In fact, they are more popular than ever.

There are some technical advantages to these apps: a developer can operate a TUI over an encrypted channel on a remote server. But this is often not the primary or even secondary reason why a developer would reach for a TUI over a web application.

TUIs can transition seamlessly from the command line and back again without interrupting the developer's train of thought, which explains some of their popularity. TUIs are also popular for many of the reasons that terminals themselves are popular: a minimal keyboard-focused interface that rewards repeated use. One that is free of distractions and context switching. Additionally, terminals are a natural fit for the clean lines, dark mode, aesthetic that even web apps seek to emulate.

Having talked to many developers on the subject, I understood that there were few use-cases where a developer would not want a TUI. Many enthused about TUI interfaces to system administration tasks, network automation, internal analytics, and crypto currency bots, but for every work related application there was a desire for a productivity tool, calendar, distraction-free writing and any number of apps were developers would eschew the web or desktop in favor of a TUI.

There is clearly demand but short supply. TUIs have traditionally been built with an API conceived in the 90s. There has been almost zero innovation since then. Neglect meant that none of the advancements in the world of application development made it to the terminal.

Textual

My answer to this is Textual, a project I started in 2021 to take the best of innovation from the web and desktop world and bring it to the terminal. The prospect of being able to build TUIs without grappling with archaic tools created a lot of buzz in the Python community and beyond.

--8<-- "docs/images/textual-screenshots/cloudtrail.svg"
An app built with Textual

The first iteration of Textual was a hobby project, created to pass the time and satisfy some intellectual curiosity. Only once I was satisfied that there were no technical reasons as to why this had never been attempted, did I realize there was opportunity here. The unique characteristics of TUIs, namely low systems requirements, cross platform, remotely accessible, could find a previously unexplored niche -- which only Textual could fully exploit.

I would not want Textual to stray from its roots as Free and Open Source software, but selling "picks and shovels" would not compromise that. The opportunity felt compelling enough for me to quit my job in late 2021 and live on savings for a year. At the end of the year I would have built Textual and a related web service which I could then turn into a business.

Founding Textualize was very much a plan B. But funding enabled me to be more ambitious in my mission to rejuvenate the terminal. Our next challenge as a company is to solve the problem of distribution. Paradoxically, although terminal software is installed on every desktop computer ever shipped, the terminal is little known outside of developers and other technical users. If TUIs are to truly reach their potential we need to make them accessible to more typical users.

I see Textualize as the vanguard in a terminal renaissance. I don't know why there is renewed interest in the terminal as a platform now. We could have asked more of terminals years ago. But we are in a unique position to halt and reverse years of neglect.

Will McGugan

** CEO / Founder **