Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rehuman-0.1.3.tar.gz (49.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rehuman-0.1.3-cp39-abi3-win_amd64.whl (412.1 kB view details)

Uploaded CPython 3.9+Windows x86-64

rehuman-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (503.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

rehuman-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (494.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

rehuman-0.1.3-cp39-abi3-macosx_11_0_arm64.whl (482.7 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

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

Hashes for rehuman-0.1.3.tar.gz
Algorithm Hash digest
SHA256 53ff0cd88458fccd4d20bfa1aafc81f86ca72e22c4c37779d596757439d189f8
MD5 2136530d5a19db95d3915d73dd378e4c
BLAKE2b-256 d78765f47ad0c9aa6949c61e533e13f5b7d7212a056561a5adb8f47e30409609

See more details on using hashes here.

Provenance

The following attestation bundles were made for rehuman-0.1.3.tar.gz:

Publisher: python-pypi-publish.yml on pszemraj/rehuman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for rehuman-0.1.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1e7bc9836a61d760cf00abd04e1e7d023f4e41a90a4e9c799d49fd0af5cfdc6e
MD5 0f81c48418bc2de03ac3a0d0f3edd84a
BLAKE2b-256 0b29da0f7509832171eae02e379ce1f4acfb66b2f032e8832c9dce2313b74817

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rehuman-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rehuman-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 baf3196dbf80fc190f14728dc0be3845661c13093c50df92129c03206e9c0ce1
MD5 7647bafe7eaa597c0aca3c00405f3062
BLAKE2b-256 50af365e3921e275cc045eecabd162ff2c23ae666e65d23bf86612d2a0285404

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rehuman-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rehuman-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f0b588bddbe5d28fe35a326b7cdb619c49fdaefb82fc1773d095e828a9a1435f
MD5 b8bca49a0e89fd0f0b0918af902089c1
BLAKE2b-256 1a7acc53e6274425b6b6cfe4ad2fbb5042c714e27339134adbb63448de9b0213

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rehuman-0.1.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rehuman-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d3aba27c95703410def6865da6eea8bc79f0f828c33d80dc267d15db3d8f40a6
MD5 c75d9b8e85c846f66c037e02fdd1565c
BLAKE2b-256 d4acf6f834110390ee5d90424d81ea617d656ae9a81e84c97859cde51c5dea40

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page