ANSI cursor movement and graphics
Project Links
Meta
Author: Wijnand Modderman-Lenstra
Requires Python: >=3.6
Classifiers
ANSI
Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text.
Example
Print something in bold yellow on a red background:
>>> from ansi.colour import fg, bg
>>> from ansi.colour.fx import reset
>>> msg = (bg.red, fg.yellow, 'Hello world!', reset)
>>> print(''.join(map(str, msg)))
...
If you like syntactic sugar, you may also do:
>>> from ansi.colour import fg, bg
>>> print(bg.red(fg.yellow('Hello world!')))
...
Also, 256 RGB colours are supported:
>>> from ansi.colour.rgb import rgb256
>>> from ansi.colour.fx import reset
>>> msg = (rgb256(0xff, 0x80, 0x00), 'hello world', reset)
>>> print(''.join(map(str, msg)))
...
If you prefer to use American English instead:
>>> from ansi.color import ...
References
https://www.ecma-international.org/publications-and-standards/standards/ecma-48/
Requirements
Ansi requires python 3.6 and supports typing.
0.3.7
Jan 22, 2024
0.3.6
Feb 08, 2022
0.3.5
Jan 31, 2022
0.3.4
Jan 30, 2022
0.3.3
Jan 30, 2022
0.3.2
Jan 30, 2022
0.3.1
Jan 30, 2022
0.3.0
Jan 29, 2022
0.2.0
Jan 09, 2021
0.1.5
Mar 27, 2020
0.1.4
Mar 27, 2020
0.1.3
Jul 14, 2015
0.1.2
Oct 20, 2013
0.1.1
Jun 19, 2013
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
typing-extensions
(>=3.6.4)