Registry / data / normality

normality

JSON →
library3.1.0pypypi✓ verified 85d ago

Normality is a Python micro-package (current version 3.1.0) that provides a small set of text normalization functions for easier re-use. It accepts unicode or utf-8 encoded text and removes various classes of characters, such as diacritics and punctuation. This library is actively maintained and is useful as a preparation step for further text analysis.

pip install normality
INSTALL
IMPORT
SIG · NORMALITY
N
normality
datapythonv3.1.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

normalize
from normality import normalize
slugify
from normality import slugify
collapse_spaces
from normality import collapse_spaces
ascii_text
from normality import ascii_text
latinize_text
from normality import latinize_text

This quickstart demonstrates the core normalization functions of the `normality` library, including `normalize` for general text cleaning, `slugify` for creating URL-friendly slugs, and `collapse_spaces` for standardizing whitespace.

from normality import normalize, slugify, collapse_spaces text = normalize('Nie wieder "Grüne Süppchen" kochen!') print(f"Normalized: {text}") # Expected: nie wieder grune suppchen kochen slug = slugify('My first blog post!') print(f"Slugified: {slug}") # Expected: my-first-blog-post spaced_text = 'this \n\n\r\nhas\tlots of \nodd spacing.' cleaned_text = collapse_spaces(spaced_text) print(f"Collapsed spaces: {cleaned_text}") # Expected: this has lots of odd spacing.
Debug
Known issues
breakingAs of version 3.0, `normality` requires `pyicu` as a mandatory dependency. If `pyicu` cannot be installed, users should revert to `normality < 3.0.0` to avoid `ImportError` or runtime issues.
fix
Ensure `pyicu` is installed in your environment (`pip install pyicu`) or downgrade to `normality==2.*`.
affects: >=3.0.0
gotchaThe `normality` library for text normalization is often confused with statistical 'normality tests' (e.g., Shapiro-Wilk, D'Agostino-Pearson, Anderson-Darling) found in libraries like SciPy (`scipy.stats.normaltest`). These are entirely different concepts; `normality` focuses on text string manipulation, not statistical analysis of data distributions.
fix
Verify the intended purpose: `normality` (pudo/normality) for text, `scipy.stats.normaltest` (or similar) for statistical distribution testing.
affects: All versions
Errors
Common errors & fixes
ImportError: No module named 'icu'
The `pyicu` dependency, which is mandatory since `normality` version 3.0, is not installed in the environment.
fix
Install the `pyicu` package: `pip install pyicu`.
AttributeError: module 'normality' has no attribute 'normaltest'
`normality` is a text processing library, not a statistical library. Users are likely trying to call `scipy.stats.normaltest` mistakenly on the `normality` module.
fix
If you intend to perform statistical normality tests, import from `scipy.stats`: `from scipy.stats import normaltest`. If you want text normalization, use functions like `normality.normalize()`.
Upgrade
Version history
3.1.0latest on PyPI · released Mar 8, 2026
Audit
Dependencies
pyicurequiredMandatory dependency for normality versions 3.0 and above, used for advanced unicode normalization.
Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
normality — pip install normality · libregistry