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
Built Distribution
File details
Details for the file qrstu-0.3.0.tar.gz
.
File metadata
- Download URL: qrstu-0.3.0.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f12fa04557a0e9d6c01d0db81aba0fbf847f3a6639a97e05dcb283c6f5705dd1 |
|
MD5 | 1fedb2a2446acca2f6c9576dba39e5ab |
|
BLAKE2b-256 | d01f05b1c058c75df4e562e7d5bb4b6c30337a8a0c02749024e5395067cb7f05 |
File details
Details for the file qrstu-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: qrstu-0.3.0-py3-none-any.whl
- Upload date:
- Size: 31.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e2acd8d54c958b1f5f8cb249fd8e270535e33256e864c791c46816acebdf0bc |
|
MD5 | 00f2fec04ff16ebc07e11240b7530430 |
|
BLAKE2b-256 | 158116d4578cd436c0beb026230e791f740556e4fe78ab06c04c54f6aefb5b26 |