用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/taracodlabs/aiden --skill ocr-and-documents命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | ocr-and-documents |
| description | Extract text from PDFs, images, scans, and Word documents using Python libraries and CLI tools |
| category | productivity |
| version | 1.0.0 |
| origin | aiden |
| license | Apache-2.0 |
| tags | ocr, pdf, image, text-extraction, documents, docx, scan, pymupdf, tesseract, pdf-parse |
Extract readable text from PDFs, scanned images, and Word documents using Python libraries available in most environments. No cloud API required.
.docx Word document programmaticallyimport fitz # pip install pymupdf
doc = fitz.open("document.pdf")
text = "\n\n".join(page.get_text() for page in doc)
print(text[:2000]) # preview first 2000 chars
doc.close()
// requires: npm install pdf-parse (already in DevOS dependencies)
const pdfParse = require('pdf-parse')
const fs = require('fs')
const data = await pdfParse(fs.readFileSync('document.pdf'))
console.log(data.text.slice(0, 2000))
console.log(`Pages: ${data.numpages}`)
Requires Tesseract installed: winget install UB-Mannheim.TesseractOCR
import pytesseract # pip install pytesseract
from PIL import Image # pip install Pillow
img = Image.open("scan.png")
text = pytesseract.image_to_string(img, lang="eng")
print(text)
import pytesseract
from PIL import Image, ImageFilter, ImageOps
img = Image.open("scan.jpg")
img = ImageOps.grayscale(img)
img = img.filter(ImageFilter.SHARPEN)
img = img.point(lambda p: 255 if p > 128 else 0) # binarize
text = pytesseract.image_to_string(img, config="--psm 6")
print(text)
from docx import Document # pip install python-docx
doc = Document("report.docx")
paras = [p.text for p in doc.paragraphs if p.text.strip()]
text = "\n".join(paras)
print(text)
import fitz
doc = fitz.open("big_report.pdf")
pages = range(4, 9) # pages 5-9 (0-indexed)
text = "\n\n".join(doc[i].get_text() for i in pages)
print(text)
import pdfplumber # pip install pdfplumber
with pdfplumber.open("financial_report.pdf") as pdf:
for page in pdf.pages:
for table in page.extract_tables():
for row in table:
print("\t".join(str(cell or "") for cell in row))
"Read the text from this PDF contract" → Use step 1 (pymupdf) or step 2 (pdf-parse) depending on whether Python or Node is preferred.
"Extract the table from page 3 of this quarterly report PDF"
→ Use step 7 (pdfplumber) targeting pdf.pages[2] for page 3.
"Read the text from this scanned invoice image" → Use step 3 or 4 (Tesseract). For low-quality scans, use step 4 with preprocessing.
fitz) extracts only programmatically embedded text — it won't OCR scanned pageslang="hin" for Hindi, "deu" for German