Extract, transform, and structure data from Excel files including multiple sheets, formulas, and formatting. Use when processing Excel data or converting to other formats. This skill provides Excel data extraction: - Multiple sheet reading - Data structuring (JSON/CSV conversion) - Formula evaluation - Cell formatting extraction - Large file handling with chunking Triggers: "extract Excel data", "read spreadsheet", "convert Excel to JSON", "convert Excel to CSV", "Excel解析", "スプレッドシート処理", "データ抽出"
View on GitHubtakemi-ohama/ai-agent-marketplace
ndf
January 18, 2026
Select agents to install to:
npx add-skill https://github.com/takemi-ohama/ai-agent-marketplace/blob/main/plugins/ndf/skills/scanner-excel-extraction/SKILL.md -a claude-code --skill scanner-excel-extractionInstallation paths:
.claude/skills/scanner-excel-extraction/# Scanner Excel Extraction Skill
## 概要
このSkillは、scannerエージェントがExcelファイルからデータを抽出し、構造化されたフォーマット(JSON、CSV)に変換する際に使用します。複数シート、数式、書式設定に対応しています。
## 主な機能
1. **複数シート読み込み**: すべてのシートを一括処理
2. **データ構造化**: JSON/CSV形式に変換
3. **数式評価**: セルの数式を計算値に変換
4. **書式情報抽出**: セルの色、太字等の書式
5. **大容量ファイル対応**: チャンク処理でメモリ効率化
## 使用方法
### スクリプト
```bash
python scripts/extract-excel.py <excel-path> [options]
```
**オプション**:
- `--output=json`: JSON形式で出力(デフォルト)
- `--output=csv`: CSV形式で出力(各シートごと)
- `--sheet=<name>`: 特定のシートのみ抽出
- `--evaluate-formulas`: 数式を計算値に変換
**使用例**:
```bash
# 全シートをJSONに変換
python scripts/extract-excel.py data.xlsx --output=json
# 特定シートのみCSVに変換
python scripts/extract-excel.py data.xlsx --sheet="Sheet1" --output=csv
# 数式を評価して出力
python scripts/extract-excel.py data.xlsx --evaluate-formulas
```
## 出力形式
### JSON形式
```json
{
"Sheet1": [
{"id": 1, "name": "Product A", "price": 1000},
{"id": 2, "name": "Product B", "price": 2000}
],
"Sheet2": [
{"category": "Electronics", "count": 10}
]
}
```
### CSV形式
複数シートの場合、各シートごとにCSVファイルを生成:
- `data_Sheet1.csv`
- `data_Sheet2.csv`
## スクリプト詳細
### extract-excel.py
Excelファイルを読み込み、構造化されたデータに変換します。
**必要なライブラリ**:
```bash
pip install pandas openpyxl xlrd
```
**コード概要**:
```python
import pandas as pd
import json
def extract_excel(file_path, output_format='json', evaluate_formulas=False):
# Excelファイルを読み込み
excel_file = pd.ExcelFile(file_path)
data = {}
for sheet_name in excel_file.sheet_names:
# 各シートを読み込み
df = pd.read_excel(
file_path,
sheet_name=sheet_name,
# 数式を評価するかどうか
engine='openpyxl' if evaluate_formulas else 'xlrd'
)
if output_format == 'json':
# JSON形式に変換
data[sheet_name] = df.to_dict(orient='records')
elif output_format == 'csv':
# CSV形式で保存
df.to_csv(f'{file_path.stem}_{sheet_name}.csv', index=False)
if output_format == 'json':
# JSONファイルに保存
with