Skip to main content

Align columns in ASCII tables

Project description

gh-actions codecov Code style: black awesome PyPI pyversions PyPi Version GitHub stars PyPi downloads

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.

Files for tablign, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size tablign-0.3.2-py3-none-any.whl (16.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tablign-0.3.2.tar.gz (17.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page