Skip to main content

English | 简体中文

hfpapers-crawler

PyPI version Python versions License

Naming philosophy: claw (sharp grasp) ≠ crawl (creep). hfpclawer = HuggingFace Papers + claw + er = "A sharp tool that claws HF papers with precision" 🦞

Not a crawler — faster, sharper, more precise. Same series: OpenClaw, Hermes Agent ecosystem.

A multi-source academic paper clawler for PDE / neural operator / physics-informed ML. Built with SQLite paper_store, Crossref cross-validation, anti-crawl Scrapy pipelines, and MCP server.


Quick Install

pip install hfpclawer

Dependencies

  • Core (auto-installed): pyyaml, requests, beautifulsoup4, typer, etc.
  • LLM features (optional): pip install hfpclawer[llm] — for sniff / analyze commands
  • PDF conversion (optional): pip install hfpclawer[pdf]
  • Scrapy spiders (optional): pip install hfpclawer[scrapy]
  • Dev (testing): pip install hfpclawer[dev]
  • arXiv local search (optional): pip install hfpclawer[arxiv] documents the metadata dependency only (PyPI doesn't support git+https). See docs/kaggle-metadata.md for manual git clone + OAI-PMH or Kaggle setup.
  • Citation audit (optional): pip install hfpclawer[audit] declares namespace only. See hfpclawer/citation_audit.py for manual setup.

Local Development

git clone <your-repo>
cd hfpapers-clawler

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

# Verify
hfpclawer --help

Configuration

First run hfpclawer init to generate config and env template:

hfpclawer init --quick          # Quick mode (defaults)
# or
hfpclawer init                  # Interactive wizard
cp .env.template .env           # Fill in API keys
# Edit config.yaml to customize search queries

Or manually create files (see docs/USAGE.md for full reference):


CLI Commands

# Search for new papers
hfpclawer search                    # Default 3 pages, threshold 30
hfpclawer search --max-pages 5      # More pages
hfpclawer search --dry-run          # Show only, don't save

# Full pipeline: search → download → convert
hfpclawer full

# SQLite Paper Store operations
hfpclawer store stats               # Storage statistics
hfpclawer store search              # List all papers
hfpclawer store search --keyword "FNO"
hfpclawer store verify --aid 2301.11167

# Download & convert
hfpclawer download                  # Download top-20 PDFs
hfpclawer convert                   # PDF → Markdown

# MCP Server (for Hermes Agent / OpenCode)
hfpclawer mcp                       # Default port :8765

Python API

from hfpapers.paper_store import PaperStore, PaperRecord, ensure_paper

# Create a store
store = PaperStore(db_path="/tmp/papers.db")

# Add a paper
rec = PaperRecord(
    title="Fourier Neural Operator",
    abstract="Learning PDE solution operators with Fourier transforms",
    year=2023,
    source="my_app",
    relevance=90,
)
sf_id = store.upsert_paper(rec)
store.add_identifier(sf_id, "arxiv", "2010.08895")

# Search
papers = store.search_papers("neural operator")
for p in papers:
    print(f"[{p.relevance}] {p.title}")

# Hardware probe
from hfpapers.hardware import HardwareProbe
hw = HardwareProbe()
print(f"Hardware: {hw.summary()}")

MCP Server

hfpapers-clawler ships with a built-in MCP server for AI agent integration:

hfpclawer mcp

Register in Hermes Agent ~/.hermes/config.yaml:

mcp:
  servers:
    hfpapers:
      command: "hfpclawer"
      args: ["mcp", "--port", "8765"]

Available MCP tools (4 core always active; heavy ops use CLI):

Tool MCP (auto) CLI preferred
hfpclawer_search
hfpclawer_info
hfpclawer_list
hfpclawer_stats
hfpclawer_download ⚠️ available hfpclawer download --limit N
hfpclawer_convert ⚠️ available hfpclawer convert
hfpclawer_full ⚠️ available hfpclawer full

Heavy operations (download/convert/full) are hidden from tools/list by default to save tokens. They remain callable via direct tools/call — or better, use the CLI for progress feedback.


Architecture

┌─ CLI (Typer) ─┐  ┌─ MCP Server ─┐
└──────┬────────┘  └──────┬───────┘
       └────────┬──────────┘
                ▼
┌─ Scrapy Layer (Multi-source) ───────────┐
│  ArxivSearchSpider | OpenReviewSpider    │
│  HFPapersSpider | MultiSourceSpider      │
│  Middleware: UA random, delay, proxy...  │
│  Pipeline: Store→Classify→Export→DL     │
└──────────────────┬──────────────────────┘
                   ▼
┌─ Paper Store (SQLite) ──────────────────┐
│  papers (Snowflake ID) | identifiers    │
│  crossref_cache | CrossrefClient        │
└─────────────────────────────────────────┘

Tests

pip install -e ".[dev]"
pytest tests/ -v           # Run all tests
pytest tests/ --cov=hfpapers  # With coverage

License

MIT

Hermes Agent Skills

These skills automate common hfpclawer workflows inside Hermes Agent (or any AI coding assistant that supports the Hermes skill format):

Skill Purpose Install
hfpclawer-paper-search Daily paper discovery → download → wiki hermes skills install https://raw.githubusercontent.com/diamond2nv/hfpapers-crawler/main/skills/hfpclawer-paper-search/SKILL.md
hfpclawer-citation-audit Verify citations via S2 + OpenAlex hermes skills install https://raw.githubusercontent.com/diamond2nv/hfpapers-crawler/main/skills/hfpclawer-citation-audit/SKILL.md
hfpclawer-academic-integrity Paper draft integrity: extract → verify → flag FABRICATED hermes skills install https://raw.githubusercontent.com/diamond2nv/hfpapers-crawler/main/skills/hfpclawer-academic-integrity/SKILL.md
hfpclawer-formula-verify LaTeX formula cross-validation (SymPy ↔ Wolfram, dimensional) hermes skills install https://raw.githubusercontent.com/diamond2nv/hfpapers-crawler/main/skills/hfpclawer-formula-verify/SKILL.md

After installing, load with skill_view(name='hfpclawer-paper-search') in any Hermes conversation.

Acknowledgments

This project incorporates code adapted from:

Links

Release files for hfpclawer 0.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hfpclawer 0.15.0
File Size Uploaded
hfpclawer-0.15.0.tar.gz 349.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hfpclawer 0.15.0
File Interpreter ABI Platform
hfpclawer-0.15.0-py3-none-any.whl Python 3 none any Details

Total release size: 701.0 kB

Release files / hfpclawer-0.15.0.tar.gz

Download URL hfpclawer-0.15.0.tar.gz
Size 349.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ca83b99d6220c27b95912c447b28a6d373d3730e002d4b29fa9b6b6717268bc4
BLAKE2b-256 checksum
How to use checksums
2daa45b0baf0a7d106f13d50261dbfe663552495fd6d0e46d8702bc88aa93a88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / hfpclawer-0.15.0-py3-none-any.whl

Download URL hfpclawer-0.15.0-py3-none-any.whl
Size 351.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c77cb4ed24d842bf42f59311b489ef7d74ae6fe54d57aad9b68a42823dcab44
BLAKE2b-256 checksum
How to use checksums
4dac6a4cc6b79767c3d4de7cdcf48e1a9d2a2a28fb53c57055850456d6d03911
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

0.19.0

2 release files

This release

0.15.0 This release

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page