Skip to main content

Align columns in ASCII tables

Project description

tablign

Aligns columns in your ASCII tables.

PyPi Version PyPI pyversions GitHub stars PyPi downloads

gh-actions codecov Code style: black

With

tablign in.txt out.txt

you can convert your input file

| A | 1.34|-214.1|
|CCCC | 55.534|   1131.1|

into

| A    |  1.34  | -214.1 |
| CCCC | 55.534 | 1131.1 |

Column widths are unified across the table, decimal dots are aligned, and tablign tries to be smart about column separators. Works for CSV, LaTeX, Markdown etc. By default, tablign reads from stdin and writes to stdout, so you can use pipes with tablign, too:

head -n in.txt | tablign

Usage from vim

Simply mark the table (shift-V), and type

:'<,'>:!tablign

Installation

tablign is available from the Python Package Index, so with

pip install tablign

you can install.

Testing

To run the tests, simply check out this repository and run

pytest

License

This software is published under the GPLv3 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tablign-0.3.3.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

tablign-0.3.3-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file tablign-0.3.3.tar.gz.

File metadata

  • Download URL: tablign-0.3.3.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tablign-0.3.3.tar.gz
Algorithm Hash digest
SHA256 ec4d662d2a9dbbc0490947e23af637a45b2c0585283db3325e87b04ce8605b7e
MD5 1d0e6502741ee3035a9cac59e284884e
BLAKE2b-256 706d03be642c6f9237bc88c037501650868dd2e0cbaadeedc8bc2fcacecdc8c9

See more details on using hashes here.

File details

Details for the file tablign-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: tablign-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tablign-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0230192f8b7f6e8a3bebe438f0383b05eac88bd7906fc3902887c6ad04e81df
MD5 fc386b0b0b8046e95e9ca098a78760a8
BLAKE2b-256 379c495a847a2a2c8ddff818770575845db52089a480c213d300ea589e97518a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page