finds.dev← search

// the find

vinta/pangu.py

★ 280 · Python · MIT · updated Oct 2026

Opinionated paranoid text spacing in Python

The Python member of a family of ports that starts with pangu.js. It inserts spaces between CJK (Chinese, Japanese, Korean) text and adjacent Latin letters, digits and symbols, so mixed-script text reads the way typesetting conventions expect. It suits anyone publishing or processing mixed-script content, such as blog and static-site pipelines, translation tooling, or a one-off cleanup of scraped text.

The test suite has one file per symbol class (35 in the listing, from ampersands to tildes), so when a rule changes you can see exactly which character class moved. The CLI's -c flag prints a corrected string and exits 1 when spacing is wrong, which makes it usable as a lint step in CI. The same rule set is shared across the JavaScript, Go and Java ports, and the ADRs in docs/adr record the design decisions behind the Python API.

The README never says what the rules skip, and the paranoid posture shows: the rm -rf example gets spaced like prose, so anything that carries code, identifiers or markup has to be checked on output. The README documents no way to disable a rule or exempt a span, and a pipeline feeding it rendered Markdown or HTML will need exactly that. The project lists one author and has 280 stars, so treat it as a single maintainer's tool: pin the version and expect to fork if the rules stop matching your text.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →