A build-time generated emoji lexicon for Python
Project description
emoji-lexicon
🚀 emoji-lexicon is a fast, build-time generated emoji lexicon for Python, powered by Unicode emoji-test and CLDR annotations.
Features
- Fast emoji lookup by short name, alias, or tag
- Designed for CLI, IME, and dictionary tools
- Unicode / CLDR based canonical data
- Build-time normalization, runtime zero-cost lookup
- Optional gemoji-compatible export
Requirements
- Python 3.12+
Installation
pip install emoji-lexicon
Usage
Basic usage:
from emoji_lexicon import get_catalog
catalog = get_catalog()
.get(), get_by_char(), get_all()
# lookup by short name or alias
catalog.get("smile")
# -> Emoji | None
# Slack / gemoji style
catalog.get(":smile:")
# lookup by emoji character
catalog.get_by_char("😁")
# -> Emoji | None
# get all emojis
catalog.get_all()
.search() , .find()
# partial match (short_name / alias / tag)
catalog.search("happy")
# -> tuple[Emoji, ...]
# alias of .search()
catalog.find("happy")
# -> tuple[Emoji, ...]
.search() and .find() perform partial matching and return multiple emojis.
.find() is a user-facing alias of .search().
.groups(), .subgroups()
from emoji_lexicon import get_catalog
catalog = get_catalog()
# available emoji groups
catalog.groups()
# available emoji subgroups
catalog.subgroups()
Misc
# total emoji count
len(catalog)
# iterator
for emoji in catalog:
print(emoji.char, emoji.short_name)
Application examples:
- Categories UI
- IME candidate narrowing down
- emoji picker
Search behavior
The .search() and .find() methods perform token-based emoji search.
Search rules:
- Case-insensitive
- Supports Slack / gemoji style queries (e.g.
:smile) - Space-separated tokens are combined using AND logic
- Results are ranked by relevance
Matching priority (high -> low):
- Exact short name match
- Exact alias match
- Exact tag match
- Prefix match (only for tokens with 3+ characters)
Ranking is deterministic and stable (score-based, then emoji ID)
Example:
catalog.search("smile")
catalog.search("smile face")
catalog.search(":smile:")
Notes:
- Prefix matching is disabled for very short tokens to reduce noise.
- Result order is deterministic and stable.
Design philosophy
- zero-cost at runtime
- immutable catalog
- Pythonic & typed
License
MIT License © 2026 Kiminori Kato
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file emoji_lexicon-0.1.5.tar.gz.
File metadata
- Download URL: emoji_lexicon-0.1.5.tar.gz
- Upload date:
- Size: 303.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a96df169073c064d1da9cf95834034d2575f5acbd7676c4e229b772ca0dbe74
|
|
| MD5 |
b80746cdacf7dedc18f582632ffb389e
|
|
| BLAKE2b-256 |
8af08f54ad8e587acf5d70d6c302d8b33ea65e086929dd2c215168c3b573cb6e
|
Provenance
The following attestation bundles were made for emoji_lexicon-0.1.5.tar.gz:
Publisher:
release.yml on kimikato/emoji-lexicon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
emoji_lexicon-0.1.5.tar.gz -
Subject digest:
5a96df169073c064d1da9cf95834034d2575f5acbd7676c4e229b772ca0dbe74 - Sigstore transparency entry: 803172442
- Sigstore integration time:
-
Permalink:
kimikato/emoji-lexicon@e5943cb88d2e7d57e70770d31465f00c066d0ef6 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/kimikato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e5943cb88d2e7d57e70770d31465f00c066d0ef6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file emoji_lexicon-0.1.5-py3-none-any.whl.
File metadata
- Download URL: emoji_lexicon-0.1.5-py3-none-any.whl
- Upload date:
- Size: 186.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d01934166e1cde0c94278921105fb3500027286850ef4e1fd46e17ee77d33dc
|
|
| MD5 |
cbe1e191b76469561b0dbd1099b914cb
|
|
| BLAKE2b-256 |
d31b6967d722a46f69077b992247a199be33a588e94fa4c308b3614dcbcd1edd
|
Provenance
The following attestation bundles were made for emoji_lexicon-0.1.5-py3-none-any.whl:
Publisher:
release.yml on kimikato/emoji-lexicon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
emoji_lexicon-0.1.5-py3-none-any.whl -
Subject digest:
4d01934166e1cde0c94278921105fb3500027286850ef4e1fd46e17ee77d33dc - Sigstore transparency entry: 803172446
- Sigstore integration time:
-
Permalink:
kimikato/emoji-lexicon@e5943cb88d2e7d57e70770d31465f00c066d0ef6 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/kimikato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e5943cb88d2e7d57e70770d31465f00c066d0ef6 -
Trigger Event:
push
-
Statement type: