Skip to main content

Q – Rainer Schwarzbach’s Text Utilities

Project description

Q – Rainer Schwarzbach’s Text Utilities

Test conversion and transcoding utilities

Installation from PyPI

pip install qrstu

Installation in a virtual environment is strongly recommended.

Usage

guess

The guess module can be used to automatically detect and repair encoding errors (duplicate UTF-8 encoding of an already UTF-8 encoded text by misreading the bytes as another 8-bit encoding, eg. 'äöü'), but as the name says, it mostly works on the basis of an educated guess.

reduce

The reduce module can be used to reduce Unicode text in Latin script to ASCII encodable Unicode text, similar to Unidecode but taking a different approach (ie. mostly wrapping functionality from the standard library module unicodedata). Unlike Unidecode which also transliterates characters from non-Latin scripts, reduce stubbornly refuses to handle these.

You can, however, specify an optional errors= argument in the reduce.reduce_text() call, which is passed to the internally used codecs.encode() function, thus taking advance of the codecs module errors handling.

transcode

The transcode module provides various functions for decoding and encoding byte sequences to/from Unicode text.

Further reading

Please see the documentation at https://blackstream-x.gitlab.io/qrstu for detailed usage information.

If you found a bug or have a feature suggestion, please open an issue here

Project details


Download files

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

Source Distribution

qrstu-0.3.1.tar.gz (36.4 kB view hashes)

Uploaded Source

Built Distribution

qrstu-0.3.1-py3-none-any.whl (31.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page