Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Take unicode string, leave czech characters, normalize rest.

Project Description

normalize_cz_unicode

Sanitize unicode inputs from unwanted characters.

Principle of the module is simple; Use translation table. If the character is not in translation table, convert it to latin2. If it can’t be converted, try to normalize it using unicode NKFD normalization. If it can’t be normalized, replace it with ?.

Usage

>>> from normalize_cz_unicode import normalize
>>> print normalize("Tohle je smajlík: 😭 , který tu ale nechci.")
Tohle je smajlík: ? , který tu ale nechci.

Various whitespace and special dash characters are normalized to basic ascii:

>>> a = u"Spojovníky ― a další havěť jako nedělitelné mezery taky nechci."
u'Spojovn\xedky \u2015 a dal\u0161\xed hav\u011b\u0165 jako ned\u011bliteln\xe9\u202fmezery\u2007taky nechci.'
>>> normalize(a)
u'Spojovn\xedky - a dal\u0161\xed hav\u011b\u0165 jako ned\u011bliteln\xe9 mezery taky nechci.'

Installation

Module is hosted at PYPI, and can be installed using PIP:

sudo pip install normalize_cz_unicode

Changelog

1.0.1

  • Added caching.

1.0.0

  • First working version.
  • Added tests.
  • Added documentation to README.rst.
  • Uploaded to PYPI.

0.1.0

  • Project created.
Release History

Release History

This version
History Node

1.0.1

History Node

1.0.0

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
normalize_cz_unicode-1.0.1.tar.gz (4.6 kB) Copy SHA256 Checksum SHA256 Source May 21, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting