kraenzle-ritter/spreadsheet-inspect

CLI tool to inspect and analyze Excel/ODS spreadsheet files

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:project

pkg:composer/kraenzle-ritter/spreadsheet-inspect

v1.0.0 2026-02-16 10:49 UTC

This package is auto-updated.

Last update: 2026-02-16 11:03:30 UTC


README

Tests License: MIT PHP Version Downloads

A CLI tool to inspect Excel (.xlsx, .xls) and LibreOffice (.ods) spreadsheet files. Analyze sheet structures, column statistics, find cross-sheet references, and extract embedded images.

Features

  • πŸ“Š Sheet Analysis – List all sheets, view column headers, row counts, and fill rates
  • πŸ“ˆ Value Statistics – See distinct values per column with occurrence counts
  • πŸ”— Cross-Sheet Reference Check – Find where values from one sheet appear in others
  • πŸ–ΌοΈ Image Inspection – Count and extract embedded images/drawings
  • πŸ“ Multiple Formats – Supports Excel (.xlsx, .xls) and LibreOffice Calc (.ods)

Installation

Download PHAR (recommended)

Download the latest release:

curl -L https://github.com/kraenzle-ritter/spreadsheet-inspect/releases/latest/download/spreadsheet-inspect -o spreadsheet-inspect
chmod +x spreadsheet-inspect

Optionally move to your PATH:

sudo mv spreadsheet-inspect /usr/local/bin/

From Source

git clone https://github.com/kraenzle-ritter/spreadsheet-inspect.git
cd spreadsheet-inspect
composer install

Usage

Note: Replace php inspect with spreadsheet-inspect if using the PHAR.

List all sheets

php inspect spreadsheet myfile.xlsx --sheets

Analyze a specific sheet

php inspect spreadsheet myfile.xlsx --sheet=1
# or by name
php inspect spreadsheet myfile.xlsx --sheet="Sheet Name"

Output:

## Available sheets
- **[1]** `Products`
- **[2]** `Categories`

# Sheet `Products` (Index: 1)

## Sheet statistics
- **Rows** (excluding header): `150`

### `ProductID`
- **Filled**: `150 / 150` (100%)
- **Distinct**: `150`

### `Category`
- **Filled**: `148 / 150` (98.67%)
- **Distinct**: `12`

  Values:
  - `Electronics` (45)
  - `Clothing` (32)
  ...

Analyze images in a sheet

php inspect spreadsheet myfile.xlsx --sheet=1 --images

Extract images to a directory

php inspect spreadsheet myfile.xlsx --sheet=1 --extract-images=./images

Cross-sheet reference check

Find where values from a column appear in other sheets:

php inspect spreadsheet myfile.xlsx --sheet=1 --column=ProductID

Check against a specific target sheet:

php inspect spreadsheet myfile.xlsx --sheet=1 --column=ProductID --cross-sheet=2

Compare only against a specific column in target sheets:

php inspect spreadsheet myfile.xlsx --sheet=1 --column=ProductID --target-column=ID

Options

Option Description
--sheets List all sheet names only
--sheet= Inspect a specific sheet (by index or name)
--column= Cross-search for values from this column
--cross-sheet= Only check this target sheet
--target-column= Only compare against this column in target sheets
--images Count and list images in the sheet
--extract-images= Extract images to specified directory
--output= Output format: console (default), html, pdf
--output-file= Output file path (required for html/pdf)
--debug Show detailed matching values
--memory= Memory limit in MB (default: 2000)

Export to HTML or PDF

Generate a styled HTML report:

php inspect spreadsheet myfile.xlsx --sheet=1 --output=html --output-file=report.html

Generate a PDF report:

php inspect spreadsheet myfile.xlsx --sheet=1 --output=pdf --output-file=report.pdf

Supported Formats

  • Microsoft Excel: .xlsx, .xls
  • LibreOffice Calc: .ods

Requirements

  • PHP 8.3+
  • Composer

Testing

./vendor/bin/pest

Built With

  • Laravel Zero – Micro-framework for console applications
  • PhpSpreadsheet – Library for reading/writing spreadsheet files
  • FastExcel – Fast Excel import/export
  • Dompdf – HTML to PDF converter

License

MIT License. See LICENSE for details.