hkscs-unicode-converter
hkscs-unicode-converter is a utility for converting HKSCS characters assigned to Private Use Areas of Unicode to their equivalents in Unicode 4.1 onwards. Inspired by the npm module of the same name.
>>> from hkscs_unicode_converter import converter
>>> converter.convert_string("亂廿四") # Convert an entire string
'亂噏廿四'
>>> converter.convert_char("") # Convert a single character
'嘅'
>>> converter.convert_char(chr(0xE7D4)) # Convert from codepoint
'啱'
>>> converter.convert_char("\uE7D4") # Convert from Unicode literal
'啱'
>>> hex(ord(converter.convert_char(chr(0xE7D4)))) # Get corresponding codepoint
'0x5571'
Installing
hkscs-unicode-converter is available on PyPI and officially supports Python 3.7+:
$ python3 -m pip install hkscs-unicode-converter
Tests
Tests are located in the hkscs_unicode_converter submodule. Testing uses tox to automate environment management and the built-in unittest framework to run tests.
$ tox
Style Guide
Run black before committing to master!
Metadata
Release files for hkscs-unicode-converter 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hkscs-unicode-converter-1.1.0.tar.gz | 557.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hkscs_unicode_converter-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / hkscs-unicode-converter-1.1.0.tar.gz
| Download URL | hkscs-unicode-converter-1.1.0.tar.gz |
|---|---|
| Size | 557.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
580d08b8c7be992d7e7d602802279ce6f9ad23e7593d10faa84b3512b4c98495
|
|
BLAKE2b-256 checksum How to use checksums |
9baf865c700bfa78a9c92536759ce7fd34247ead63a05e7c72e0bb1f2682e790
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.6
|
Release files / hkscs_unicode_converter-1.1.0-py3-none-any.whl
| Download URL | hkscs_unicode_converter-1.1.0-py3-none-any.whl |
|---|---|
| Size | 561.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1c78d1ef84711e11d9c67f01c505742ce0bccfef12a2f25972c18189bc5a9af
|
|
BLAKE2b-256 checksum How to use checksums |
42b3232c8a55c6eaafd5111c6342303b69bed4f846cc22b730bc9449b554a12b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.6
|