Skip to main content

A sleek terminal syntax highlighting file viewer.

Project description

catr

A sleek terminal syntax highlighting file viewer — like cat, but prettier.

catr displays file contents in your terminal with full syntax highlighting, line numbers, file metadata, and a clean formatted layout powered by Pygments.


Features

  • Syntax highlighting for hundreds of languages (Python, C, JavaScript, YAML, and more)
  • Line numbers with aligned gutter
  • File metadata — filename, size in bytes, and total line count
  • Binary file detection — gracefully handles non-text files
  • Colorized output using true-color terminal support
  • Works as a global CLI command after installation

Installation

pip install catr

Or install from source:

git clone https://github.com/your-username/catr.git
cd catr
pip install .

Dependencies

Usage

catr <file_path>

Examples

catr src/catr/catr.py
catr README.md
catr config.yaml

Sample Output

────────────────────────────────────────────────────────────────────────────────────────────────────
    catr.py (2048 bytes) | 72 lines
────────────────────────────────────────────────────────────────────────────────────────────────────
 1 │ import sys
 2 │ from pygments import highlight
 3 │ ...
────────────────────────────────────────────────────────────────────────────────────────────────────
: < END OF FILE >
════════════════════════════════════════════════════════════════════════════════════════════════════

Requirements


Project Structure

catr/
├── src/
│   └── catr/
│       ├── __init__.py
│       └── catr.py
├── pyproject.toml
└── README.md

License

See LICENSE for details.


Author

Juan Jose Solorzano Carrillojuanjose.solorzano.c@gmail.com

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

catr-1.4.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

catr-1.4.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file catr-1.4.0.tar.gz.

File metadata

  • Download URL: catr-1.4.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for catr-1.4.0.tar.gz
Algorithm Hash digest
SHA256 e421c84fe06faef48b407316249722aa6ce97abc2ced4754b371e46a494c288f
MD5 817626ceaea9fd850a50bc67e92d51e9
BLAKE2b-256 06b7bdbe267100c91aad8da43c44db9f216fcac6fca55509a10b46203400bbe9

See more details on using hashes here.

File details

Details for the file catr-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: catr-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for catr-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61fef881d910225dff3e9dd526ba25b5753bc577076df3230b903a7832f57be6
MD5 b44b45a92192f65834bdc32adfe6b233
BLAKE2b-256 fda436ac842ab955a3590fa2fe2561295092d0e406156dd0991bc25ec8e68145

See more details on using hashes here.

Supported by

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