This package contains codecs for transliterating ISO 10646 texts into best-effort representations using smaller coded character sets (ASCII, ISO 8859, etc.). It is a C reimplementation of the [translitcodec][1] module by Jason Kirtland, as well as a drop-in replacement.
The translation tables used by the codecs are from the [transtab][2] collection by [Prof. Markus Kuhn][3], with some extensions by [Fazal Majid][4].
Three types of transliterating codecs are provided:
- “long”, using as many characters as needed to make a natural
replacement. For example, u00e4 LATIN SMALL LETTER A WITH DIAERESIS ä will be replaced with ae.
“short”, using the minimum number of characters to make a replacement. For example, u00e4 LATIN SMALL LETTER A WITH DIAERESIS ä will be replaced with a.
“one”, only performing single character replacements. Characters that can not be transliterated with a single character are passed through unchanged. For example, u2639 WHITE FROWNING FACE ☹ will be passed through unchanged.
Using the codecs is simple:
>>> import ctranslitcodec >>> import codecs >>> codecs.encode(u'fácil € ☺', 'ctranslit/long') u'facil EUR :-)' >>> codecs.encode(u'fácil € ☺', 'ctranslit/short') u'facil E :-)'
[1]: https://pypi.org/project/translitcodec/ [2]: https://www.cl.cam.ac.uk/~mgk25/unicode.html#libs [3]: https://www.cl.cam.ac.uk/~mgk25/ [4]: https://majid.info/
Metadata
Release files for ctranslitcodec 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ctranslitcodec-0.2.1.tar.gz | 54.0 kB | Without provenance | Details for ctranslitcodec-0.2.1.tar.gz |
Release files / ctranslitcodec-0.2.1.tar.gz
| Download URL | ctranslitcodec-0.2.1.tar.gz |
|---|---|
| Size | 54.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc494143e20e06f1aa46903519eed967ca20efdc1301a367ebc085bec0d1c325
|
|
BLAKE2b-256 checksum How to use checksums |
09b26cdb296b1cc5eda89722f93c7e77633aaf3b38d854dda3677f15cd53baed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for ctranslitcodec 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.