TERMINEDIA
This is a Python library allowing using a text-terminal as a low-resolution graphics output, along with keyboard realtime reading, and a couple utilities enough to enable using a text terminal to run simple 2D games or simply rich terminal apps.
The "noveau" factor is that it uses Unicode quarter-character block combinations to effectivelly enable 1/4 character "pixels" in the terminal. It also makes use of 24bit "true" color for text, not limiting itself to the 80's 8 color palette for the terminal.
The development version allows loading image files and displaying those as colored block chars on the terminal, several terminal-font text effects, and rendering big-text, 4 or 8 characters tall, by rendering built-in fonts as images using block characters.
It is designed as a library, providing a discoverable and easy to use API for drawing, and upon install a few example scripts will be imediately available as stand-alone scripts with the "terminedia-" prefix.
The idea is to keep this as a lightweight install - with as little dependencies as possible.
Usage
Although targeted for programatic use, after install a few example programs exercising the library capabilities are made available in the active Python environment. Try one of several "terminedia-xxxxx" scripts installed, such as "terminedia-image" and "terminedia-snake"
Some of the features are as easy to use as the print function
from Python itself:
Other, like the drawing API which emulates pixels with unicode block characters require a couple more calls:
Documentation
Check the in progress documentation at: https://terminedia.readthedocs.io/en/latest/
(nb. that documentation is currently for the 0.2 version, available from pypi. The project's capabilities evolved far beyond whats is in there, but docs are still missing - the "TODO.txt" file lists implemented features or fixes (marked with a "V") and a loose roadmap. Although for useage and documentation one has to rely on the doc-strings)
Also, the examples folder have concrete snippets and
some stress-testing code. The examples
were moved into the main package code, and granted stand-alone
scripts status when the package is pip-installed.
After install, try calling any of the "terminedia-" scripts
made available to check the output.
Although incipient in options, some of these example
scripts can work as command line tools. For example
terminedia-image <image_file> will downscale and display
an image file in the terminal.
Note that the default pip install won't bring PIL, which results in
limited image support - use pip install terminedia[images],
or simply install PIL directly with pip install pillow,
to be able to load arbitrary image files.
Compatibility
Preliminary Windows support - by using the Colorama Python package, with proper fonts configuration on the terminal, it is possible to experiment most of terminedia´s capabilities (the terminedia-snake example works). There is still work to be done, but for a better experience under Windows install the CMDER console emulator and the UNSCII fonts for rendering pseudographics (links in the FRIENDS.md file)
On Linux and other posix systems, Terminedia relies on ANSI scape sequences for all terminal manipulation. It should work in most Linux and Mac OS terminal applications (including non-X11, "native" terminals on Linux)
The output result will vary according to the terminal and font used - a nice experience can be achieved with the "Terminus" font, specially if one is using the Braille characters for drawing.
There is also an HTML backend that can output programatically
created ASCII art to an HTML file, formatted with
mono-spaced fonts inside a div element. The
"terminedia-image" example program makes use
of this feature.
License
Terminedia is licensed under GNU's LGPL 3.0 or later, meaning you are free to use it in whatver project you want, comercial or not, private or not - you are only required to contribute back any enhancements you make to this library itself. For details, please read acompanining "LICENSE" file.
Metadata
Release files for terminedia 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| terminedia-0.4.2.tar.gz | 1.6 MB | Without provenance | Details for terminedia-0.4.2.tar.gz |
Release files / terminedia-0.4.2.tar.gz
| Download URL | terminedia-0.4.2.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51f1a05e49f229d744df63db36162626390094ef79fea335cb16306e2a48a6ee
|
|
BLAKE2b-256 checksum How to use checksums |
ac5742047fc1cbcd18dd8f99632aebcf06e3588404e22fd795c9eb6f11f41238
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0b3+
|
Security for terminedia 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.