mcpField
R
read-bin-docs

read-bin-docs

github.com/yparesDocuments3058 installsUpdated today
Repository

About read-bin-docs

A skill for extracting text from PDF files using pypdf or its included command-line script. It supports page selection and file output, and notes that scanned PDFs need separate OCR tools.

Key features

  1. 01Extract text from PDF pages
  2. 02Select page ranges
  3. 03Write extracted text to a file
  4. 04Use pypdf or an included script
  5. 05Notes scanned PDF OCR limitation

Use cases

  1. 01Extract text from a text-based PDF
  2. 02Save selected pages as a text file
  3. 03Run PDF extraction from the command line

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ypares/agent-skills --skill read-bin-docs

After installing, type/read-bin-docsin Claude Code to confirm it loaded.

Bundled filesscripts/extract_pdf_text.py

Details

From the project README

Doc Formats

Quick Start: Extract Text from PDF

Need to extract text from a PDF? Use this Python snippet:

from pypdf import PdfReader

reader = PdfReader("document.pdf")
text = "".join(page.extract_text() for page in reader.pages)
print(text)

Or from the command line:

uvx --with pypdf python /path/to/extract_pdf_text.py document.pdf

PDF Text Extraction

Basic Usage
from pypdf import PdfReader

# Read all pages
reader = PdfReader("file.pdf")
for page in reader.pages:
    text = page.extract_text()
    print(text)
Extract Specific Pages
from pypdf import PdfReader

reader = PdfReader("file.pdf")
# Get pages 1-5 (0-indexed)
for page in reader.pages[0:5]:
    print(page.extract_text())
Using the Script

This skill includes scripts/extract_pdf_text.py for command-line extraction:

# Extract all pages to stdout
python extract_pdf_text.py document.pdf

# Extract to file
python extract_pdf_text.py document.pdf --output text.txt

# Extract specific pages
python extract_pdf_text.py document.pdf --pages 1-5
python extract_pdf_text.py document.pdf --pages 1,3,5
Requirements
  • pypdf: uvx --with pypdf python <script>
  • Works with most text-based PDFs
  • Scanned PDFs without OCR won't extract text

Common Issues

"No text extracted": The PDF may be scanned (image-based) without OCR. OCR support requires additional tools.

"Encoding errors": pypdf handles most encodings, but some PDFs may have encoding issues. Use page.extract_text(layout=True) for layout-aware extraction if available.


Future: Support for DOCX, XLSX, and other formats coming soon.

Comments

Markdown supported