Use when reading, creating, editing, merging, splitting, or extracting content from PDF files or Excel/spreadsheet files. Use when processing tabular data, building financial models in Excel, extracting text from scanned documents, or converting between document formats. Triggers: "PDF", "Excel", "spreadsheet", "xlsx", "pypdf", "pdfplumber", "reportlab", "openpyxl", "pandas", "document processing", "extract text from PDF", "merge PDF", "split PDF", "financial model", "OCR", "spreadsheet automation".
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Use when reading, creating, editing, merging, splitting, or extracting content from PDF files or Excel/spreadsheet files. Use when processing tabular data, building financial models in Excel, extracting text from scanned documents, or converting between document formats. Triggers: "PDF", "Excel", "spreadsheet", "xlsx", "pypdf", "pdfplumber", "reportlab", "openpyxl", "pandas", "document processing", "extract text from PDF", "merge PDF", "split PDF", "financial model", "OCR", "spreadsheet automation".
Document Processing
When to Use
User wants to read, create, edit, merge, split, rotate, watermark, or extract content from PDF files
User wants to open, read, edit, create, or format Excel/spreadsheet files (.xlsx, .xlsm, .csv, .tsv)
User needs to build a financial model, clean tabular data, or automate spreadsheet generation
User needs OCR on scanned documents or table extraction from PDFs
User asks to convert between document formats where the output is a PDF or spreadsheet file
When NOT to Use
Database ingestion pipelines or ETL workflows → use data-engineering
Log file parsing, monitoring dashboards, or structured log analysis → use observability
Primary deliverable is a Word document, HTML report, or standalone Python script
Google Sheets API integration (no local file involved)
Create PDFs from scratch (canvas or document flow)
pip install reportlab
pytesseract
OCR on scanned/image-only PDFs
pip install pytesseract pdf2image
Merge PDFs with pypdf
from pypdf import PdfWriter, PdfReader
writer = PdfWriter()
for pdf_file in ["doc1.pdf", "doc2.pdf", "doc3.pdf"]:
reader = PdfReader(pdf_file)
for page in reader.pages:
writer.add_page(page)
withopen("merged.pdf", "wb") as f:
writer.write(f)
Extract Table with pdfplumber
import pdfplumber
import pandas as pd
with pdfplumber.open("document.pdf") as pdf:
all_tables = []
for page in pdf.pages:
for table in page.extract_tables():
if table:
df = pd.DataFrame(table[1:], columns=table[0])
all_tables.append(df)
combined = pd.concat(all_tables, ignore_index=True)
combined.to_excel("extracted_tables.xlsx", index=False)
Create PDF with reportlab
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
from reportlab.lib.styles import getSampleStyleSheet
doc = SimpleDocTemplate("report.pdf", pagesize=letter)
styles = getSampleStyleSheet()
story = [
Paragraph("Report Title", styles['Title']),
Spacer(1, 12),
Paragraph("Body content goes here.", styles['Normal']),
]
doc.build(story)
ReportLab subscripts/superscripts: Never use Unicode characters (₀₁₂, ⁰¹²) — built-in fonts render them as black boxes. Use XML tags instead: H<sub>2</sub>O, x<super>2</super>.
OCR Pattern with pytesseract
import pytesseract
from pdf2image import convert_from_path
images = convert_from_path("scanned.pdf")
text = ""for i, image inenumerate(images):
text += f"--- Page {i+1} ---\n"
text += pytesseract.image_to_string(image) + "\n\n"print(text)
Warning: Loading with data_only=True then saving permanently replaces formulas with static values.
Formula-First Philosophy
Never hardcode computed values in Python — let Excel calculate them. The spreadsheet must recalculate when source data changes.
# WRONG
sheet["B10"] = df["Sales"].sum() # Hardcodes 5000# CORRECT
sheet["B10"] = "=SUM(B2:B9)"# Excel owns the calculation
sheet["C5"] = "=(C4-C2)/C2"# Growth rate as formula
sheet["D20"] = "=AVERAGE(D2:D19)"# Average as formula
Financial Model Color Coding
Color
RGB
Meaning
Blue text
0,0,255
Hardcoded inputs / scenario drivers
Black text
0,0,0
All formulas and calculations
Green text
0,128,0
Links to other worksheets in same workbook
Red text
255,0,0
External links to other files
Yellow background
255,255,0
Key assumptions needing attention
Number Formatting Standards
Type
Format
Example
Currency
$#,##0 with units in header
Revenue ($mm)
Zeros
$#,##0;($#,##0);-
Displays as −
Percentages
0.0%
12.5%
Multiples
0.0x
8.5x
Negatives
Parentheses
(123) not -123
Years
Text string
"2024" not 2,024
Formula Verification
Before building the full model, test 2–3 sample cell references manually. Then verify:
NaN handling: pd.notna(value) before writing references
Division by zero: wrap denominators (=IF(B5=0, 0, A5/B5))