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

Install with

pip install tablign
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

Alternatives

GNU's column command is a mighty alternative:

column -t

See here for more alternatives.

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.4.tar.gz (16.3 kB view hashes)

Uploaded Source

Built Distribution

tablign-0.3.4-py3-none-any.whl (16.9 kB view hashes)

Uploaded Python 3

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