PyTextCanvas
PyTextCanvas is a module for writing text and ascii art to a 2D string “canvas” in Python.
PyTextCanvas has a Canvas class, which is a data structure for a “2D string”, where characters can be “drawn” to the canvas using x, y coordinates. The canvas can be exported as a basic Python string or HTML.
Runs on Windows, macOS, and Linux.
This module could be used in curses-like or urwid-like modules.
Installation
pip install pytextcanvas
Example Usage
>>> import pytextcanvas as pytc
>>> canvas = pytc.Canvas(20, 4)
>>> canvas.fill('.')
>>> print(canvas)
....................
....................
....................
....................
>>> canvas.write('Hello, world!')
>>> print(canvas)
Hello, world!.......
....................
....................
....................
>>> canvas.cursor = (10, 2)
>>> canvas.write('Howdy!!!')
>>> print(canvas)
Hello, world!.......
....................
..........Howdy!!!..
....................
>>> str(canvas)
'Hello, world!.......\n....................\n..........Howdy!!!..\n....................'
>>> canvas.rectangle('*', 0, 0, 20, 4)
>>> print(canvas)
********************
*..................*
*.........Howdy!!!.*
********************
Metadata
Release files for PyTextCanvas 0.0.3
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 |
|---|---|---|---|---|
| PyTextCanvas-0.0.3.tar.gz | 16.0 kB | Without provenance | Details for PyTextCanvas-0.0.3.tar.gz |
Release files / PyTextCanvas-0.0.3.tar.gz
| Download URL | PyTextCanvas-0.0.3.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a032348f14c4be6ec4a934e7fac82a23f267de527b1d064647fc8fda8270647
|
|
BLAKE2b-256 checksum How to use checksums |
9f5fdd7cc3ba9baba8d0cdd0df42c714396085aa3c5bbf157257cc3dcbb4d427
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0
|
Security for PyTextCanvas 0.0.3
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.