Document Auto-Population Tool

A Python tool I built that pulls values out of PDFs and fills them into a Word letter. What used to take 30–40 minutes of copying by hand becomes a draft ready for someone to check. And it's built so you can reuse it for any kind of document, not just this one.

00

problem

Filling in a letter meant opening a bunch of PDFs, hunting for the right numbers and addresses, and typing them into Word by hand. 30–40 minutes per letter, and every number you type by hand is a number you can mistype. It needed to end as a draft a person checks, not something that fires letters out on its own.

solution

The tool only pulls the fields it's told to — claim references, policy numbers, dates, amounts, addresses — cleans them up (amounts get their $ and two decimals, dates all become DD/MM/YYYY), and fills them into the right spots in the letter. One draft per case, saved for review. If something can't be filled properly — it's blank, the status isn't one it knows, the amount is negative, the currency looks odd — it flags it as [[CHECK: Field Name]] instead of guessing. Letters are found by their exact file name, companion PDFs are matched to the same case by reference number, and every run gets logged. And the whole thing is on GitHub as a generic version you can reuse, with an insurance example next to it.

This is a project I started after one too many letters copied out by hand.

I noticed this while working at CPF Board, in the Housing Monetization team. A lot of my work there is backend admin, preparing documents behind the service, and a big chunk of it was letters. Each one meant filling in a Word document by hand, copying figures and addresses across from print-screens of the internal portal. 30–40 minutes per letter, and every number I typed by hand was a number I could mistype. And when one slipped through, the draft went back and forth with the reviewers until it was right.

I kept thinking there had to be a better way to do the copying part, while still leaving the checking to a person. So I started building one.

It began as a Power Platform build. I got pretty far with it, then the route hit a wall I couldn't get past on my laptop, so I rebuilt the whole thing in Python.

I did it piece by piece and tested each bit before moving on: pull the text out, clean the values, fill the letter, then loop through a whole folder. The edge cases kept coming, and each one got fixed with a test to prove it.

I couldn't build it on the real work documents, so I made a fictional version with made-up people and numbers to prove it worked end to end. Then I made a generic version of it, so it works for any kind of document. That one got checked and tested on something completely different before I put both on GitHub.

Same words throughout, just the dashes swapped for commas and full stops.

year

2026

timeframe

2 months

tools

Python, pdfplumber, python-docx, VS Code

category

Personal Project

01

Screenshot from the project

02

Screenshot from the project

03

Screenshot from the project

04

Screenshot from the project

.say hello

i'm open for freelance projects, feel free to email me to see how can we collaborate

.say hello

i'm open for freelance projects, feel free to email me to see how can we collaborate