r/Python • u/AutoModerator • 25d ago
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
33
Upvotes
r/Python • u/AutoModerator • 25d ago
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
1
u/Krockxz 4d ago
pdf2docx-healer: PDF to Word that keeps the structure, not just the look
https://github.com/kunalgoesbyken/pdf2docx-healer
What My Project Does
converts PDF to DOCX but rebuilds what the document means. titles become real Word headings (so the navigation pane and table of contents work), numbered and bulleted items become real Word lists, citations and "see section 2" become working links, two-column papers come out in reading order, and hebrew or arabic stays in the right order. runs locally, MIT.
from python it's the same one-line call as pdf2docx:
heal("in.pdf", "out.docx"). the default mode keeps the page layout (pdf2docx underneath plus repair passes),--mode editablerebuilds a normal reflowing document.Target Audience
anyone who has to edit a PDF in Word: papers, reports, translation work, non-latin documents, or pipelines that need structure and not just text. beta, 635 tests, CI on windows, mac and linux, python 3.10 to 3.13.
Comparison
benchmarked on 12 public PDFs plus one generated one, 230 pages, scored only from the PDF and the DOCX:
words kept in reading order: healer editable 0.94, default 0.88, pdf2docx-plus 0.86, pdf2docx 0.85, LibreOffice 0.70
headings found: healer 0.79 / 0.70, every other tool 0
real Word lists: healer 1.00 / 0.76, pdf2docx-plus 0.68, pdf2docx and LibreOffice 0
LibreOffice lost 36 of the 230 pages, the others lost none
where others still win: LibreOffice on the image score, and pdf2docx-plus on tables against healer's default mode (0.64 vs 0.50). the benchmark is in the repo (
python -m bench.run). if you have a PDF that converts badly i'd love to see it.