Skip to main content

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:

pip install unicode-charnames

To upgrade to the latest version, run:

pip install unicode-charnames --upgrade

Unicode character database (UCD) version

To retrieve the version of the Unicode character database in use:

>>> from unicode_charnames import UCD_VERSION
>>> UCD_VERSION
'16.0.0'

Example usage

    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.

Licenses

The code is licensed under the MIT license.

Usage of Unicode data files is subject to the UNICODE TERMS OF USE. Additional rights and restrictions regarding Unicode data files and software are outlined in the Unicode Data Files and Software License, a copy of which is included as UNICODE-LICENSE.

Metadata

Release files for unicode-charnames 16.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unicode-charnames 16.0.0
File Size Uploaded
unicode_charnames-16.0.0.tar.gz 286.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unicode-charnames 16.0.0
File Interpreter ABI Platform
unicode_charnames-16.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 592.1 kB

Release files / unicode_charnames-16.0.0.tar.gz

Download URL unicode_charnames-16.0.0.tar.gz
Size 286.1 kB
Tags Source
SHA-256 checksum
How to use checksums
83ebbc5115daeeecdd6b16856d63124267a6f5e4c89416fefbd745fac711e4b5
BLAKE2b-256 checksum
How to use checksums
f125d16bb7075c324992087b9b97465f438ed85facf537147fd6e304ba71efd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.0

Release files / unicode_charnames-16.0.0-py3-none-any.whl

Download URL unicode_charnames-16.0.0-py3-none-any.whl
Size 306.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b4c08d8e129f2c2858d4456c0030cd5ec4fc360d651dc4b04ee7859c5606564
BLAKE2b-256 checksum
How to use checksums
51521fe5b4188c160e1fca7279ca3f0350ca32ccb9417a9b7d046824715564f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.0

Release history Release notifications | RSS feed

This release

16.0.0 This release

2 release files

15.1.0

1 release file

15.0.0

1 release file

14.0.0

1 release file

13.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page