Skip to main content

View Office files in the terminal

Project description

officecat 🐱

PyPI CI Python License: MIT

A CLI tool to view Office files in the terminal. Think cat but for .docx, .pptx, .xlsx, .csv, and .tsv files.

Every supported format is converted to markdown internally, then rendered through a single unified pipeline.

Installation

pip install officecat

Or install from source:

git clone https://github.com/mubbie/officecat.git
cd officecat
pip install -e .

Usage

officecat report.docx              # colored formatted output (default)
officecat budget.xlsx              # spreadsheet as markdown table
officecat slides.pptx              # presentation content
officecat data.csv                 # CSV and TSV
officecat report.docx --tui        # interactive full-screen viewer
officecat budget.xlsx | head       # plain text (auto-detected pipe)
officecat slides.pptx --json       # JSON output
officecat --version                # show version
officecat update                   # update to latest version

Files must be local. OneDrive/SharePoint files that are "cloud-only" (not synced) will fail to open. Right-click the file and choose "Always keep on this device" to sync it first.

Output Modes

  • Rich (default): Colored, formatted output to stdout. Works with less -R.
  • TUI (--tui): Full-screen interactive viewer with scrolling.
  • Plain (auto when piped, or --plain): Raw markdown for piping to grep, head, awk.
  • JSON (--json): {"source": "...", "markdown": "..."} for scripting.

Options

Flag Short Description
--tui -t Interactive full-screen viewer
--plain -p Raw markdown text, no colors
--json -j JSON output
--head N -n N Show first N lines
--sheet S -s S Select sheet by name or 1-based index (xlsx only)
--slide N Show only slide N (pptx only)
--headers N -h N Promote row N as headers (xlsx/csv, default: 1, 0 to disable)
--all -a Disable the default 500-row cap
--version -v Show version

TUI Key Bindings

Key Action
q Quit
Up / Down Scroll
PgUp / PgDn Page scroll
Home / End Jump to top/bottom

Examples

# Quick view of a document
officecat report.docx

# Browse interactively
officecat report.docx --tui

# Specific sheet
officecat budget.xlsx --sheet "Q4 Summary"

# Specific slide
officecat deck.pptx --slide 3

# First 10 lines
officecat budget.xlsx --head 10

# JSON output
officecat report.docx --json | jq '.markdown'

# Pipe to grep
officecat data.xlsx --plain | grep "revenue"

# Self-update
officecat update

Supported Formats

  • Word (.docx): headings, paragraphs, lists, tables in document order
  • PowerPoint (.pptx): slides, shapes, images, speaker notes, hidden slides
  • Excel (.xlsx): all sheets, row cap, header promotion
  • CSV (.csv): auto-delimited
  • TSV (.tsv): tab-delimited

Legacy binary formats (.doc, .ppt, .xls) show a conversion hint.

Known Limitations

  • Files must be local. Remote/cloud-only files (OneDrive, SharePoint) need to be synced first.
  • All content is rendered as markdown. Spreadsheet tables are markdown tables, not interactive grids.
  • DOCX list detection is style-name-based and may miss custom list styles.
  • PPTX grouped shapes and embedded tables show as placeholders.
  • PPTX charts and SmartArt are not extracted.
  • XLSX formulas show cached/computed values, not formula strings.
  • Large spreadsheets are capped at 500 rows by default. Use --all to show everything.
  • TUI enforces a 1000-line cap with --all for performance. Use --plain for full output.
  • No decryption of password-protected files.
  • Legacy binary formats (.doc, .ppt, .xls) are not supported.

License

MIT

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

officecat-0.2.2.tar.gz (142.7 kB view details)

Uploaded Source

Built Distribution

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

officecat-0.2.2-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file officecat-0.2.2.tar.gz.

File metadata

  • Download URL: officecat-0.2.2.tar.gz
  • Upload date:
  • Size: 142.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for officecat-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d88efb4523452a15727b5645f33df6985d3c87b84f187859a3c2d755526ba1b6
MD5 c515fb9d4be91661a407ef083e0a8b29
BLAKE2b-256 c13ac407ae66c6f57087cd694d5fab6600d3e328d91dbd4dbd7e1618430f774a

See more details on using hashes here.

Provenance

The following attestation bundles were made for officecat-0.2.2.tar.gz:

Publisher: release.yml on mubbie/officecat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file officecat-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: officecat-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for officecat-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3adfba4a368de777f427fee784419c51d8690d41e65a58f13cc024d2efeca23d
MD5 fe86f27161b51a2d8c59ae216bf8f158
BLAKE2b-256 2a222c069524c4a8cdf486610d8a358ee9a630f025f98babe2db8ca9fd532efc

See more details on using hashes here.

Provenance

The following attestation bundles were made for officecat-0.2.2-py3-none-any.whl:

Publisher: release.yml on mubbie/officecat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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