360 Secure SkillHub
360 安全技能中心

Doc Extractor

一个自包含的 Python 命令行工具,用于从 PDF、DOCX、TXT 文档中提取纯文本,支持编码自动检测、页/段落结构保留、目录批量处理和格式列表查看,输出可写入文本文件,便于 RAG 或检索使用,声称可离线运行。

itspremkumar
itspremkumar
热度 15.00
最近更新 2026-07-13 17:58:39
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 数据处理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add doc-extractor
Metadata
name
doc-extractor
version
2.0.0
description
Extract text from PDF, DOCX, and TXT with encoding detection and page/paragraph structure
tags
["pdf","docx","extract","text","cli","documents","python","open-source","agent","automation","MIT"]

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

  1. Extract text from a PDF
  2. Pull DOCX content
  3. Batch a folder
  4. List supported formats
  5. 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:

⭐ Star on GitHub