normality


Namenormality JSON
Version 2.6.1 PyPI version JSON
download
home_pageNone
SummaryMicro-library to normalize text strings
upload_time2025-01-09 17:32:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseCopyright (c) 2013-2022, 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 "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords normalization slugs text unicode
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": null,
    "name": "normality",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "normalization, slugs, text, unicode",
    "author": null,
    "author_email": "Friedrich Lindenberg <friedrich@pudo.org>",
    "download_url": null,
    "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": "Copyright (c) 2013-2022, 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 \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Micro-library to normalize text strings",
    "version": "2.6.1",
    "project_urls": {
        "Documentation": "https://github.com/pudo/normality",
        "Issues": "https://github.com/pudo/normality/issues",
        "Repository": "https://github.com/pudo/normality.git"
    },
    "split_keywords": [
        "normalization",
        " slugs",
        " text",
        " unicode"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e1110a67d503652e38f0dc6383ffccc498d2ec1168d5cc1d5b01c971082b7f03",
                "md5": "4eaea00847d84f8dabeeb45afa61ed3f",
                "sha256": "cdbc1edd144b3fba6d2aa457cb6abd123e7f3c6e46960c9b80321cac9caaf494"
            },
            "downloads": -1,
            "filename": "normality-2.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4eaea00847d84f8dabeeb45afa61ed3f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 17057,
            "upload_time": "2025-01-09T17:32:54",
            "upload_time_iso_8601": "2025-01-09T17:32:54.826900Z",
            "url": "https://files.pythonhosted.org/packages/e1/11/0a67d503652e38f0dc6383ffccc498d2ec1168d5cc1d5b01c971082b7f03/normality-2.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-09 17:32:54",
    "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.79577s