Python bindings for rehuman: Unicode-safe text cleaning & normalization
Project description
rehuman (Python)
Python bindings for rehuman built with PyO3 + maturin.
Install (Development)
cd python
python -m venv .venv
source .venv/bin/activate
pip install -U pip maturin pytest
maturin develop
Documentation
See python/docs/index.md for the Python docs map.
Quickstart
clean() and humanize() both return str, but they target different outputs:
clean(text): ASCII/keyboard-safe text (drops emoji by default, transliterates when feasible)humanize(text): human-readable Unicode text (keeps Unicode, collapses repeated whitespace)
import rehuman
text = "A B 👍 Café"
cleaned = rehuman.clean(text) # "A B Cafe"
humanized = rehuman.humanize(text) # "A B 👍 Café"
assert cleaned == "A B Cafe"
assert humanized == "A B 👍 Café"
# Use Cleaner for change counts and stats
cleaner = rehuman.Cleaner()
result = cleaner.clean("Hi\u200bthere \U0001f44d")
print(result.text) # "Hithere"
print(result.changes_made) # e.g. 3
print(result.stats) # dict with per-operation counters
For exact behavior differences and presets, see:
Tests
cd python
source .venv/bin/activate
pytest -q
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rehuman-0.1.3.tar.gz.
File metadata
- Download URL: rehuman-0.1.3.tar.gz
- Upload date:
- Size: 49.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53ff0cd88458fccd4d20bfa1aafc81f86ca72e22c4c37779d596757439d189f8
|
|
| MD5 |
2136530d5a19db95d3915d73dd378e4c
|
|
| BLAKE2b-256 |
d78765f47ad0c9aa6949c61e533e13f5b7d7212a056561a5adb8f47e30409609
|
Provenance
The following attestation bundles were made for rehuman-0.1.3.tar.gz:
Publisher:
python-pypi-publish.yml on pszemraj/rehuman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rehuman-0.1.3.tar.gz -
Subject digest:
53ff0cd88458fccd4d20bfa1aafc81f86ca72e22c4c37779d596757439d189f8 - Sigstore transparency entry: 1003418877
- Sigstore integration time:
-
Permalink:
pszemraj/rehuman@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/pszemraj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-pypi-publish.yml@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rehuman-0.1.3-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: rehuman-0.1.3-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 412.1 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e7bc9836a61d760cf00abd04e1e7d023f4e41a90a4e9c799d49fd0af5cfdc6e
|
|
| MD5 |
0f81c48418bc2de03ac3a0d0f3edd84a
|
|
| BLAKE2b-256 |
0b29da0f7509832171eae02e379ce1f4acfb66b2f032e8832c9dce2313b74817
|
Provenance
The following attestation bundles were made for rehuman-0.1.3-cp39-abi3-win_amd64.whl:
Publisher:
python-pypi-publish.yml on pszemraj/rehuman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rehuman-0.1.3-cp39-abi3-win_amd64.whl -
Subject digest:
1e7bc9836a61d760cf00abd04e1e7d023f4e41a90a4e9c799d49fd0af5cfdc6e - Sigstore transparency entry: 1003418895
- Sigstore integration time:
-
Permalink:
pszemraj/rehuman@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/pszemraj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-pypi-publish.yml@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rehuman-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rehuman-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 503.3 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baf3196dbf80fc190f14728dc0be3845661c13093c50df92129c03206e9c0ce1
|
|
| MD5 |
7647bafe7eaa597c0aca3c00405f3062
|
|
| BLAKE2b-256 |
50af365e3921e275cc045eecabd162ff2c23ae666e65d23bf86612d2a0285404
|
Provenance
The following attestation bundles were made for rehuman-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
python-pypi-publish.yml on pszemraj/rehuman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rehuman-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
baf3196dbf80fc190f14728dc0be3845661c13093c50df92129c03206e9c0ce1 - Sigstore transparency entry: 1003418902
- Sigstore integration time:
-
Permalink:
pszemraj/rehuman@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/pszemraj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-pypi-publish.yml@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rehuman-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: rehuman-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 494.5 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0b588bddbe5d28fe35a326b7cdb619c49fdaefb82fc1773d095e828a9a1435f
|
|
| MD5 |
b8bca49a0e89fd0f0b0918af902089c1
|
|
| BLAKE2b-256 |
1a7acc53e6274425b6b6cfe4ad2fbb5042c714e27339134adbb63448de9b0213
|
Provenance
The following attestation bundles were made for rehuman-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
python-pypi-publish.yml on pszemraj/rehuman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rehuman-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
f0b588bddbe5d28fe35a326b7cdb619c49fdaefb82fc1773d095e828a9a1435f - Sigstore transparency entry: 1003418890
- Sigstore integration time:
-
Permalink:
pszemraj/rehuman@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/pszemraj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-pypi-publish.yml@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rehuman-0.1.3-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: rehuman-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 482.7 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3aba27c95703410def6865da6eea8bc79f0f828c33d80dc267d15db3d8f40a6
|
|
| MD5 |
c75d9b8e85c846f66c037e02fdd1565c
|
|
| BLAKE2b-256 |
d4acf6f834110390ee5d90424d81ea617d656ae9a81e84c97859cde51c5dea40
|
Provenance
The following attestation bundles were made for rehuman-0.1.3-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
python-pypi-publish.yml on pszemraj/rehuman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rehuman-0.1.3-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
d3aba27c95703410def6865da6eea8bc79f0f828c33d80dc267d15db3d8f40a6 - Sigstore transparency entry: 1003418882
- Sigstore integration time:
-
Permalink:
pszemraj/rehuman@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/pszemraj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-pypi-publish.yml@22f26ec7dff73f1c53c9bf9307fc0247e286ec38 -
Trigger Event:
release
-
Statement type: