normality


Namenormality JSON
Version 2.5.0 PyPI version JSON
download
home_page
SummaryMicro-library to normalize text strings
upload_time2023-10-07 20:15:49
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords text unicode normalization slugs
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # normality text cleanup

[![build](https://github.com/pudo/normality/actions/workflows/build.yml/badge.svg)](https://github.com/pudo/normality/actions/workflows/build.yml)

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**: This library works much better when used in combination 
with ``pyicu``, a Python binding for the International Components for
Unicode C library. ICU provides much better text transliteration than
the default ``text-unidecode``.

## Example

```python
# coding: utf-8
from normality import normalize, slugify, collapse_spaces

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``).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "normality",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "text,unicode,normalization,slugs",
    "author": "",
    "author_email": "Friedrich Lindenberg <friedrich@pudo.org>",
    "download_url": "https://files.pythonhosted.org/packages/e0/12/6452229afa2331de60fe93324dd9e2eb6034cb2e2faf6867419d9c51d356/normality-2.5.0.tar.gz",
    "platform": null,
    "description": "# normality text cleanup\n\n[![build](https://github.com/pudo/normality/actions/workflows/build.yml/badge.svg)](https://github.com/pudo/normality/actions/workflows/build.yml)\n\nNormality is a Python micro-package that contains a small set of text\nnormalization functions for easier re-use. These functions accept a\nsnippet of unicode or utf-8 encoded text and remove various classes\nof characters, such as diacritics, punctuation etc. This is useful as\na preparation to further text analysis.\n\n**WARNING**: This library works much better when used in combination \nwith ``pyicu``, a Python binding for the International Components for\nUnicode C library. ICU provides much better text transliteration than\nthe default ``text-unidecode``.\n\n## Example\n\n```python\n# coding: utf-8\nfrom normality import normalize, slugify, collapse_spaces\n\ntext = normalize('Nie wieder \"Gr\u00fcne S\u00fcppchen\" kochen!')\nassert text == 'nie wieder grune suppchen kochen'\n\nslug = slugify('My first blog post!')\nassert slug == 'my-first-blog-post'\n\ntext = 'this \\n\\n\\r\\nhas\\tlots of \\nodd spacing.'\nassert collapse_spaces(text) == 'this has lots of odd spacing.'\n```\n\n## License\n\n``normality`` is open source, licensed under a standard MIT license\n(included in this repository as ``LICENSE``).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Micro-library to normalize text strings",
    "version": "2.5.0",
    "project_urls": {
        "Homepage": "http://github.com/pudo/normality"
    },
    "split_keywords": [
        "text",
        "unicode",
        "normalization",
        "slugs"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae29cdd620678624e76de4034d1d69eb978cae4a96983dde963586f711261196",
                "md5": "b3cb05cd990e13d1ba497cfe8d6f85a8",
                "sha256": "d9f48daf32e351e88b9e372787c1da437df9d0d818aec6e2834b02102378df62"
            },
            "downloads": -1,
            "filename": "normality-2.5.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b3cb05cd990e13d1ba497cfe8d6f85a8",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 16504,
            "upload_time": "2023-10-07T20:15:48",
            "upload_time_iso_8601": "2023-10-07T20:15:48.196305Z",
            "url": "https://files.pythonhosted.org/packages/ae/29/cdd620678624e76de4034d1d69eb978cae4a96983dde963586f711261196/normality-2.5.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0126452229afa2331de60fe93324dd9e2eb6034cb2e2faf6867419d9c51d356",
                "md5": "12f8652756c93117af3c32e54d9747be",
                "sha256": "a55133e972b81c4a3bf8b6dc419f262f94a4fd6f636297046f74d35c93abe153"
            },
            "downloads": -1,
            "filename": "normality-2.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "12f8652756c93117af3c32e54d9747be",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17873,
            "upload_time": "2023-10-07T20:15:49",
            "upload_time_iso_8601": "2023-10-07T20:15:49.942160Z",
            "url": "https://files.pythonhosted.org/packages/e0/12/6452229afa2331de60fe93324dd9e2eb6034cb2e2faf6867419d9c51d356/normality-2.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-07 20:15:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pudo",
    "github_project": "normality",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "normality"
}
        
Elapsed time: 0.12287s