# pangu.py: Automated Paranoid Text Spacing for Enhanced Readability

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

Source: osrepos.com
Repository profile: https://osrepos.com/repo/vinta-pangu.py
Generated for open source discovery and AI-assisted research.

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.

GitHub: https://github.com/vinta/pangu.py
OSRepos URL: https://osrepos.com/repo/vinta-pangu.py

## 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.

## Topics

- pangu
- pangu-spacing
- python
- text-spacing
- text-formatting
- readability
- utility

## Repository Information

Last analyzed by OSRepos: Sat Aug 01 2026 12:09:50 GMT+0100 (Western European Summer Time)
Detail views: 0
GitHub clicks: 0

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## 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`:

bash
$ 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
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
bash
$ 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
*   [GitHub Repository](https://github.com/vinta/pangu.py)
*   [PyPI Project](https://pypi.org/project/pangu/)
*   Other `pangu` implementations:
    *   [pangu.js](https://github.com/vinta/pangu.js)
    *   [pangu.go](https://github.com/vinta/pangu)
    *   [pangu.java](https://github.com/vinta/pangu.java)
    *   [pangu.space](https://github.com/vinta/pangu.space)