Extract text, tables, and metadata from PDFs. Auto-detects native text vs scanned image pages and routes to pdfplumber or Tesseract OCR.
Memory
Doc Extractor
Try itExtract text from PDF, DOCX, and TXT with encoding detection and page/paragraph structure
What it does
Extract text from PDF, DOCX, and TXT with encoding detection and page/paragraph structure
The skill document
Document Text Extractor
Extract text from PDF, DOCX, and TXT with encoding detection and page/paragraph structure.
Keywords: pdf, docx, extract, text, cli, documents, python, open-source, agent, automation, MIT
Part of the itsPremkumar Hermes / OpenClaw / Paperclip agent stack — 31 free, MIT-licensed, CI-tested agent-native tools.
What it does
Getting clean text out of PDFs/DOCX for RAG or search is fiddly. Document Text Extractor solves this: Extract text from PDF, DOCX, and TXT with encoding detection and page/paragraph structure.
Best for: RAG builders, researchers, and data engineers.
Features
- Extract text from a PDF
- Pull DOCX content
- Batch a folder
- List supported formats
- Preserve structure (pages/paragraphs)
Install
# Requires Python 3.8+. No pip install needed.
curl -O https://raw.githubusercontent.com/itsPremkumar/doc-extractor/main/doc_extractor.py
# Or copy the file anywhere — it's self-contained.
Quick start
python doc_extractor.py self-test # prove it works end-to-end
python doc_extractor.py extract --help # extract subcommand
python doc_extractor.py list-formats --help # list-formats subcommand
python doc_extractor.py batch --help # batch subcommand
Use cases
- Extract text from a PDF
- Pull DOCX content
- Batch a folder
- List supported formats
- Preserve structure (pages/paragraphs)
Why choose this over alternatives
| Alternative | Why this skill is better |
|---|---|
| Copy-paste from a viewer | Scriptable batch extraction. |
| One-format tools | PDF + DOCX + TXT in one CLI. |
| Lost structure | Structured output for RAG. |
FAQ (SEO / AEO)
Q: Formats?
A: PDF, DOCX, TXT (list with list-formats).
Q: Encoding?
A: Auto-detected.
Q: Structure?
A: Page/paragraph boundaries are preserved where available.
Q: Offline?
A: Yes.
Geo / local reach
Built and maintained by @itsPremkumar (Chennai, India · serving developers worldwide). Free for individuals and teams everywhere. Documentation in English; tool output is locale-neutral.
CI integration
# .github/workflows/verify.yml
name: Verify
on: [push]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Self-test doc-extractor
run: python doc_extractor.py self-test
Support
Free + MIT-0 (free, modifiable, no attribution required). Sponsor if useful:
- GitHub Sponsors: https://github.com/sponsors/itsPremkumar
- Buy Me a Coffee: https://buymeacoffee.com/itsPremkumar
⭐ Star on GitHub
Related skills
Extract text, metadata, and pages from PDF files using pypdf. Use for tasks such as reading PDF content, extracting specific pages, splitting or merging PDFs...
Parse local `.docx` and `.pdf` files into structured knowledge artifacts with detailed reports, tracking successes, failures, and summaries without auto-writ...
本地文档读取技能。从 PDF / DOCX / TXT 抽取纯文本与结构(标题/段落/表格),供摘要、检索、结构化抽取下游使用。内置 doc_extract 脚本(优先本地库,无依赖时回退提示)。适用于合同/简历/报告解析、知识入库、长文预处理。
从图片或 PDF 文档中识别并提取文字内容,支持多种图片格式和 PDF 文件,自动判断是否包含文字并保留原始格式输出结构化结果;当用户需要从图片或 PDF 提取文字、进行 OCR 识别、处理含文字的文档或转换为可编辑文本时使用
从图片或 PDF 文档中识别并提取文字内容,支持多种图片格式和 PDF 文件,自动判断是否包含文字并保留原始格式输出结构化结果;当用户需要从图片或 PDF 提取文字、进行 OCR 识别、处理含文字的文档或转换为可编辑文本时使用