Built for Recruiting Teams · Python · Typer · Gemini · Notion API
AI Recruitment Scanning Agent
A command-line tool that screens a folder of CVs (PDF and DOCX) against a job description with Google Gemini and files one ranked, checked candidate page per CV in a Notion database. It scores each CV from 0 to 100, derives the fit category from the score, skips candidates already in the database, shows a live progress bar and a summary, and exits non-zero if any CV failed. Python, Typer and Rich, published on PyPI.
CV Folder → Text Extract → Gemini Score → Notion Pages

Role
Python Developer
Duration
Since April 2026
Tech Stack
The Problem
Screening a pile of CVs against a job description is repetitive work, and the results usually end up scattered across a spreadsheet or a tracker. The aim was one command that does the first pass and files the results where the team already works, in a Notion database.
The published version had stopped working on current dependencies: it named a Google model that has been retired, so every CV failed while the command still printed 'Done' and exited 0, and an upgrade of the Notion library had silently switched duplicate detection off.
My Approach
- Commands. A Typer and Rich command line with ai-recruit process <cv folder> <job description PDF> and ai-recruit setup-notion, keys read from a .env file in the working directory.
- Extraction. PDF and DOCX CVs are read (the first 50 pages of a PDF, and files over 25 MB are skipped).
- Screening. A Gemini model, set by GEMINI_MODEL, returns JSON for each CV: name, e-mail, phone, skills, an experience summary, a match score and a reason. The documents are fenced as untrusted data in the prompt, so a CV cannot instruct the model.
- Checking. The model's answer is validated before it is stored: the score must be 0 to 100, the category (High, Medium or Low Fit) always follows from the score, an address Notion would refuse is dropped, skills are cleaned, and text is cut to Notion's limits.
- Notion. One page per candidate in the database's data source (Notion's 2025 data-source API). setup-notion adds the twelve properties the tool needs. A candidate already present is skipped, matched on e-mail and job id, or on the CV file name when there is no e-mail.
- Operation. A live progress bar, a summary table, exit code 1 if any CV failed, and a stop after three Gemini failures in a row.
- Quality. Six small modules, 250 tests that run on the real Notion library with only HTTP stubbed, mutation checks, locked dependencies and CI.
- Review. The retired model name, the dead duplicate check, a .env that was looked for next to the installed package, a model answer that was trusted (a CV could set its own score), and file names that broke the terminal markup were all fixed.
Results & Impact
Re-run on 2026-11-14 in a scratch copy: ruff check passes, 250 tests pass, and coverage is 100% of 478 statements and 122 branches. uv audit found no known vulnerabilities in 50 packages and the 0.3.2 wheel builds.
The real command line was also run that day against local stand-ins for Gemini and Notion. setup-notion added the twelve properties. process screened five fictional CVs (three PDF, two DOCX) against a fictional job description: two High Fit at 100 of 100, one Medium Fit at 57 and two Low Fit at 42 and 0, all five filed. Running it again skipped all five as duplicates and added none. The scores in those frames come from a rule-based stand-in, not a language model.
Recorded in the repository's work-done.md (2026-11-10): the suite grew from 44 to 250 tests and a mutation check put 253 deliberate bugs back one at a time with the tests failing for every one.
Not verified: the real Gemini and Notion services (the model name and the Notion requests were checked against documentation and the library, and no key was available); how well a model scores real CVs, which a person should read before acting on; scanned (image-only) PDFs, which are not supported; behaviour under Gemini quotas for large batches; and the mutation run, which was not repeated on 2026-11-14.