Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

pdf-minerPDF miner 搜索

Agent Skill

pdf-miner 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,259

周安装

140

GitHub Stars

1

下载量

1,142
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pdf-miner(PDF miner 搜索)
来源仓库:https://github.com/baichenwzj/pdf-miner
安装命令:
openclaw skills install pdf-miner
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install pdf-miner

简介

pdf-miner 从 PDF 提取文本与表格,兼容全球市场数据格式。

  • 适用于金融报告、市场调研等结构化信息抽取场景。
  • 支持货币、百分比、单位等本地化表达识别。pdf-miner 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 使用前需确认 PDF 是否含混合语言,可能影响识别精度。
  • 建议结合正则表达式做后处理,提升特定字段提取成功率。

SKILL.md

name
pdf-miner
description
>-
Supports
keyword search, metrics extraction, table of contents detection, PDF

PDF Miner Skill

Extract text and tables from PDF files using pdfplumber (global market formats).

Prerequisites

python -m pip install pdfplumber

For OCR capabilities (scanned/image PDFs), also install:

python -m pip install pymupdf openai

Initial Setup for OCR

Before using --ocr, you must provide a vision API credential. There are three ways:

  1. Environment variables (recommended for temporary use):
   export OCR_API_KEY="your-openrouter-api-key"
   export OCR_MODEL="qwen/qwen3.6-plus:free"   # optional
   export OCR_BASE_URL="https://openrouter.ai/api/v1"   # optional
  1. Config file (persistent, skill-specific):

Create skills/skills/pdf-miner/config.json with:

   {
     "vision_api_key": "your-openrouter-api-key",
     "vision_model": "qwen/qwen3.6-plus:free",
     "vision_base_url": "https://openrouter.ai/api/v1"
   }
  1. Command-line arguments (override per invocation):
   python scripts/extract_pdf.py scanned.pdf --ocr --ocr-api-key "sk-..." --ocr-model "stepfun/step-3.5-flash:free"

Usage

Run commands from this skill directory.

Basic Extraction

# Full extraction (text + tables)
python scripts/extract_pdf.py input.pdf

# Output to custom path
python scripts/extract_pdf.py input.pdf output.md

# Specific pages
python scripts/extract_pdf.py input.pdf --pages 1-5,10,15-20

# Text or tables only
python scripts/extract_pdf.py input.pdf --text-only
python scripts/extract_pdf.py input.pdf --tables-only
python scripts/extract_pdf.py input.pdf --tables-only --json

Advanced Modes

# Search: find pages containing keywords with context
python scripts/extract_pdf.py report.pdf --search "Vietnam export penetration"

# Metrics: extract lines with keywords + numeric values
python scripts/extract_pdf.py report.pdf --metrics "market size growth export penetration"

# TOC: extract table of contents / chapter structure (robust, multi-format)
python scripts/extract_pdf.py report.pdf --toc
# Optionally adjust sensitivity (default: 3 entries per page required)
python scripts/extract_pdf.py report.pdf --toc --toc-min-entries 2

# Diff: compare two PDFs, show pages unique to each
python scripts/extract_pdf.py old_version.pdf new_version.pdf --diff

# Chunk: split output into LLM-friendly chunks
python scripts/extract_pdf.py report.pdf --chunk             # single file, 8000 chars each
python scripts/extract_pdf.py report.pdf --chunk --max-chars 4000
python scripts/extract_pdf.py report.pdf --chunk --output-dir ./chunks   # separate files

# Clean headers/footers
python scripts/extract_pdf.py report.pdf --clean-headers

# Batch: process multiple PDFs
python scripts/extract_pdf.py file1.pdf file2.pdf file3.pdf --output-dir ./extracted

OCR for Scanned/Image PDFs (Automatic by Default)

OCR is automatically triggered for pages with very little extractable text (default threshold: 100 characters). This helps handle scanned or image-based PDFs without requiring the --ocr flag.

Usage Examples

# Automatic OCR (default behavior)
python scripts/extract_pdf.py scanned.pdf

# Force OCR on all pages (ignore text length)
python scripts/extract_pdf.py scanned.pdf --ocr

# Force OCR only on specific pages
python scripts/extract_pdf.py scanned.pdf --ocr --ocr-pages 1-5,10

# Adjust OCR quality (DPI)
python scripts/extract_pdf.py scanned.pdf --ocr --ocr-dpi 300

# Use a different vision model
python scripts/extract_pdf.py scanned.pdf --ocr --ocr-model "stepfun/step-3.5-flash:free"

