Rename academic PDFs to: [Year] [Venue] Title.pdf
Three-stage pipeline:
text
Extract → Verify → Rename
Anti-error principle: Never re-parse PDF content during Rename. The Manifest is the single source of truth.
bash
# Stage 1: Extract raw text → manifest.json
python scripts/extract.py "<folder_path>"
# Stage 2: LLM parses raw_text → inject verified data → manifest_verified.json
# (Agent reads manifest.json raw_text field and writes to scripts/VERIFIED_DATA_*.py)
python scripts/apply_verified.py "<folder_path>"
# Stage 3: Preview / Execute
python scripts/execute.py "<folder_path>" --preview
python scripts/execute.py "<folder_path>" --execute
What it does:
manifest.json → raw_text fieldyear_hint from filename prefixManifest schema — see references/manifest_spec.md
The agent reads manifest.json, parses each raw_text field, and writes verified metadata.
Steps:
manifest.jsonraw_text to extract: title, authors, venue, year, abstractscripts/VERIFIED_DATA_*.py with verified entriesVERIFIED_DATA format:
python
VERIFIED_DATA = {
"OriginalFilename.pdf": {
"title": "Correct Paper Title",
"year": "2024",
"venue": "NeurIPS",
"confirmed": True # must be True to be renamed
},
}
Rules:
confirmed: True → status becomes ready → will be renamedconfirmed: False or omitted → skippedVERIFIED_DATA_*.py files are auto-merged⚠️ Key gotchas during parsing:
"Direct score maximization outperformsplanning loss") — use context to infer correct split"Math. Program. (2012) 133..." is NOT the title — read furtherconfirmed: False and skipThen run:
bash
python scripts/apply_verified.py "<folder_path>"
status == 'ready' files are renamed(1), (2) suffixes<folder>/_backup_YYYYMMDD_HHMMSS/bash
python scripts/execute.py "<folder_path>" --preview # dry run
python scripts/execute.py "<folder_path>" --execute # rename
ScriptPurposescripts/extract.pyStage 1: extract raw PDF text → manifest.jsonscripts/apply_verified.pyStage 2: inject verified metadata → manifest_verified.jsonscripts/execute.pyStage 3: rename files (preview or execute)scripts/llm_parse.py(Optional) programmatic LLM parsing via gateway API
SymptomCauseFixraw_text emptyPDF is a scanSkip ( confirmed: False) or manually determine metadataTitle extracted without spacespypdf concatenates linesLLM infers from context; use filename as hintWrong year (arXiv ≠ conference)Used filename yearUse venue year from raw_text, not filenameDOI/journal ref at top of pageMetadata precedes titleRead past it — title is usually afterMiddle-dot author lines misidentified· separator in namesLLM handles via semantic understandingNon-paper files renamedNo filter appliedSet confirmed: False for non-papersWindows filename encoding garbledChinese/non-ASCII chars in PowerShellUse Python scripts, not manual file opsLigature artifactsPDF encoding (e.g., fi → fi)clean_title_text() in extract.py handles these
references/manifest_spec.md — Full manifest JSON schemareferences/venue_abbrev.md — Standard venue abbreviation map