mesita
mesita is a library for printing tables in the terminal.
You can use it to print a table and customize the cells with different font styles and colors.
mesita is also good for diffing two tables and comparing differences. You can print tables side-by-side or even mix two tables into one.
mesita is leveraged by unit testing libraries like chispa and beavis.
Format strings in the Terminal
Here's how to print a string that's bold and blue in the Terminal:
mesita.format_string("Adelaide", ["bold", "blue"])
Print table comparisons
Suppose you have the following tables that are similar. Here is the first table:
+-----------+------+------------+-----------------+
| City name | Area | Population | Annual Rainfall |
+-----------+------+------------+-----------------+
| Adelaide | 1295 | 1158259 | 600.5 |
| Brisbane | 5905 | 1857594 | 1146.4 |
+-----------+------+------------+-----------------+
Here is the other table:
+-----------+------+------------+-----------------+
| City name | Area | Population | Annual Rainfall |
+-----------+------+------------+-----------------+
| Adelaide | 1300 | 1158259 | 600.5 |
| Brisbane | 5905 | 1857594 | 1148 |
+-----------+------+------------+-----------------+
Tables as two columns
Here's how to print the tables as two columns:
field_names1 = ["City name", "Area", "Population", "Annual Rainfall"]
rows1 = [
["Adelaide", 1295, 1158259, 600.5],
["Brisbane", 5905, 1857594, 1146.4]
]
rows2 = [
["Adelaide", 1300, 1158259, 600.5],
["Brisbane", 5905, 1857594, 1148]
]
m = Mesita(field_names1, rows1, rows2, ["nc"], ["red", "bold"], lambda x, y: x == y)
print("\n" + m.as_columns())
Tables side-by-side
Here's how to print the tables side-by-side:
m = Mesita(field_names1, rows1, rows2, ["nc"], ["red", "bold"], lambda x, y: x == y)
print("\n" + m.side_by_side())
Tables combined into one
And here's how to print the tables combined into a single table:
m = Mesita(field_names, rows1, rows2, ["nc"], ["red", "bold"], lambda x, y: x == y)
print("\n" + m.smush())
Metadata
Release files for mesita 0.0.1
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 |
|---|---|---|---|---|
| mesita-0.0.1.tar.gz | 16.1 kB | Without provenance | Details for mesita-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mesita-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for mesita-0.0.1-py3-none-any.whl |
Total release size: 32.1 kB
Release files / mesita-0.0.1.tar.gz
| Download URL | mesita-0.0.1.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1496c56f0a7f7c7cce4e4569898687b786a5fc1f09ae8c5251200963564dcd02
|
|
BLAKE2b-256 checksum How to use checksums |
ccc35658cdfd675efcaf3cac0bd047e02d2b4420f3ce946b4a23da40f9db6c5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.5 Darwin/23.2.0
|
Release files / mesita-0.0.1-py3-none-any.whl
| Download URL | mesita-0.0.1-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc857b1e3d60175122be72d9edaf389598f37d541d53d901b366f63fe30281cf
|
|
BLAKE2b-256 checksum How to use checksums |
c4452563dc873863afe717192b70e4b5d1feab3a6af072b67b9b5218056cccaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.5 Darwin/23.2.0
|
Security for mesita 0.0.1
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.