# Disable automatic OCR detection (if you want pure extraction only)
python scripts/extract_pdf.py file.pdf --no-auto-ocr

# Change the low-text threshold (default 100 chars)
python scripts/extract_pdf.py file.pdf --ocr-threshold 200

Configuration

OCR requires a vision API key. See Initial Setup for OCR.

OptionDefaultDescription
--ocroffForce OCR on pages (with auto-detect or --ocr-pages)
--auto-ocronAutomatically OCR low-text pages (hidden; use --no-auto-ocr to disable)
--no-auto-ocr-Disable automatic OCR detection
--ocr-pages-Comma-separated pages/ranges to OCR (requires --ocr)
--ocr-threshold100Minimum text length to consider a page as "sufficient" (characters)
--ocr-dpi200Image DPI for OCR rendering
--ocr-api-keyfrom env/configOverride API key
--ocr-base-urlfrom env/configOverride API base URL
--ocr-modelfrom env/configOverride vision model

Troubleshooting

OCR failed with "No API key" → Configure your API key in config.json or via OCR_API_KEY env var.

OCR model rejects images → The configured model might not support vision. Choose a vision-capable model (e.g., qwen/qwen3.6-plus:free, stepfun/step-3.5-flash:free). The script will attempt to auto-fallback to a known good model if the configured one lacks vision support.

Too many pages being OCR'd → Increase the threshold: --ocr-threshold 300 or --no-auto-ocr and selectively use --ocr-pages.

Rate limit errors → Reduce concurrent OCR calls, switch to a paid model tier, or try a different provider.

Configuration Reference

OptionDefaultSource
OCR_API_KEY(none)env OCR_API_KEY or config.json vision_api_key
OCR_MODELqwen/qwen3.6-plus:freeenv OCR_MODEL or config.json vision_model
OCR_BASE_URLhttps://openrouter.ai/api/v1env OCR_BASE_URL or config.json vision_base_url

Precedence: CLI argument > environment variable > config.json > hardcoded default.

Tool Comparison

ToolPDFGlobal textTablesSearchMetricsDiffChunk
web_fetch-
scrapling-
pypdf⚠️ garbled
pdfplumber

Modes Reference

ModeFlagWhat it does
Full(default)Extract all text + tables, page by page
Search--search "kw1 kw2"Find pages with keywords, show ±N lines context (default 5)
Metrics--metrics "kw1 kw2"Extract lines with keywords AND numeric data
TOC--tocDetect table of contents / chapter structure (robust multi-format)
--toc-min-entries NMinimum TOC entries per page to trust detection (default: 3)
Diff--diffCompare two PDFs, show matched vs unique pages
Chunk--chunkSplit into LLM-friendly pieces (--max-chars N)
Clean--clean-headersAuto-detect and remove repeated header/footer lines
Batchfile1 file2 ...Process multiple PDFs, output to --output-dir

Output Options

FlagEffect
--output-dir ./dirOutput to specified directory
--chunk --output-dirEach chunk as separate file
--context NContext lines around search matches (default 5)
--max-chars NChunk size (default 8000)
--header-lines "a" "b"Manually specify header/footer lines to remove

Workflow

1. Download PDF (if URL)

import urllib.request
urllib.request.urlretrieve(url, "report.pdf")

2. Extract

Run from this skill directory:

cd <skill-directory>
python scripts/extract_pdf.py /path/to/report.pdf [options]

3. Read & Answer

Read the output .md file and answer based on the extracted content.

4. Clean Up

Delete temporary PDF and .md files when done.

Limitations

  • Scanned/image-based PDFs: Cannot extract text without OCR. Install OCR dependencies and configure an API key.
  • Embedded charts/graphs: Only text labels extracted, not chart data.
  • Multi-column layouts: Use --layout flag for improved reading order via x_tolerance.
  • TOC detection: Robust multi-format matching with validation. Very non-standard layouts may still require manual extraction.
  • Diff: Uses text similarity (Jaccard on normalized lines), not page numbers. Threshold adjustable via --diff-threshold N (default 0.8).

Troubleshooting

OCR fails with "No API key" → Set OCR_API_KEY environment variable or fill config.json.

OCR model rejects images → The configured model may not support vision; either choose a vision-capable model (e.g., qwen/qwen3.6-plus:free, stepfun/step-3.5-flash:free) or let the script auto-fallback by removing the model setting.

Rate limit errors → Reduce concurrent calls, switch to a paid tier, or try a different model provider.

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

83.53%
按下载量换算954

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills