定制 kraenzle-ritter/spreadsheet-inspect 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kraenzle-ritter/spreadsheet-inspect

最新稳定版本:v1.0.0

Composer 安装命令:

composer create-project kraenzle-ritter/spreadsheet-inspect

包简介

CLI tool to inspect and analyze Excel/ODS spreadsheet files

README 文档

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

License

MIT License. See LICENSE for details.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固