Jump to content

Resume CV Renamer Pipeline

From MediawikiCIT
Revision as of 14:25, 31 July 2026 by Justinaquino (talk | contribs) (Add Resume / CV Renamer Pipeline tool article (intake, OCR/vision-OCR, AI extraction, rename, VCF export))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Resume / CV Renamer Pipeline

Automated resume ingestion, OCR, AI extraction, file renaming, and VCF contact export for recruitment workflows.

Location: /path/to/resume-renamer/ (configure to your local HR/resume folder)

Upstream docs: Frappe HRMS - Ch01 Recruitment


What It Does

  1. Drop a resume file (PDF, DOCX, JPG, PNG) into the folder.
  2. The scanner detects the new file and extracts text with pdftotext.
  3. Image files or image-based PDFs are converted with img2pdf and OCR'd with ocrmypdf if available.
  4. If OCR fails or is unavailable, the scanner falls back to vision OCR using a local VLM (e.g. glm-ocr:bf16).
  5. A local LLM extracts structured candidate data.
  6. The file is renamed to: YYMMDD Full Name Degree.pdf
  7. A YYMMDD-HHMMSS_Bulk_Import.vcf file is generated for contact import.

The single source of truth is the SQLite database resumes.db.


Supported Inputs

Format Handling
PDF with text Direct extraction
Image-based PDF ocrmypdf → vision OCR fallback
JPG / PNG img2pdf → vision OCR fallback
DOCX Detected; convert to PDF manually if needed

Quick Start

Run once manually

cd /path/to/resume-renamer
source ./venv/bin/activate
python cv_auto_scanner.py --once

Dry-run preview

python cv_auto_scanner.py --once --dry-run

Daemon mode

python cv_auto_scanner.py --daemon --interval 900  # 15 minutes

Force a full re-scan

rm -f .scanner_state.json
python cv_auto_scanner.py --once

Common Issues

Degree shows "General" or is empty

The scanner now explicitly accepts diplomas and certificates in the degree field. If an older file still shows "General", reset it and reprocess:

source ./venv/bin/activate
python3 -c "
import resume_db
resume_db.init_db()
resume_db.upsert_candidate('ORIGINAL_FILENAME.pdf', status='pending', retry_count=0, last_error=None)
"
rm -f .scanner_state.json
python cv_auto_scanner.py --once

"Text too short / unreadable"

The scanner automatically tries OCR and vision OCR. If it still fails:

source ./venv/bin/activate
python /path/to/rpdf-skills/vision_ocr.py FAILED_FILE.pdf --model glm-ocr:bf16 --format text -o extracted.txt

Then rebuild a searchable PDF and re-run the scanner.

venv broken after Python upgrade

sudo apt install python3.14-venv python3-pip
cd /path/to/resume-renamer
rm -rf venv
python3.14 -m venv venv
source ./venv/bin/activate
pip install --upgrade pip
pip install img2pdf requests pdfplumber psycopg2-binary fpdf2

VCF Import

New *_Bulk_Import.vcf files are generated automatically. Import them into your contacts app:

  • Google Contacts: contacts.google.com → Import → Select VCF
  • Android: Copy VCF to phone → Contacts → Settings → Import
  • Thunderbird: thunderbird -compose "to=hr@example.com,subject=Contact Card,attachment=/path/to/YYMMDD-HHMMSS_Bulk_Import.vcf"

The VCF uses a non-standard layout for multi-part names:

vCard Field Value
N (Last Name) Role context, e.g. Electrical Applicant 260616
N (First Name) Candidate's full name
FN {Full Name} - {Context}

To specify the context for a batch:

python cv_auto_scanner.py --vcf-context "Electrical Applicant 260616"