Extract structured data from scanned check deposit PDFs. Reads payer name, address, phone, email, payee, amount, date, check number, and memo from bank check images. Handles personal checks, bill-pay remittance checks, and cash deposit slips. Use this skill whenever the user uploads a PDF of scanned checks, mentions check deposits, check images, bank deposit scans, or wants to reconcile check deposit data. Also trigger when the user asks to read, OCR, or extract data from checks, or when processing donation deposit records.
Extract structured payment data from scanned check deposit PDFs. These PDFs typically come from bank imaging systems and contain front-and-back scans of deposited checks arranged in a grid layout, sometimes several per page.
Trigger on any of these signals:
The extraction uses a two-phase approach:
Segmentation — A Python script (scripts/extract_checks.py) converts
each PDF page to images, detects individual check regions using contour
analysis, runs OCR, and saves everything into a working directory.
Visual extraction — You (Claude) examine each check image using your vision capability, cross-reference with OCR text, and produce structured JSON and CSV output for each check.
This two-phase design matters because OCR alone is unreliable on handwritten checks and complex bank layouts, but provides useful supplementary data — especially for MICR line numbers and machine-printed fields.
python3 <skill_path>/scripts/extract_checks.py "<input_pdf>" "<output_dir>" --dpi 300
<input_pdf> — the uploaded check scan PDF<output_dir> — a working directory (e.g., ./check_extraction/)The script installs its own dependencies and produces:
page_N.png — full page imagescheck_NNN.png — cropped individual check/deposit imagescheck_NNN_ocr.txt — Tesseract OCR text for each itemcheck_NNN_payer_detail.png — zoomed 2x crop of the payer region (top-left of check)check_NNN_payer_ocr.txt — OCR of the zoomed payer regioncheck_NNN_amount_detail.png — zoomed 2x crop of the amount/date region (top-right)check_NNN_amount_ocr.txt — OCR of the zoomed amount regionmanifest.json — metadata including auto-detected document type and detail crop infoIf the script fails (unusual layout), fall back to viewing the full page image and manually identifying checks.
For each entry in manifest.json:
_payer_detail.png) — this 2x-upscaled
image of the top-left region is where payer name, address, and phone live.
On bill-pay checks especially, this text is often very small in the full
check image but readable in the zoomed crop._payer_ocr.txt) for supplementary text.check_NNN.png) for overall context, payee,
memo, and any fields not in the detail crops._ocr.txt) for MICR line numbers and deposit strip data._amount_detail.png if the amount or date is unclear.| Field | Where to find it |
|---|---|
| Payer name | Upper-left of personal checks. On bill-pay checks, the "Account:" line at top, or the name/address block on the left. |
| Payer address | Below payer name: street, city, state, ZIP — typically 2-3 lines. |
| Payer phone | Sometimes below address or in "Direct Any Questions To" section. Often absent. |
| Payer email | Rarely present. Only extract if clearly visible. |
| Payee name | After "Pay to the order of" or "TO / THE ORDER OF". |
| Check amount | Numerical amount in the amount box AND the written-out dollar line. Cross-check these match. |
| Check date | Upper-right area of the check. |
| Check number | Upper-right corner (personal) or header area (bill-pay). Confirm against MICR line at bottom. |
| Check memo | Lower-left, after "MEMO:" or "For:". |
Checks often list one or two people (e.g., a married couple or business partners). When there are two name lines, follow these conventions:
payer_name field, separated by " & "
(e.g., "Robert John March II & Carolyn T March").Standard checks with pre-printed payer name and address in upper-left. Check number in upper-right. May have handwritten amounts, dates, payees.
Bank-issued on behalf of a payer. Key traits:
Even when the Account field shows "PAYMENT" or "NO ACCOUNT NUMBER", the
payer name and address are almost always printed below the Account line
in the top-left block of the check. This text is often small and hard to read
in the full check image — always check the _payer_detail.png zoomed crop
and _payer_ocr.txt first. The payer block may contain one or two personal
names (e.g., "ROBERT JOHN MARCH" / "CAROLYN T MARCH") or a business name.
If the payer name is still not visible after checking the zoomed crop, then note it for manual identification.
Labeled "CASH IN - DEBIT" — these represent cash deposits, not checks.
cash_deposit typeMany scans include the check's back (endorsement stamps). These are NOT separate checks. Look for deposit stamps, dates, and bank info. Note relevant details on the corresponding front-side record.
Create extracted_checks.json in the output directory:
[
{
"check_id": "check_001",
"type": "personal_check | bill_pay_check | cash_deposit",
"payer_name": "Full Name",
"payer_address": "Full address on one line",
"payer_phone": "Phone number",
"payer_email": null,
"payee_name": "Payee name",
"check_amount": 300.00,
"check_date": "YYYY-MM-DD",
"check_number": "Number as string",
"check_memo": "Memo text",
"bank": "Issuing bank name",
"notes": "Observations, uncertainties, special circumstances"
}
]
Output rules:
null for genuinely absent fields. Never guess or fabricate.YYYY-MM-DD.notes.Also create extracted_checks.csv with headers:
check_id,type,payer_name,payer_address,payer_phone,payer_email,payee_name,check_amount,check_date,check_number,check_memo,bank,notes
Summarize for the user:
If the user wants to reconcile against donation records, offer to help
match — see references/reconciliation_tips.md.
--dpi to 400, or view the full page
image and segment manually.notes field, extract what's visible.