Skip to main content

Pure Python emoji toolkit — encoding, lookup, search, 3,781 emojis from Unicode Emoji 16.0.

Project description

emojifyi

PyPI Python License: MIT

Pure Python emoji toolkit for developers. Encode any emoji into 8 representations, look up metadata for 3,781 emojis, search and browse by category — all with zero dependencies.

Browse all emojis at emojifyi.com

Install

pip install emojifyi

Quick Start

from emojifyi import encode, get_emoji, search

# Encode any emoji into 8 representations
result = encode("😀")
print(result.codepoint)         # U+1F600
print(result.utf8_bytes)        # 0xF0 0x9F 0x98 0x80
print(result.html_entity)       # 😀
print(result.css_content)       # \1F600
print(result.python_literal)    # \U0001F600
print(result.java_literal)      # \uD83D\uDE00

# Look up emoji metadata
info = get_emoji("red-heart")
print(info.character)           # ❤️
print(info.category)            # smileys-and-emotion
print(info.emoji_version)       # 1.0

# Search emojis by name
for emoji in search("fire")[:5]:
    print(f"{emoji.character} {emoji.cldr_name}")

Advanced Usage

from emojifyi import (
    get_emoji_by_char, by_category, by_version,
    categories, subcategories, all_emojis, emoji_count,
)

# Look up by character
info = get_emoji_by_char("🔥")
print(info.slug)  # fire

# Browse by category
animals = by_category("animals-and-nature")
print(len(animals))  # 151 emojis

# New emojis in a specific version
new = by_version("16.0")
print(len(new))  # Latest additions

# Category metadata
for cat in categories():
    print(f"{cat.icon} {cat.name} ({cat.slug})")

# Total count
print(emoji_count())  # 3781

API Reference

Encoding

Function Description
encode(char) -> EncodingResult All 8 encodings at once
char_to_codepoint(char) -> str Character to U+XXXX
encode_utf8(char) -> str UTF-8 byte representation
encode_utf16(char) -> str UTF-16 surrogates
encode_html(codepoint) -> str HTML numeric entity
encode_css(codepoint) -> str CSS content value
encode_python(codepoint) -> str Python literal
encode_javascript(codepoint) -> str JavaScript literal
encode_java(char) -> str Java literal (with surrogates)

Lookup & Search

Function Description
get_emoji(slug) -> EmojiInfo | None Look up by slug
get_emoji_by_char(char) -> EmojiInfo | None Look up by character
search(query, limit=20) -> list[EmojiInfo] Case-insensitive name search
all_emojis() -> list[EmojiInfo] All 3,781 emojis
emoji_count() -> int Total emoji count

Browse

Function Description
by_category(slug) -> list[EmojiInfo] Filter by category
by_version(version) -> list[EmojiInfo] Filter by emoji version
categories() -> list[Category] All 10 categories
subcategories(slug?) -> list[Subcategory] All or filtered subcategories

Data Types

  • EncodingResult — 8-field NamedTuple: codepoint, utf8_bytes, utf16_surrogates, html_entity, css_content, python_literal, javascript_literal, java_literal
  • EmojiInfo — 12-field NamedTuple: character, slug, cldr_name, codepoint, category, subcategory, emoji_version, unicode_version, added_year, emoji_type, is_zwj, has_skin_tones
  • Category — 4-field NamedTuple: slug, name, icon, order
  • Subcategory — 4-field NamedTuple: slug, name, category_slug, order

Features

  • 8 encoding types: UTF-8 bytes, UTF-16 surrogates, HTML entity, CSS content, Python/JavaScript/Java literals, codepoint
  • 3,781 emojis: Full Unicode Emoji 16.0 dataset with metadata
  • 10 categories, 100 subcategories: Browse and filter
  • ZWJ support: Multi-codepoint sequences, flags, keycaps, skin tones
  • Zero dependencies: Pure Python, bundled JSON data
  • Type-safe: Full type annotations, py.typed marker (PEP 561)

Related Packages

Package Description
colorfyi Color conversion, contrast, harmonies, shades
fontfyi Google Fonts metadata, CSS helpers, font pairings
symbolfyi Symbol & character encoding (11 formats)
unicodefyi Unicode character toolkit (17 encodings)

Links

License

MIT

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

emojifyi-0.1.0.tar.gz (110.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emojifyi-0.1.0-py3-none-any.whl (95.0 kB view details)

Uploaded Python 3

File details

Details for the file emojifyi-0.1.0.tar.gz.

File metadata

  • Download URL: emojifyi-0.1.0.tar.gz
  • Upload date:
  • Size: 110.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for emojifyi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af78d919f6c069ff76a57b754b4484a4494207974a7a901fb7db76cae4747c79
MD5 79bc6fb60c4084bcff379e947e2e0bcb
BLAKE2b-256 8842ce47d2f55d3a72172902cbb0b897d19f2d60cf9f45b94c3a2c2e983ee9da

See more details on using hashes here.

File details

Details for the file emojifyi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: emojifyi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 95.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for emojifyi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d270fef236630814755495f6267813c776f69104ba80f0e196203ff94432fc7
MD5 f374b4af1c1f3cbb85983cf3cc0e4479
BLAKE2b-256 ae052c16208532af20b26ccf6c7fbc6ccfce09b9a3e6ecb433809f7eac6dbd26

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page