

> my_list = > from rich import inspect > inspect ( my_list, methods = True )

Rich has an inspect function which can produce a report on any Python object, such as class, instance, or builtin. You can use a Console object to generate sophisticated output with minimal effort. print ( "Where there is a Will there is a way." ) For more finely grained styling, Rich renders a special markup which is similar in syntax to bbcode. That's fine for styling a line of text at a time. The output will be something like the following: print ( "Hello", "World!", style = "bold red" ) You can set a style for the entire output by adding a style keyword argument. There are a few ways of adding color and style to your output. Note that unlike the builtin print function, Rich will word-wrap your text to fit within the terminal width.

print ( "Hello", "World!" )Īs you might expect, this will print "Hello World!" to the terminal. The Console object has a print method which has an intentionally similar interface to the builtin print function. from nsole import Console console = Console ()
#Markdown to rich text install#
install ()įor more control over rich terminal content, import and construct a Console object. Rich can be installed in the Python REPL, so that any data structures will be pretty printed and highlighted. Try this: from rich import print print ( "Hello, World!", ":vampire:", locals ()) 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. Run the following to test Rich output on your terminal: python -m rich Install with pip or your favorite PyPI package manager. Rich works with Jupyter notebooks with no additional configuration required.
#Markdown to rich text windows#
True color / emoji works with new Windows Terminal, classic terminal is limited to 16 colors. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more - out of the box.įor a video introduction to Rich see calmcode.io by what people are saying about Rich. The Rich API makes it easy to add color and style to terminal output. Rich is a Python library for rich text and beautiful formatting in the terminal.
