Skip to main content

terminal-markup

PyPI - Python Version PyPI - Version Total Downloads

Render Markup to Terminal.

Inspired by tml.

Pros:

  • Faster than alternatvies like rich.
  • Supports background colors and hex.
  • Null-dependency.

Install:

pip install terminal-markup
poetry add terminal-markup

After install you can use command terminal-markup.

Examples

from terminal_markup import render

# let's render bricks
print(render("[b][color=#f70000 background=yellow] WARNING [/color]:[/b] [purple]Life leads to [i blue underline]Death[/i].[/purple]"))

image

Tags

Tag Description
b, bold Bold text
i, em Italic text
u Underline text
blink --
dim Dimmed color
rev Reversed foreground and background colors
[color=<color>], <color name> Set foreground color

Non-existent tags do not cause errors.

Common attributes

Attribute Description
<color name>, color=<color> Set foreground color
background=<color> Set background color
{bold|italic|underline|dim|reversed|blink}[={no|off|false|0|...}] Set style

Unknown attributes are ignored.

Colors

Color names: black, maroon, green, olive, navy, purple, teal, silver, grey, red, lime, yellow, blue, fuchsia, aqua, white (first 16 colors from here). Also supported HEX-codes like #87CEEB.

Tags Escaping

\[ - escaped [.

Case Insensetive

Tag names, attributes and color names are case insensetive.

Metadata

Release files for terminal-markup 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terminal-markup 0.2.8
File Size Uploaded
terminal_markup-0.2.8.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for terminal-markup 0.2.8
File Interpreter ABI Platform
terminal_markup-0.2.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / terminal_markup-0.2.8.tar.gz

Download URL terminal_markup-0.2.8.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
631a7ece3485299c5cfd33c6145fb8ded58f45ef697b13638109c254d902e83e
BLAKE2b-256 checksum
How to use checksums
2dcb4e0aa6999ff10e1b09d65b2662f89266804a7ef3a58919caeea5407398e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.6 Linux/6.6.8-arch1-1

Release files / terminal_markup-0.2.8-py3-none-any.whl

Download URL terminal_markup-0.2.8-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a365f5ef96e0d3a3e1bcfc05726d3d2619ab48d694dac4c8e13fc9b09ca5eeac
BLAKE2b-256 checksum
How to use checksums
9734e7a54d9d222e4d94819781d53085aa44047b358ede4252bb2e702b2b8b44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.6 Linux/6.6.8-arch1-1

Release history Release notifications | RSS feed

This release

0.2.8 This release

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page