Python library to "translate" a variety of unicode special characters to normal text
Project description
uni-translate
Python library to "translate" a variety of unicode special characters to normal text
can be used as a command line util for strings and text files, or as a library for easier and more flexible integration
Examples:
examples can be found in the /examples directory
Documentation:
-
[class] translator
-
-
[kwarg] Union[dict, List[str]]=None key:
-
-
-
-
key used to contruct a translation table, can be a list of strings contaning 52 characters (one for each letter, upper and lowercase), or a dict contaning key/value pairs that map each character in the key to a character in the value. (default is provided)
-
-
-
-
[kwarg] Union[str, List[str]]=None remove:
-
-
-
-
characters to be stripped during translation (default is provided)
-
-
-
-
[kwarg] (bool)=False debug:
-
-
-
-
toggles debug prints in the __init__
-
-
-
-
[method] translate -> str:
-
-
-
-
[arg] (str) text: text to be translated
-
-
-
-
[staticmethod] _trans -> str:
-
-
-
-
method to translate text via the given table
-
-
-
-
-
[arg] (str) text: text to be translated
-
-
-
-
-
[arg] Union[dict, Union[List[str], Tuple[str]]] table: table to use for translation, when a list or tuple is passed, the first element is treated as the key and the second element is treated as the value. dict should only be passed if it is a valid translation table (as obtained from str.maketrans)
-
-
-
-
[staticmethod] clean_key -> Tuple[str]:
-
-
-
-
returns the key cleaned of "normal" characters and duplicates, and its respective alphabet value
-
-
-
-
-
[arg] (str) key - key to be cleaned
-
-
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
uni-translate-0.0.2.tar.gz
(19.4 kB
view hashes)
Built Distribution
Close
Hashes for uni_translate-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8eb46f933ff187bad68580e057cfb6b7e6506566ae8ef038fe3b076684ace3fa |
|
MD5 | a04fcc395537ebc1cffa0c5c7e62432b |
|
BLAKE2b-256 | 53ddb35eee08a14b3d759762a416b7b97ec795e5d6f78045a26ec8bfcdca26ac |