Terminal I/O with a pixel-like abstraction
Project description
# termpixels
*the terminal as a character-cell matrix*
## Purpose
Creating programs that run inside of terminals seems convoluted. The goal of termpixels is to abstract the terminal into a 2D array of "pixels", or character cells, which each contain a single text character, a foreground color, and a background color. termpixels allows you to modify the screen contents anywhere, at any time, and then handles updating the terminal automatically.
## Limitations
There are lots of great libraries for coloring terminal output. This one is designed for full-screen applications that completely control the contents of the screen. That means that it automatically saves and clears the screen, resets the cursor position, and accepts input in cbreak mode.
## Features
* Unix terminal feature detection with terminfo (via Python [curses][python-curses])
* Windows support through Win32 Console API
* Terminal (re)size detection
* Asynchronous input
* Keyboard input with support for special keys like arrows, function keys, escape, etc.
* Mouse click and move input in terminals supporting xterm mouse
* 16, 256, and true color output (with detection for best supported mode)
* No reliance on ncurses except for terminfo lookup
* 100% Python
* and more
## Get it
This project is on [PyPI][pypi].
Alternatively, just `pip install -e .` in the root directory.
## Inspiration
* [tcell][tcell]
* [ncurses][ncurses]
[python-curses]: https://docs.python.org/3/howto/curses.html
[tcell]: https://github.com/gdamore/tcell
[ncurses]: https://www.gnu.org/software/ncurses/
[pypi]: https://pypi.org/project/termpixels/
*the terminal as a character-cell matrix*
## Purpose
Creating programs that run inside of terminals seems convoluted. The goal of termpixels is to abstract the terminal into a 2D array of "pixels", or character cells, which each contain a single text character, a foreground color, and a background color. termpixels allows you to modify the screen contents anywhere, at any time, and then handles updating the terminal automatically.
## Limitations
There are lots of great libraries for coloring terminal output. This one is designed for full-screen applications that completely control the contents of the screen. That means that it automatically saves and clears the screen, resets the cursor position, and accepts input in cbreak mode.
## Features
* Unix terminal feature detection with terminfo (via Python [curses][python-curses])
* Windows support through Win32 Console API
* Terminal (re)size detection
* Asynchronous input
* Keyboard input with support for special keys like arrows, function keys, escape, etc.
* Mouse click and move input in terminals supporting xterm mouse
* 16, 256, and true color output (with detection for best supported mode)
* No reliance on ncurses except for terminfo lookup
* 100% Python
* and more
## Get it
This project is on [PyPI][pypi].
Alternatively, just `pip install -e .` in the root directory.
## Inspiration
* [tcell][tcell]
* [ncurses][ncurses]
[python-curses]: https://docs.python.org/3/howto/curses.html
[tcell]: https://github.com/gdamore/tcell
[ncurses]: https://www.gnu.org/software/ncurses/
[pypi]: https://pypi.org/project/termpixels/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
termpixels-0.0.4.zip
(16.9 kB
view hashes)
Built Distribution
termpixels-0.0.4-py3-none-any.whl
(15.0 kB
view hashes)
Close
Hashes for termpixels-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ababbdc8705ae59e53225893338540bfb59a597c259711a015db7ea8b6ded62f |
|
MD5 | c1688b6a180dbc5e76d69d9bf384ebbb |
|
BLAKE2b-256 | a79e32bf4c9452e8787b7dd77ea8f3fba9a43d772c2e10e53257288ad836962d |