Resume (CV) parsing from PDF in Python: a practical 2026 guide
Direct answer: Parse a resume PDF in Python with pip install pdfmux and pdfmux.extract_text("resume.pdf"), which returns reading-order-correct Markdown even for the two- and three-column templates most resume builders (Canva, Novoresume, Google Docs templates) produce. From there, regex handles contact info reliably (email, phone are highly regular patterns), and section splitting on common headers (Experience, Education, Skills) handles structure — there is no library, free or paid, that reliably extracts “5 years of Python experience” as a structured field from arbitrary resume prose, and anything claiming to do that with high accuracy is doing it with an LLM call, not a parser.
Why resumes are harder than they look
A resume looks like a short, simple document — one or two pages, mostly text. In practice it’s one of the most layout-inconsistent document types extraction tools see:
- No standard layout. An invoice has a handful of common shapes. A resume has none — single column, two column with a sidebar, three column, a full-page infographic design with skill bars and icons. Every template vendor invents its own grid.
- Two-column templates scramble naive extraction. The same reading-order problem that breaks academic papers breaks resumes just as badly: a sidebar with contact info and skills, next to a main column with experience, interleaves into nonsense if the extractor reads in file order instead of visual order.
- No semantic structure a parser can lean on. A bank statement has a running-balance column you can reconcile against. A resume has prose — “Led a team of 6 engineers shipping a payments platform” is unambiguous to a human and has no fixed shape a regex can reliably pull “role,” “team size,” and “outcome” out of.
- Fonts-as-icons and skill bars aren’t text at all. Many designer templates render skill levels as a row of filled/unfilled circles, or use icon fonts for section headers. That’s not extractable text — it’s decoration, and the layout-aware extraction simply won’t find a “Python: 90%” string because no such string exists in the PDF.
Given this, the honest scope for a Python resume parser is: extract clean, correctly-ordered text, reliably pull the handful of genuinely-structured fields (email, phone, links), and segment the rest into sections — not “extract years of experience as a number,” which requires actual language understanding.
Step 1: Extract text in correct reading order
import pdfmux
text = pdfmux.extract_text("resume.pdf", quality="standard")
print(text[:500])
quality="standard" matters more here than it sounds — it’s the setting that enables reading-order reconstruction for multi-column layouts, scoring 0.920 on reading order on the opendataloader-bench. A two-column resume parsed in file order instead of visual order will interleave the sidebar’s “Skills: Python, SQL, AWS” into the middle of a job description — and a naive regex scan of that scrambled text will miss or mis-attribute fields.
For a scanned or photographed resume (less common, but it happens — faxed applications, old paper CVs), install OCR support:
pip install "pdfmux[ocr]"
OCR kicks in automatically on image-only pages; no code change needed beyond the install.
Step 2: Extract contact info with regex (the part that actually works well)
Email addresses and phone numbers are two of the most regular patterns in natural text, which is exactly why regex handles them better here than any ML-based field extractor:
import re
EMAIL_RE = re.compile(r"[\w.+-]+@[\w-]+\.[\w.-]+")
PHONE_RE = re.compile(r"(?:\+?\d{1,3}[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}")
LINKEDIN_RE = re.compile(r"(?:linkedin\.com/in/|linkedin:\s*)([\w-]+)", re.IGNORECASE)
GITHUB_RE = re.compile(r"(?:github\.com/)([\w-]+)", re.IGNORECASE)
def extract_contact(text: str) -> dict:
# Contact info is almost always in the first ~500 characters (header/sidebar)
head = text[:800]
return {
"email": next(iter(EMAIL_RE.findall(head)), None),
"phone": next(iter(PHONE_RE.findall(head)), None),
"linkedin": next(iter(LINKEDIN_RE.findall(text)), None),
"github": next(iter(GITHUB_RE.findall(text)), None),
}
contact = extract_contact(text)
print(contact)
Scanning just the first ~800 characters for email/phone avoids false positives later in the document — a reference’s phone number in a “References available on request — Jane Doe, 555-0199” line, for instance.
Step 3: Segment into sections
Resumes don’t have machine-readable section markers, but they do have predictable header text. Split on a list of common headers rather than trying to infer structure from formatting alone (bold/font-size detection is fragile across the dozens of templates in the wild):
SECTION_HEADERS = [
"experience", "work experience", "employment history",
"education", "skills", "technical skills", "projects",
"certifications", "summary", "objective", "publications",
]
def split_sections(text: str) -> dict[str, str]:
lines = text.split("\n")
sections: dict[str, list[str]] = {"header": []}
current = "header"
for line in lines:
stripped = line.strip().strip("#").strip().lower()
if stripped in SECTION_HEADERS:
current = stripped
sections[current] = []
continue
sections.setdefault(current, []).append(line)
return {k: "\n".join(v).strip() for k, v in sections.items()}
sections = split_sections(text)
print(list(sections.keys()))
print(sections.get("skills", "")[:200])
This catches the common case (a line that is just the header text, which is how most templates render section titles) but will miss headers styled as icons-plus-text or non-English headers — extend SECTION_HEADERS for the languages and label variants your resume source actually uses before trusting this in production.
Step 4: Pull a skills list out of the skills section
Once you have an isolated skills section, splitting it into a list is simpler than parsing the whole document, because skills sections are usually comma-, bullet-, or pipe-separated rather than prose:
def parse_skills(skills_text: str) -> list[str]:
# Normalize bullets/pipes to commas, then split
normalized = re.sub(r"[•|·\n]", ",", skills_text)
raw = [s.strip() for s in normalized.split(",")]
return [s for s in raw if s and len(s) < 40] # drop empty and sentence-length fragments
skills = parse_skills(sections.get("skills", ""))
print(skills)
The length filter (< 40 chars) exists because a skills section occasionally has one stray full sentence (“Comfortable working in fast-paced, ambiguous environments”) mixed in with real skill tokens — filtering by length is a crude but effective way to drop prose that leaked into a list-shaped section.
What this approach won’t do
Be explicit with stakeholders about the boundary, because “resume parser” gets sold as more magical than it is:
- “Years of experience” as a number requires computing date ranges from job entries with inconsistent date formats (“2021–Present”, “Jan 2021 - Mar 2023”, “2021”). Doable, but it’s a dedicated date-range parser, not a side effect of text extraction.
- Seniority inference (“is this person senior enough for this role”) is a judgment call dressed up as extraction. Anything claiming to automate it is running an LLM prompt, not a parser.
- Skill-bar graphics and icon-rendered content aren’t text in the PDF at all — there’s nothing to extract.
If you need those, the honest next step is feeding the extracted, section-split text (not the raw PDF) to an LLM with a narrow, specific prompt — extraction gets you clean input; it doesn’t replace judgment.
How the options compare
| Tool | Reading-order safe (multi-column) | Maintained | Structured fields | Cost |
|---|---|---|---|---|
| pdfmux + regex (this post) | Yes (0.920 benchmark) | Yes | Email/phone/links only, by design | Free (MIT) |
| pyresparser | No documented reading-order handling in its own docs | Still releases (v1.0.6), but pinned to an old spaCy model that needs a separate manual download step | Name/skills/education via NLP (spaCy/NLTK), often noisy | Free, but installs are fragile (spaCy model pinning) |
| Textkernel (Sovren) | Yes | Yes, enterprise product | Extensive — normalized skills, seniority, taxonomy mapping | Enterprise, sales-quote pricing, not self-serve |
| Raw regex, no extraction layer | No — breaks on any multi-column template | N/A | Only what you build | Free |
pyresparser is the library most tutorials point to, and it’s worth naming directly: it still gets occasional releases, but it depends on an old spaCy model download step that frequently breaks on current Python versions, documents no multi-column or reading-order handling, and its own original creator has since moved on to an LLM-based parsing approach for the same problem — which tells you where the ecosystem consensus has landed. Textkernel/Sovren is the legitimate enterprise option if you need normalized skill taxonomies and seniority scoring at ATS scale, but it’s a sales-quote product, not something you pip install for a side project.
Production checklist
- Use
quality="standard"(not"fast") — reading-order reconstruction for multi-column templates needs it - Install the OCR extra if any resumes might be scanned/photographed:
pip install "pdfmux[ocr]" - Scope email/phone regex to the first ~800 characters to avoid matching a references line
- Extend
SECTION_HEADERSfor every language/label variant in your actual resume source before trusting section splitting - Don’t promise “years of experience” or seniority as extracted fields — build or buy that separately, and say so
- If skill-bar graphics matter to your use case, note that they aren’t PDF text and won’t be extracted at all
FAQ
Can this parse a resume written in a language other than English?
Text extraction itself is language-agnostic. Section detection needs the header list translated ("expérience", "compétences", etc.) and the contact-info regexes generally still work since emails and most phone formats are language-independent.
What about resumes submitted as .docx instead of PDF?
Out of scope for pdfmux, which is PDF-only. Convert .docx to PDF first (LibreOffice headless or a cloud conversion API both work), then run the same pipeline.
Does it detect duplicate or near-duplicate resumes in a batch?
Not built in. If you need that, hash the extracted text (after stripping whitespace/formatting) and compare across a batch — exact-duplicate detection this way is cheap; near-duplicate detection needs an embedding-similarity step on top.
Is resume content sent anywhere? No — extraction and OCR both run locally. That matters for resumes specifically, since they’re personal data (names, addresses, sometimes photos) that most HR/recruiting tooling has a real obligation to handle carefully.
Keep reading
- Extract text from multi-column PDFs in Python — the reading-order problem resumes share with academic papers
- PDF form data extraction in Python — for application forms with actual labeled fields, a more tractable sibling problem
- Best PDF extraction library for Python in 2026 — full benchmark methodology and numbers
- PDF extraction without a GPU — running OCR on CPU for batches of scanned documents
Last updated: November 2026. Benchmark figures are from the opendataloader-bench (200 real-world PDFs).