skillfed

normality

Micro-library to normalize text strings

normality v3.1.0 294.8K downloads/30d#7,942 on PyPI158
Permissive license Copyright (c) 2013-2025, Friedrich Lindenberg, Gregor Aisch Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) Active released

What it is and what it does

Normality is a lightweight text-preprocessing library that applies a suite of Unicode normalization functions to prepare text for analysis. It removes diacritics (accents), punctuation, excess whitespace, and other character classes in a single pass, and can generate URL-safe slugs from arbitrary text. The package is built around a small set of composable functions—normalize, slugify, collapse_spaces, ascii_text, latinize_text—each handling a specific normalization task.

As of version 3.0, normality requires pyicu as a mandatory dependency, which brings full Unicode Collation Algorithm support but adds a system-level dependency. The package supports Python 3.10 through 3.13 and is actively maintained. It is useful as a preparation step for text analysis pipelines, search indexing, or any workflow where consistent text representation matters.

Use it for:

  • Normalize user-supplied text before indexing into a search engine or database.
  • Generate URL-safe slugs from article titles or user-generated content.
  • Clean and deduplicate text fields by removing diacritics and punctuation before comparison.
  • Preprocess multilingual text for downstream NLP or machine learning tasks.
  • Collapse irregular whitespace in scraped or imported text data.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Normality removes diacritics, punctuation, and other character classes from Unicode text to prepare it for downstream analysis, offering functions like normalize, slugify, and collapse_spaces.

Yes. Normality is a mature, actively maintained library with no known vulnerabilities, low install friction, and a permissive MIT license. It solves a concrete text-preprocessing problem with a small, focused API. Install it if you need to normalize Unicode text; avoid it only if pyicu is unavailable in your environment and you cannot use an older version.

Install

normality on PyPI

pip

pip install normality

uv

uv add normality

poetry

poetry add normality

Installing normality

Before you install

Low friction install with a pure-Python wheel. Actively maintained as of 2026-03-08 with recent commits. Note: version 3.0 and later require pyicu as a mandatory dependency; if that is unavailable in your environment, consider pinning to normality < 3.0.0.

License in practice

MIT license (permissive). You may use, modify, and distribute normality freely in commercial and private projects, provided you retain the copyright notice and license text.

Quickstart

pip install normality

from normality import normalize, slugify

text = normalize('Nie wieder "Grüne Süppchen" kochen!')
slug = slugify('My first blog post!')

Requires Python 3.10 or later. Version 3.0+ requires pyicu, which may need system ICU libraries; if unavailable, use normality < 3.0.0.

Verify before relying

  • Whether pyicu is available in your target deployment environment (it requires system ICU libraries on some platforms).

Package facts

License Copyright (c) 2013-2025, Friedrich Lindenberg, Gregor Aisch Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — banal, chardet, charset-normalizer, pyicu
Maintenance actively maintained — 159 days since the last release
Last repo commit
First released
Downloads 294,758/month — #7,942 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: normality-3.1.0-py3-none-any.whl

Keywords: normalization, slugs, text, unicode

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13

Tags

text normalization unicoderemove diacritics punctuationtext slugificationunicode text cleaningnormalize whitespacetext preprocessingcharacter normalization
text-preprocessingunicode-handling

More Linguistic packages