A tiny utility to get the Unicode block of a character
Project description
tinyunicodeblock
A tiny utility to get the Unicode block of a character
This module provides only one ability that is absent from the built-in module unicodedata
.
It contains one function, block()
, which returns the name of a
Unicode block that a character belongs to.
You may also access basic Unicode block information by getting items from BLOCKS_BYNAME
.
Table of contents
📦 Installation
tinyunicodeblock
is available on PyPi.
It requires a Python version of at least 3.7.0. and depends on no packages.
To install with pip:
python -m pip install tinyunicodeblock
To install through Git:
python -m pip install git+https://gitlab.com/whoatemybutter/tinyunicodeblock.git
🛠 Usage
Only one function is publicly available, block(character)
.
It will return the name of a Unicode block that character
belongs to.
Block ranges are also available in the BLOCKS_BYNAME
dictionary.
>>> import tinyunicodeblock
>>> tinyunicodeblock.block("a")
'Basic Latin'
>>> tinyunicodeblock.block("\ufdfd")
'Arabic Presentation Forms-A'
>>> tinyunicodeblock.block("\ue845")
'Private Use Area'
>>> tinyunicodeblock.block("\ue845")
'Private Use Area'
>>> tinyunicodeblock.block("\U0009FFFF")
'No Block'
>>> tinyunicodeblock.BLOCKS_BYNAME["Basic Latin"]
(0, 127)
📰 Changelog
The changelog is at CHANGELOG.md.
📜 License
tinyunicodeblock
is licensed under
GNU General Public License 3.0 or later.
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
Hashes for tinyunicodeblock-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 280f6a6ac7ab596f38122622dd51684ffb59bc3648a64e42574a93d0df30c585 |
|
MD5 | 2b0caf0bc996e74df6598feafcaa85fa |
|
BLAKE2b-256 | ef302c6d6642b360f13cc63f617996afb2e0998775a68f34d5fe7ede235db6ad |