pangu.py: Automated Paranoid Text Spacing for Enhanced Readability

This repository profile is provided by osrepos.com, an open source repository discovery platform.

pangu.py: Automated Paranoid Text Spacing for Enhanced Readability

Summary

pangu.py is a Python library designed for opinionated, "paranoid" text spacing. It automatically inserts whitespace between CJK (Chinese, Japanese, Korean) and half-width characters, such as alphabetical letters, numerical digits, and symbols. This tool significantly improves text readability by ensuring consistent and proper spacing.

Repository Information

Analyzed by OSRepos on August 1, 2026

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

pangu.py is a Python library that implements "paranoid" text spacing to enhance readability. It automatically inserts whitespace between CJK (Chinese, Japanese, Korean) characters and half-width characters (alphabetical letters, numerical digits, and symbols). This opinionated approach ensures consistent and visually pleasing text formatting, making your content easier to read.

Installation

Installing pangu.py is straightforward using uv or pip:

$ uv add pangu
# or
$ pip install -U pangu

Examples

pangu.py can be used both within Python scripts and as a command-line tool.

In Python

import pangu

new_text = pangu.spacing_text("???????????????Monkey Patch????")
# new_text = "??????????????? Monkey Patch ????"

new_content = pangu.spacing_file("path/to/file.txt", encoding="utf-8")
# new_content = "? PM ??????????????? PM"

pangu.has_proper_spacing("?? Hadoop ??????????? Map/Reduce ?")
# True

In CLI

$ pangu-py "?????????????????????DevOps???????????????????????????????1.??2.???3.????"
????????????????????? DevOps??????????????????????????????? 1. ?? 2. ??? 3. ????

$ pangu-py -t "??????????Google?????Bing"
?????????? Google????? Bing

Why Use It

The primary benefit of pangu.py is the automatic improvement of text readability, especially for content mixing CJK and half-width characters. By consistently applying proper spacing, it eliminates common formatting inconsistencies and reduces visual clutter. This makes documents, articles, and user interfaces appear more professional and easier for readers to process, saving manual editing time.

Links

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️