Skip to main content

tcat

tcat is an extremely simple command-line tool for peeking at tabular data in the terminal.

It works like cat, but it

  • will always try to render consistently delimited data files with aligned/straightened columns
  • does word wrapping if necessary to try to fit the whole table inside the given terminal's width
  • works with tabs and commas
  • accepts standard input as an alternative to a file by filename

Install locally

./install_locally.sh

Install from PyPI

pip install tcatlib

Examples

A whole file.

tcat sample_data/amtrak_station_info.tsv

...

│ Worcester                            │ WOR                 │ Worcester            │ MA                     │
├──────────────────────────────────────┼─────────────────────┼──────────────────────┼────────────────────────┤
│ Yazoo City                           │ YAZ                 │ Yazoo City           │ MS                     │
├──────────────────────────────────────┼─────────────────────┼──────────────────────┼────────────────────────┤
│ Yemassee                             │ YEM                 │ Yemassee             │ SC                     │
├──────────────────────────────────────┼─────────────────────┼──────────────────────┼────────────────────────┤
│ Yonkers                              │ YNY                 │ Yonkers              │ NY                     │
├──────────────────────────────────────┼─────────────────────┼──────────────────────┼────────────────────────┤
│ Yuma                                 │ YUM                 │ Yuma                 │ AZ                     │
╘══════════════════════════════════════╧═════════════════════╧══════════════════════╧════════════════════════╛

A snippet sent to standard input.

head -n5 sample_data/amtrak_station_info.tsv | tcat

╒═══════════════════╤═════════════════════╤════════════╤════════════════════════╕
│ Name              │ AMTRAK station code │ City name  │ State or district code │
├───────────────────┼─────────────────────┼────────────┼────────────────────────┤
│ Aberdeen          │ ABE                 │ Aberdeen   │ MD                     │
├───────────────────┼─────────────────────┼────────────┼────────────────────────┤
│ Albany            │ ALY                 │ Albany     │ OR                     │
├───────────────────┼─────────────────────┼────────────┼────────────────────────┤
│ Albany-Rensselaer │ ALB                 │ Rensselaer │ NY                     │
├───────────────────┼─────────────────────┼────────────┼────────────────────────┤
│ Albion            │ ALI                 │ Albion     │ MI                     │
╘═══════════════════╧═════════════════════╧════════════╧════════════════════════╛

Comma delimiter.

head -n5 sample_data/amtrak_station_info.csv | tcat

╒═══════════════════╤═════════════════════╤════════════╤════════════════════════╕
│ Name              │ AMTRAK station code │ City name  │ State or district code │
├───────────────────┼─────────────────────┼────────────┼────────────────────────┤
│ Aberdeen          │ ABE                 │ Aberdeen   │ MD                     │
├───────────────────┼─────────────────────┼────────────┼────────────────────────┤
│ Albany            │ ALY                 │ Albany     │ OR                     │
├───────────────────┼─────────────────────┼────────────┼────────────────────────┤
│ Albany-Rensselaer │ ALB                 │ Rensselaer │ NY                     │
├───────────────────┼─────────────────────┼────────────┼────────────────────────┤
│ Albion            │ ALI                 │ Albion     │ MI                     │
╘═══════════════════╧═════════════════════╧════════════╧════════════════════════╛

Wrapped example.

╒════════════╤════════════════╤════════════╤═══════════════╕
│ Name       │ AMTRAK station │ City name  │ State or      │
│            │ code           │            │ district code │
├────────────┼────────────────┼────────────┼───────────────┤
│ Aberdeen   │ ABE            │ Aberdeen   │ MD            │
├────────────┼────────────────┼────────────┼───────────────┤
│ Albany     │ ALY            │ Albany     │ OR            │
├────────────┼────────────────┼────────────┼───────────────┤
│ Albany-    │ ALB            │ Rensselaer │ NY            │
│ Rensselaer │                │            │               │
├────────────┼────────────────┼────────────┼───────────────┤
│ Albion     │ ALI            │ Albion     │ MI            │
╘════════════╧════════════════╧════════════╧═══════════════╛

Metadata

Release files for tcatlib 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tcatlib 1.0.1
File Interpreter ABI Platform
tcatlib-1.0.1-py3-none-any.whl Python 3 none any Details

Release files / tcatlib-1.0.1-py3-none-any.whl

Download URL tcatlib-1.0.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43f92d9c9d43c8747a771f4ac1858136a9b2b93ce241f6310d0a30f0f6f46c53
BLAKE2b-256 checksum
How to use checksums
ee08137834473f860b64b3edd930f5e96f5f89d6ec43e23cf372fedf48aac55d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for tcatlib 1.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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page