Skip to main content

Align columns in ASCII tables

Project description

tablign

Aligns columns in your ASCII tables.

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.

Source Distribution

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tablign-0.3.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for tablign-0.3.2.tar.gz
Algorithm Hash digest
SHA256 ea4480fcb75f444b689cb3d3d748517e8ddae6aa5bc831777f07e56457cb68b2
MD5 85c3c8cccb0a65524df37fd9700863e8
BLAKE2b-256 2ff9bbafffdb33a779506d1a70678be62b94f4ca20aab3ff3839e15b70d85666

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tablign-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for tablign-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e765da87456d7f0fa1d52020a498f888e5dfae31223c643ecc06cc1632986ffa
MD5 e212d9c38731e2b200bdf6a1eed673fd
BLAKE2b-256 79b0da0429fd9124f6b67f04c0cd5fb4a98b5e4ba4820929b801aa03e619259e

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