# unicode-charnames
This package is built for Unicode version 16.0, released in September 2024.
The library provides:
* A function to retrieve the character name (the normative “Name” property) or the code point label (for characters without names) for any Unicode character.
* A function to get the code point (in the usual 4- to 6-digit hexadecimal format) for a given Unicode character name. The search is case-sensitive and requires an exact match.
* A function to search for characters by name. The search is case-insensitive but requires an exact substring match.
The generic term “character name” refers to the Unicode character “Name” property value for an encoded character. For code points that do not have character names (unassigned, reserved code points, and other special code point types), the Unicode standard uses constructed code point labels in angle brackets to represent these characters.
### Installation and updates
To install the package, run:
```shell
pip install unicode-charnames
```
To upgrade to the latest version, run:
```shell
pip install unicode-charnames --upgrade
```
### Unicode character database (UCD) version
To retrieve the version of the Unicode character database in use:
```python
>>> from unicode_charnames import UCD_VERSION
>>> UCD_VERSION
'16.0.0'
```
### Example usage
```python
from unicode_charnames import charname, codepoint, search_charnames
# charname
for char in '龠💓\u00E5\u0002':
print(charname(char))
# CJK UNIFIED IDEOGRAPH-9FA0
# BEATING HEART
# LATIN SMALL LETTER A WITH RING ABOVE
# <control-0002>
# codepoint
for name in [
'LATIN CAPITAL LETTER E WITH ACUTE',
'SQUARE ERA NAME REIWA',
'SUPERCALIFRAGILISTICEXPIALIDOCIOUS'
]:
print(codepoint(name))
# 00C9
# 32FF
# None
# search_charnames
for x in search_charnames('break'):
print('\t'.join(x))
# 00A0 NO-BREAK SPACE
# 2011 NON-BREAKING HYPHEN
# 202F NARROW NO-BREAK SPACE
# 4DEA HEXAGRAM FOR BREAKTHROUGH
# FEFF ZERO WIDTH NO-BREAK SPACE
```
### Related resource
This library is based on [Section 4.8, “Name,” in the Unicode Core Specification, version 16.0.0](https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-4/#G2082).
### Licenses
The code is licensed under the [MIT license](https://github.com/mlodewijck/unicode_charnames/blob/master/LICENSE).
Usage of Unicode data files is subject to the [UNICODE TERMS OF USE](https://www.unicode.org/copyright.html). Additional rights and restrictions regarding Unicode data files and software are outlined in the [Unicode Data Files and Software License](https://www.unicode.org/license.txt), a copy of which is included as [UNICODE-LICENSE](https://github.com/mlodewijck/unicode_charnames/blob/master/UNICODE-LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/mlodewijck/unicode_charnames",
"name": "unicode-charnames",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "Unicode, Unicode data, Unicode characters, character names, characters",
"author": "Marc Lodewijck",
"author_email": "mlodewijck@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f1/25/d16bb7075c324992087b9b97465f438ed85facf537147fd6e304ba71efd6/unicode_charnames-16.0.0.tar.gz",
"platform": null,
"description": "# unicode-charnames\r\nThis package is built for Unicode version 16.0, released in September 2024.\r\n\r\nThe library provides:\r\n\r\n* A function to retrieve the character name (the normative \u201cName\u201d property) or the code point label (for characters without names) for any Unicode character.\r\n* A function to get the code point (in the usual 4- to 6-digit hexadecimal format) for a given Unicode character name. The search is case-sensitive and requires an exact match.\r\n* A function to search for characters by name. The search is case-insensitive but requires an exact substring match.\r\n\r\nThe generic term \u201ccharacter name\u201d refers to the Unicode character \u201cName\u201d property value for an encoded character. For code points that do not have character names (unassigned, reserved code points, and other special code point types), the Unicode standard uses constructed code point labels in angle brackets to represent these characters.\r\n\r\n### Installation and updates\r\nTo install the package, run:\r\n```shell\r\npip install unicode-charnames\r\n```\r\n\r\nTo upgrade to the latest version, run:\r\n```shell\r\npip install unicode-charnames --upgrade\r\n```\r\n\r\n### Unicode character database (UCD) version\r\nTo retrieve the version of the Unicode character database in use:\r\n```python\r\n>>> from unicode_charnames import UCD_VERSION\r\n>>> UCD_VERSION\r\n'16.0.0'\r\n```\r\n\r\n### Example usage\r\n```python\r\n from unicode_charnames import charname, codepoint, search_charnames\r\n\r\n # charname\r\n for char in '\u9fa0\ud83d\udc93\\u00E5\\u0002':\r\n print(charname(char))\r\n # CJK UNIFIED IDEOGRAPH-9FA0\r\n # BEATING HEART\r\n # LATIN SMALL LETTER A WITH RING ABOVE\r\n # <control-0002>\r\n\r\n # codepoint\r\n for name in [\r\n 'LATIN CAPITAL LETTER E WITH ACUTE',\r\n 'SQUARE ERA NAME REIWA',\r\n 'SUPERCALIFRAGILISTICEXPIALIDOCIOUS'\r\n ]:\r\n print(codepoint(name))\r\n # 00C9\r\n # 32FF\r\n # None\r\n\r\n # search_charnames\r\n for x in search_charnames('break'):\r\n print('\\t'.join(x))\r\n # 00A0 NO-BREAK SPACE\r\n # 2011 NON-BREAKING HYPHEN\r\n # 202F NARROW NO-BREAK SPACE\r\n # 4DEA HEXAGRAM FOR BREAKTHROUGH\r\n # FEFF ZERO WIDTH NO-BREAK SPACE\r\n```\r\n\r\n### Related resource\r\nThis library is based on [Section 4.8, \u201cName,\u201d in the Unicode Core Specification, version 16.0.0](https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-4/#G2082).\r\n\r\n### Licenses\r\nThe code is licensed under the [MIT license](https://github.com/mlodewijck/unicode_charnames/blob/master/LICENSE).\r\n\r\nUsage of Unicode data files is subject to the [UNICODE TERMS OF USE](https://www.unicode.org/copyright.html). Additional rights and restrictions regarding Unicode data files and software are outlined in the [Unicode Data Files and Software License](https://www.unicode.org/license.txt), a copy of which is included as [UNICODE-LICENSE](https://github.com/mlodewijck/unicode_charnames/blob/master/UNICODE-LICENSE).\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Look up Unicode character name or code point label and search in Unicode character names.",
"version": "16.0.0",
"project_urls": {
"Bug Reports": "https://github.com/mlodewijck/unicode_charnames/issues",
"Homepage": "https://github.com/mlodewijck/unicode_charnames",
"Source": "https://github.com/mlodewijck/unicode_charnames/"
},
"split_keywords": [
"unicode",
" unicode data",
" unicode characters",
" character names",
" characters"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "51521fe5b4188c160e1fca7279ca3f0350ca32ccb9417a9b7d046824715564f2",
"md5": "0411cd4a6eed53cdd512be79547b9236",
"sha256": "9b4c08d8e129f2c2858d4456c0030cd5ec4fc360d651dc4b04ee7859c5606564"
},
"downloads": -1,
"filename": "unicode_charnames-16.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0411cd4a6eed53cdd512be79547b9236",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 305965,
"upload_time": "2024-09-17T05:55:58",
"upload_time_iso_8601": "2024-09-17T05:55:58.044018Z",
"url": "https://files.pythonhosted.org/packages/51/52/1fe5b4188c160e1fca7279ca3f0350ca32ccb9417a9b7d046824715564f2/unicode_charnames-16.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f125d16bb7075c324992087b9b97465f438ed85facf537147fd6e304ba71efd6",
"md5": "b974bb2dbfdbbc142630a273f4fd02ce",
"sha256": "83ebbc5115daeeecdd6b16856d63124267a6f5e4c89416fefbd745fac711e4b5"
},
"downloads": -1,
"filename": "unicode_charnames-16.0.0.tar.gz",
"has_sig": false,
"md5_digest": "b974bb2dbfdbbc142630a273f4fd02ce",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 286104,
"upload_time": "2024-09-17T05:56:00",
"upload_time_iso_8601": "2024-09-17T05:56:00.026230Z",
"url": "https://files.pythonhosted.org/packages/f1/25/d16bb7075c324992087b9b97465f438ed85facf537147fd6e304ba71efd6/unicode_charnames-16.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-17 05:56:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mlodewijck",
"github_project": "unicode_charnames",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "unicode-charnames"
}