ltermio - A Lightweight POSIX terminal I/O library
The package contains four modules: cursor, termkey, color256 and unicon. Tested only on MacOS terminal and iTerm2, so the platform compatibility has not been well verfied yet. All functions are based on CSI sequences or termios, no additional requirements other than the standard library.
New: Added a new module termouse, ready to support mouse base on XTerm extension...Roughly implemnted.
Installation
Uses pip to install the package:
pip3 install ltermio
cursor
A series of functions about screen and cursor operations. And additionally provides 4 interesting functions for text composing, where v_composing() supports using VI like cursor commands to layout text display.
termkey
There are 5 curses like functions: getch(), getkey(), ungetch(), ungetkey(), setparams().
getch() and getkey() read keyboard in non-canonical mode, ungetch() and ungetkey() put keys back to the key buffer for next reading, setparams() sets frequently-used input attributes.
termouse
Roughly implemented mouse supporting.
color256
Sets 256-color display attributes of the character terminal.
unicon
Collection of some common icons in unicode character set.
References
https://en.wikipedia.org/wiki/ANSI_escape_code
https://www.xfree86.org/current/ctlseqs.html
https://www.leonerd.org.uk/hacks/fixterms/
History & Why
When I was learning Python a few months ago, I decided to write a terminal Tetris game as a practice of the language learning. Due to the learning reason, I did not want to use any third-party packages. So when I finally finished the game, there naturally formed this by-product, I named it ltermio.
Metadata
Release files for ltermio 0.4.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ltermio-0.4.7.tar.gz | 19.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ltermio-0.4.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.2 kB
Release files / ltermio-0.4.7.tar.gz
| Download URL | ltermio-0.4.7.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a761f2b1c8ad70a3e63893d8ddae52fe7c8ff7ffdd1577ae40ce62b8681126fd
|
|
BLAKE2b-256 checksum How to use checksums |
f11156340a12d28055a4f62bc3de6d2b6c39a92a13d8da21f9fa9e4ee8b674fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / ltermio-0.4.7-py3-none-any.whl
| Download URL | ltermio-0.4.7-py3-none-any.whl |
|---|---|
| Size | 24.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2dd96432e842cccaaceb45b3c91ba4e8a0dfa72b2190117c70c7405e0572e4b
|
|
BLAKE2b-256 checksum How to use checksums |
5cd0b78124c9d13eae74d856c9f6dfa1835e9801125abf9a8e037d0d19393612
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|