CopernicusPDF/
docs/
pdfharvest-guide.qmd
python314-features.qmd
examples/
example_usage.py
pdf/
HartmannDiagramme.pdf
Kremer1983QJRAS__24___36K.pdf
Zinner_Bericht-Naturforsch-Ges-Bamberg_27_0001-0118.pdf
pdfharvest/
__init__.py
cli.py
db.py
patterns.py
walker.py
IMPLEMENTATION_SUMMARY.md
INSTALL.md
PROJECT.yaml
pyproject.toml
QUICK_REFERENCE.md
README.md
[DRAFT — edit this] Fast, massively parallel PDF filename harvester with SQLite caching. Inferred stage: development. Define the specific deliverable, success state, and timeline.
Success criteria:| Code | /Users/friedrichstr/ai-mac-studio/scholarly/research/CopernicusPDF |
| Docs | /Users/friedrichstr/ai-mac-studio/scholarly/research/CopernicusPDF/docs |
| Check | Path | Status | Detail |
|---|---|---|---|
| code | /Users/friedrichstr/ai-mac-studio/scholarly/research/Coperni | ✓ ok | 10 items, last_modified=2026-08-24 |
| docs | /Users/friedrichstr/ai-mac-studio/scholarly/research/Coperni | ✓ ok | 2 items, last_modified=2025-11-17 |
Fast, massively parallel PDF filename harvester with SQLite caching, built for Python 3.14.
Python 3.14 or later
uv python install 3.14
cd /path/to/CopernicusPDF
uv venv --python 3.14 .venv
source .venv/bin/activate
uv pip install -e .
pdfharvest --root /Volumes --file-name "*Copernic*"
pdfharvest --root ~ --file-name "*Copernic*|*Gesamtausgabe*|*Ptolemy*"
pdfharvest --root /Volumes --file-name "*Copernic*" --backend interpreters
The default thread-based backend leverages Python 3.14's free-threaded builds for true multi-core parallelism. All worker threads execute simultaneously across CPU cores without GIL contention.
The --backend interpreters option uses concurrent.futures.InterpreterPoolExecutor to distribute work across isolated subinterpreters, each with its own GIL. This provides true parallelism even on standard Python builds.
pdfharvest --root /Volumes --file-name "*Copernic*|*Gesamtausgabe*"
--root PATH - Root directory to scan (repeatable)--file-name PATTERN - Wildcard pattern for filename stem (use | for alternatives)--file-ext EXT - File extension (default: pdf)--dir-name PATTERN - Directory name pattern to constrain search--case-sensitive - Enable case-sensitive matching--workers N - Number of parallel workers (default: CPU count × 4)--backend {threads,interpreters} - Execution backend (default: threads)--force-rescan - Ignore cache and rescan everything--json - Output results as JSON linesPatterns use * as wildcard:
*Copernic* - contains "Copernic" anywhereGesamtausgabe* - starts with "Gesamtausgabe"*scan - ends with "scan"Use | for alternatives:
*Copernic*|*Ptolemy*|*Kepler* - matches any of the threepdfharvest maintains an SQLite cache (default: ~/.pdfharvest/cache.db) that records which directory branches have been scanned for which patterns. Subsequent runs with the same pattern skip cached branches, making repeated searches extremely fast.
Force a complete rescan:
pdfharvest --root /Volumes --file-name "*Copernic*" --force-rescan
Comprehensive documentation is available in docs/pdfharvest-guide.qmd.
To render as HTML with Quarto:
quarto render docs/pdfharvest-guide.qmd
pdfharvest/cli.py - Command-line interfacepdfharvest/patterns.py - Fast string-based pattern matchingpdfharvest/db.py - SQLite caching and persistencepdfharvest/walker.py - Parallel directory traversal with thread and interpreter backendsOn Python 3.14 free-threaded builds, pdfharvest achieves near-linear scaling with CPU cores for filesystem scanning. The intelligent branch cache ensures repeated searches complete in milliseconds rather than minutes.
Tested on trees with millions of files across multiple volumes.
pdfharvest \
--root /Volumes \
--file-name "*Copernic*|*Copernicus*|*De_Revolutionibus*" \
--json > copernicus_files.jsonl
pdfharvest \
--root /Volumes \
--file-name "*" \
--dir-name "*research*|*papers*"
pdfharvest \
--root /Volumes \
--file-name "*Copernic*" \
--backend interpreters \
--workers 64
MIT