r/Python • • 22d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

28 Upvotes

160 comments sorted by

View all comments

1

u/Particular-Map-5153 7d ago

What My Project Does

I wrote Markdown OCR Cleaner, a small Python CLI for cleaning up text after OCR.

Here’s an example from the README. You can read the word information across the line break just fine, but try searching for it in this text and you’ll miss it.

The results  were surprising.  The team  found that the infor-
mation was stored in two places.

With hyphen joining turned on, version 0.1.0 saves this to a separate file so you keep the original.

The results were surprising. The team found that the information
was stored in two places.

Target Audience

If you turn scanned books, papers, or technical manuals into searchable Markdown or plain text, you’ve probably run into this. With your virtual environment active and the wheel installed, you can preview the changes to the README sample by running this command.

md-ocr-clean sample.md --enable join-hyphenated-words --dry-run --diff

Comparison

A find-and-replace would fix the double spaces in that paragraph. Doing it across the whole file would also change total = 1 inside a code block. The cleaner preserves the spacing in the code. The full example also has a 17 on a line by itself. The tool flags it as a possible page number and leaves it in the text.

It runs locally on Python 3.11+ and only needs the standard library at runtime.

Source and full example · Download v0.1.0

What’s an OCR error you still fix by hand because an automatic fix can change the meaning? If you have a two-line example, I’d love to see it.