ホーム/数据分析/pdf-processing
P

pdf-processing

by @davila7v
4.6(36)

pdfplumberライブラリを使用してPDFドキュメントからテキストコンテンツを抽出します。AIエージェントスキルとして、作業効率と自動化能力を向上させます。

PDF ParsingDocument Data ExtractionData PreprocessingText MiningDocument AutomationGitHub
インストール方法
npx skills add davila7/claude-code-templates --skill pdf-processing
compare_arrows

Before / After 効果比較

1
使用前

従来のPDFテキスト抽出ツールでは、書式が乱れたり、表データがずれたりする問題が頻繁に発生し、大量の手動調整とクリーンアップが必要でした。これは時間と手間がかかり、エラーも発生しやすく、大規模なデータ分析には不向きでした。

使用後

pdfplumberライブラリを活用することで、PDFドキュメントから表や段落を含む構造化されたテキストを正確に抽出できます。これにより、データ抽出の精度と自動化のレベルが大幅に向上し、データ分析プロセスが加速されます。

description SKILL.md

pdf-processing

PDF Processing

Quick start

Use pdfplumber to extract text from PDFs:

import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    text = pdf.pages[0].extract_text()
    print(text)

Extracting tables

Extract tables from PDFs with automatic detection:

import pdfplumber

with pdfplumber.open("report.pdf") as pdf:
    page = pdf.pages[0]
    tables = page.extract_tables()

    for table in tables:
        for row in table:
            print(row)

Extracting all pages

Process multi-page documents efficiently:

import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    full_text = ""
    for page in pdf.pages:
        full_text += page.extract_text() + "\n\n"

    print(full_text)

Form filling

For PDF form filling, see FORMS.md for the complete guide including field analysis and validation.

Merging PDFs

Combine multiple PDF files:

from pypdf import PdfMerger

merger = PdfMerger()

for pdf in ["file1.pdf", "file2.pdf", "file3.pdf"]:
    merger.append(pdf)

merger.write("merged.pdf")
merger.close()

Splitting PDFs

Extract specific pages or ranges:

from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()

# Extract pages 2-5
for page_num in range(1, 5):
    writer.add_page(reader.pages[page_num])

with open("output.pdf", "wb") as output:
    writer.write(output)

Available packages

  • pdfplumber - Text and table extraction (recommended)

  • pypdf - PDF manipulation, merging, splitting

  • pdf2image - Convert PDFs to images (requires poppler)

  • pytesseract - OCR for scanned PDFs (requires tesseract)

Common patterns

Extract and save text:

import pdfplumber

with pdfplumber.open("input.pdf") as pdf:
    text = "\n\n".join(page.extract_text() for page in pdf.pages)

with open("output.txt", "w") as f:
    f.write(text)

Extract tables to CSV:

import pdfplumber
import csv

with pdfplumber.open("tables.pdf") as pdf:
    tables = pdf.pages[0].extract_tables()

    with open("output.csv", "w", newline="") as f:
        writer = csv.writer(f)
        for table in tables:
            writer.writerows(table)

Error handling

Handle common PDF issues:

import pdfplumber

try:
    with pdfplumber.open("document.pdf") as pdf:
        if len(pdf.pages) == 0:
            print("PDF has no pages")
        else:
            text = pdf.pages[0].extract_text()
            if text is None or text.strip() == "":
                print("Page contains no extractable text (might be scanned)")
            else:
                print(text)
except Exception as e:
    print(f"Error processing PDF: {e}")

Performance tips

  • Process pages in batches for large PDFs

  • Use multiprocessing for multiple files

  • Extract only needed pages rather than entire document

  • Close PDF objects after use

Weekly Installs0Repositorydavila7/claude-…emplatesGitHub Stars23.1KFirst SeenJan 1, 1970Security AuditsGen Agent Trust HubPassSocketPassSnykPass

forumユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数1.0K
評価4.6 / 5.0
バージョン
更新日2026年3月17日
比較事例1 件

ユーザー評価

4.6(36)
5
0%
4
0%
3
0%
2
0%
1
0%

この Skill を評価

0.0

対応プラットフォーム

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

タイムライン

作成2026年3月17日
最終更新2026年3月17日