tinyunicodeblock


Nametinyunicodeblock JSON
Version 1.3 PyPI version JSON
download
home_page
SummaryA tiny utility to get the Unicode block of a character
upload_time2023-01-14 00:49:03
maintainer
docs_urlNone
authorWhoAteMyButter
requires_python>=3.7
licenseMIT
keywords unicode unicode block unicode character block character block unicode utility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="./logo.png" width=55 height=55 align="right"/>

# tinyunicodeblock
> A tiny utility to get the Unicode block of a character

[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://black.readthedocs.io/en/stable/)
[![Pylint](https://img.shields.io/badge/pylint-10.00/10.00-ffbf48)](https://pylint.pycqa.org/en/latest/)
[![License](https://img.shields.io/gitlab/license/whoatemybutter/tinyunicodeblock)](https://spdx.org/licenses/MIT.html)
[![PyPi](https://img.shields.io/pypi/v/tinyunicodeblock)](https://pypi.org/project/tinyunicodeblock/)
[![Pipeline status](https://gitlab.com/whoatemybutter/tinyunicodeblock/badges/master/pipeline.svg)](https://gitlab.com/whoatemybutter/tinyunicodeblock/-/commits/master)  

This module provides only one ability that is absent from the built-in module [`unicodedata`](https://docs.python.org/3/library/unicodedata.html).
<br/>
It contains one function, `block()`, which returns the name of a
[Unicode block](https://www.unicode.org/faq/blocks_ranges.html) that a character belongs to.

You may also access basic Unicode block information by getting items from `BLOCKS_BYNAME`.

## Table of contents
- [📦 Installation](#-installation)
- [🛠 Usage](#-usage)
- [📰 Changelog](#-changelog)
- [📜 License](#-license)

---

## 📦 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:
```shell
python -m pip install tinyunicodeblock
```

To install through Git:
```shell
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.

```python
>>> import tinyunicodeblock
>>> tinyunicodeblock.block("a")
'Basic Latin'
>>> tinyunicodeblock.block("\ufdfd")
'Arabic Presentation Forms-A'
>>> tinyunicodeblock.block("\ue845")
'Private Use Area'
>>> tinyunicodeblock.BLOCKS_BYNAME["Basic Latin"]
(0, 127)
```

### CSUR Support
Since v1.2, tinyunicodeblocks contains support for the [ConScript Unicode Registry (CSUR)](https://www.evertype.com/standards/csur/).

It is available through the variables `CSUR` and `CSUR_BYNAME`.
The function `block()` will optionally include CSUR blocks in its results if the argument `include_csur=True` is passed to it.

```python
>>> tinyunicodeblock.block("\ue845", include_csur=True)
'Dni'
>>> tinyunicodeblock.block("\ue400", include_csur=True)
'Niskloz'
>>> tinyunicodeblock.block("\uf800", include_csur=True)
'Private Use Area'
```

> tinyunicodeblocks **does not** contain support for the [Under-ConScript Unicode Registry (UCSUR)](https://www.kreativekorp.com/ucsur/).
---

## 📰 Changelog

The changelog is at [CHANGELOG.md](CHANGELOG.md).

---

## 📜 License

`tinyunicodeblock` v1.2 and above is licensed under
[MIT](https://spdx.org/licenses/MIT.html).

`tinyunicodeblock` v1.1 and below is licensed under
[GNU General Public License 3.0 or later](https://spdx.org/licenses/GPL-3.0-or-later.html).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tinyunicodeblock",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "unicode,unicode block,unicode character,block,character block,unicode utility",
    "author": "WhoAteMyButter",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/98/18/205ae2342d900ed5b99323323d06d99ff28067842a7fe1151fbd405cc237/tinyunicodeblock-1.3.tar.gz",
    "platform": null,
    "description": "<img src=\"./logo.png\" width=55 height=55 align=\"right\"/>\n\n# tinyunicodeblock\n> A tiny utility to get the Unicode block of a character\n\n[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://black.readthedocs.io/en/stable/)\n[![Pylint](https://img.shields.io/badge/pylint-10.00/10.00-ffbf48)](https://pylint.pycqa.org/en/latest/)\n[![License](https://img.shields.io/gitlab/license/whoatemybutter/tinyunicodeblock)](https://spdx.org/licenses/MIT.html)\n[![PyPi](https://img.shields.io/pypi/v/tinyunicodeblock)](https://pypi.org/project/tinyunicodeblock/)\n[![Pipeline status](https://gitlab.com/whoatemybutter/tinyunicodeblock/badges/master/pipeline.svg)](https://gitlab.com/whoatemybutter/tinyunicodeblock/-/commits/master)  \n\nThis module provides only one ability that is absent from the built-in module [`unicodedata`](https://docs.python.org/3/library/unicodedata.html).\n<br/>\nIt contains one function, `block()`, which returns the name of a\n[Unicode block](https://www.unicode.org/faq/blocks_ranges.html) that a character belongs to.\n\nYou may also access basic Unicode block information by getting items from `BLOCKS_BYNAME`.\n\n## Table of contents\n- [\ud83d\udce6 Installation](#-installation)\n- [\ud83d\udee0 Usage](#-usage)\n- [\ud83d\udcf0 Changelog](#-changelog)\n- [\ud83d\udcdc License](#-license)\n\n---\n\n## \ud83d\udce6 Installation\n\n`tinyunicodeblock` is available on PyPi. \nIt requires a Python version of **at least 3.7.0.** and depends on **no packages**.\n\nTo install with pip:\n```shell\npython -m pip install tinyunicodeblock\n```\n\nTo install through Git:\n```shell\npython -m pip install git+https://gitlab.com/whoatemybutter/tinyunicodeblock.git\n```\n\n---\n\n## \ud83d\udee0 Usage\n\nOnly one function is publicly available, `block(character)`.\nIt will return the name of a Unicode block that `character` belongs to.\n\nBlock ranges are also available in the `BLOCKS_BYNAME` dictionary.\n\n```python\n>>> import tinyunicodeblock\n>>> tinyunicodeblock.block(\"a\")\n'Basic Latin'\n>>> tinyunicodeblock.block(\"\\ufdfd\")\n'Arabic Presentation Forms-A'\n>>> tinyunicodeblock.block(\"\\ue845\")\n'Private Use Area'\n>>> tinyunicodeblock.BLOCKS_BYNAME[\"Basic Latin\"]\n(0, 127)\n```\n\n### CSUR Support\nSince v1.2, tinyunicodeblocks contains support for the [ConScript Unicode Registry (CSUR)](https://www.evertype.com/standards/csur/).\n\nIt is available through the variables `CSUR` and `CSUR_BYNAME`.\nThe function `block()` will optionally include CSUR blocks in its results if the argument `include_csur=True` is passed to it.\n\n```python\n>>> tinyunicodeblock.block(\"\\ue845\", include_csur=True)\n'Dni'\n>>> tinyunicodeblock.block(\"\\ue400\", include_csur=True)\n'Niskloz'\n>>> tinyunicodeblock.block(\"\\uf800\", include_csur=True)\n'Private Use Area'\n```\n\n> tinyunicodeblocks **does not** contain support for the [Under-ConScript Unicode Registry (UCSUR)](https://www.kreativekorp.com/ucsur/).\n---\n\n## \ud83d\udcf0 Changelog\n\nThe changelog is at [CHANGELOG.md](CHANGELOG.md).\n\n---\n\n## \ud83d\udcdc License\n\n`tinyunicodeblock` v1.2 and above is licensed under\n[MIT](https://spdx.org/licenses/MIT.html).\n\n`tinyunicodeblock` v1.1 and below is licensed under\n[GNU General Public License 3.0 or later](https://spdx.org/licenses/GPL-3.0-or-later.html).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A tiny utility to get the Unicode block of a character",
    "version": "1.3",
    "split_keywords": [
        "unicode",
        "unicode block",
        "unicode character",
        "block",
        "character block",
        "unicode utility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dcc93e772f3d3dda90f2e6b69763b8a6325401de5c19aef2888a3d28ac5fa714",
                "md5": "da5cae065f4b60c7a8db58414db805f5",
                "sha256": "07edc5f9bdc9e8ee61080c28a453ada50a476caef139c83d0f0209b4f6384fe0"
            },
            "downloads": -1,
            "filename": "tinyunicodeblock-1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "da5cae065f4b60c7a8db58414db805f5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10867,
            "upload_time": "2023-01-14T00:49:01",
            "upload_time_iso_8601": "2023-01-14T00:49:01.634263Z",
            "url": "https://files.pythonhosted.org/packages/dc/c9/3e772f3d3dda90f2e6b69763b8a6325401de5c19aef2888a3d28ac5fa714/tinyunicodeblock-1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9818205ae2342d900ed5b99323323d06d99ff28067842a7fe1151fbd405cc237",
                "md5": "90660699e3272b7253e986c3eba77060",
                "sha256": "cc305f81e3bac4f97b5e3c034a65577ca5ed18be00fd3abb9b31b697c341c9cb"
            },
            "downloads": -1,
            "filename": "tinyunicodeblock-1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "90660699e3272b7253e986c3eba77060",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11777,
            "upload_time": "2023-01-14T00:49:03",
            "upload_time_iso_8601": "2023-01-14T00:49:03.229274Z",
            "url": "https://files.pythonhosted.org/packages/98/18/205ae2342d900ed5b99323323d06d99ff28067842a7fe1151fbd405cc237/tinyunicodeblock-1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-14 00:49:03",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "tinyunicodeblock"
}
        
Elapsed time: 0.02676s