A library to convert tables to string with full support for line breaks and formatting
Project description
table2string
Convert table to string
While there are several libraries available for converting tables to strings in Python, none seemed to meet my specific requirements.
- Line Break Support: Easily include line breaks within cells for enhanced readability.
- Emoji Integration: Effortlessly incorporate emoji characters into your tables to add visual appeal and context.
Install
PyPI
pip install -U table2string
GitHub
pip install -U git+https://github.com/EgorKhabarov/table2string.git@master
Usage example
>>> from io import StringIO
>>> from table2string import print_table
>>> print_table([("1", "2", "3"), ("qwe", "rty\nuio", "")])
+-----+-----+---+
| 1 | 2 | 3 |
+-----+-----+---+
| qwe | rty | |
| | uio | |
+-----+-----+---+
>>> print_table([("123456\n\n789000", "example")], max_width=(3, 4), max_height=4)
+-----+------+
| 123↩| exam↩|
| 456 | ple |
| | |
| 789…| |
+-----+------+
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
table2string-1.0.0.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for table2string-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e1f017ddcc39957272ef7b1c5d7552f565b0f426da0d24c4a72488e50a79f17 |
|
MD5 | c009698f604ac0eec0644ad439a29ee8 |
|
BLAKE2b-256 | ed199a799c978c95737a2c09b3b5e15ca468e7438b2dfe8111123d2857d962de |