normality
Normality is a Python micro-package that contains a small set of text normalization functions for easier re-use. These functions accept a snippet of unicode or utf-8 encoded text and remove various classes of characters, such as diacritics, punctuation etc. This is useful as a preparation to further text analysis.
WARNING: As of version 3.0, normality requires pyicu as a mandatory dependency. If you cannot install pyicu, consider using normality < 3.0.0.
Example
# coding: utf-8
from normality import normalize, slugify, collapse_spaces, ascii_text, latinize_text
text = normalize('Nie wieder "Grüne Süppchen" kochen!')
assert text == 'nie wieder grune suppchen kochen'
slug = slugify('My first blog post!')
assert slug == 'my-first-blog-post'
text = 'this \n\n\r\nhas\tlots of \nodd spacing.'
assert collapse_spaces(text) == 'this has lots of odd spacing.'
License
normality is open source, licensed under a standard MIT license (included in this repository as LICENSE).
Metadata
Release files for normality 3.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| normality-3.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / normality-3.1.0-py3-none-any.whl
| Download URL | normality-3.1.0-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
850419eb8cbc43c79afe005b93155cf41c5dd26c7d6e2a0aa6452f3210c0b338
|
|
BLAKE2b-256 checksum How to use checksums |
76e36da3194df038e2476cf9384f807c8f0c486b579f54799458f238c2d2d8da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.
Transparency log