视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
ocr-document【文档与办公】Extract text from PDFs, images, and scanned documents. Uses pymupdf (local) or optional cloud OCR APIs.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Extract text from PDFs, scanned images, and documents.
Best choice for text-based PDFs:
pip install pymupdf
import pymupdf
doc = pymupdf.open("file.pdf")
for page in doc:
text = page.get_text()
print(text)
# All pages at once
full_text = "\n".join(page.get_text() for page in doc)
High-quality conversion preserving structure:
pip install marker-pdf
marker_single file.pdf output_dir/ --output_format markdown
pip install surya-ocr
surya_ocr image.png --langs zh,en
# Install Tesseract engine first
brew install tesseract tesseract-lang # macOS
apt install tesseract-ocr tesseract-ocr-chi-sim # Linux
pip install pytesseract Pillow
import pytesseract
from PIL import Image
text = pytesseract.image_to_string(
Image.open("scan.png"),
lang="chi_sim+eng"
)
python3 scripts/extract_document.py document.pdf
python3 scripts/extract_document.py scan.png
python3 scripts/extract_document.py report.pdf --output extracted.txt
Auto-detects format by extension: PDF → pymupdf, DOCX → python-docx, Image → pytesseract.
OCR language is controlled by system Tesseract config (e.g., chi_sim+eng default).