Skip to content
Back to skills

Girth Pdf Excel Diff

ASecurity

Use when comparing an old PDF table backup against a current Excel file to report deleted and modified records as JSON.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentspython

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add mohessaid/girth --skill girth-pdf-excel-diff --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Girth Pdf Excel Diff?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Girth Pdf Excel Diff
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mohessaid-girth-pdf-excel-diff/badge)](https://www.skillsdirectory.com/skills/mohessaid-girth-pdf-excel-diff)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: girth-pdf-excel-diff
description: Use when comparing an old PDF table backup against a current Excel file to report deleted and modified records as JSON.
metadata:
  girth:
    sources:
      - path-or-repo: pdf
        sections: [pdfplumber - Text and Table Extraction, Extract Tables, Advanced Table Extraction]
      - path-or-repo: xlsx
        sections: [Editing existing Excel files, All Excel files]
    crafted_for: Extract employee table from old PDF, compare with current Excel, write diff_report.json of deleted and modified employees
    created: 2026-10-15
    last_used: 2026-10-15
---
## Extract PDF tables <!-- src: pdf#pdfplumber---text-and-table-extraction, pdf#extract-tables, pdf#advanced-table-extraction -->
```python
import pdfplumber, pandas as pd
rows = []
with pdfplumber.open("old.pdf") as pdf:
    for page in pdf.pages:
        for table in page.extract_tables():
            if table:
                rows.extend(table)
```
- Tables may span pages: the header row can repeat on each page, so drop repeated header rows.
- Build `pd.DataFrame(rows[1:], columns=rows[0])`. PDF cells are all strings: strip whitespace, convert numeric fields (e.g. Salary, Years, Score) to numbers.
- If `extract_tables()` returns nothing, fall back to `page.extract_text()` and split lines.

## Read the Excel file <!-- src: xlsx#all-excel-files, xlsx#editing-existing-excel-files -->
- Use `pandas.read_excel(path)` or `openpyxl.load_workbook(path)`; check `wb.sheetnames`. Read only; never modify the source files.
- Normalise both sides identically (strip strings, same dtypes, IDs as text like `EMP00002`) before comparing.

## Diff and report
- Index both by ID. Deleted = IDs in PDF but not in Excel. Ignore IDs only in Excel (additions) unless asked.
- Modified = for IDs in both, every column whose value differs: one entry per changed field `{id, field, old_value, new_value}`; old from PDF, new from Excel.
- Numeric fields as JSON numbers (int when whole, not "50020"; no numpy types, cast with `int()`/`float()`); text as strings.
- Sort `deleted_employees` and `modified_employees` by ID.
- Write with `json.dump(report, f, indent=2)` to the requested path; re-read it to verify.

## Record
After each deliverable, run the taste context's `made` command with its defining choices.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.