Micro-library to normalize text strings
Project description
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).
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 Distributions
Built Distribution
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 normality-3.0.2-py3-none-any.whl.
File metadata
- Download URL: normality-3.0.2-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f013db2fdd831f26ae8b23f2e2652501ff0f9bdcb24d889ba5dc87c88a595288
|
|
| MD5 |
47da1166cea47478739aba70a87827ca
|
|
| BLAKE2b-256 |
d328779296044b38322463d1b0273f36e05b417410a4b66376879ca8bed227a8
|
Provenance
The following attestation bundles were made for normality-3.0.2-py3-none-any.whl:
Publisher:
build.yml on pudo/normality
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
normality-3.0.2-py3-none-any.whl -
Subject digest:
f013db2fdd831f26ae8b23f2e2652501ff0f9bdcb24d889ba5dc87c88a595288 - Sigstore transparency entry: 505881654
- Sigstore integration time:
-
Permalink:
pudo/normality@35b589bc408b4353035d6c9213ffd3686540fa38 -
Branch / Tag:
refs/tags/3.0.2 - Owner: https://github.com/pudo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@35b589bc408b4353035d6c9213ffd3686540fa38 -
Trigger Event:
push
-
Statement type: