Convert HKSCS codepoints to corresponding new codepoints in Unicode 4.1 onwards
Project description
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!
Project details
Release history Release notifications | RSS feed
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 hkscs-unicode-converter-1.1.0.tar.gz
.
File metadata
- Download URL: hkscs-unicode-converter-1.1.0.tar.gz
- Upload date:
- Size: 557.5 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 580d08b8c7be992d7e7d602802279ce6f9ad23e7593d10faa84b3512b4c98495 |
|
MD5 | e928a935331508f3c2c693d2887cd88f |
|
BLAKE2b-256 | 9baf865c700bfa78a9c92536759ce7fd34247ead63a05e7c72e0bb1f2682e790 |
File details
Details for the file hkscs_unicode_converter-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: hkscs_unicode_converter-1.1.0-py3-none-any.whl
- Upload date:
- Size: 561.4 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1c78d1ef84711e11d9c67f01c505742ce0bccfef12a2f25972c18189bc5a9af |
|
MD5 | 30fafce7e8fb0f48f04553e016472ab6 |
|
BLAKE2b-256 | 42b3232c8a55c6eaafd5111c6342303b69bed4f846cc22b730bc9449b554a12b |