Skip to main content

Unicode Emoji

This library provides all unicode emojis as an enum. You can use it to:

  • Turn emojis into descriptions;
  • Use emojis from code by textual description;
  • Detecting emojis in text;

Turn an emoji into a description

You can turn an emoji into a description (for example for sentiment analysis) by converting a string into an Emoji enum:

from UnicodeEmoji import Emoji

print(Emoji("😸").name)

# >>> 'grinning_cat_with_smiling_eyes'

Using Emojis from code by description

Sometimes it is easier to use textual descriptions of emojis in your code instead of the unicode representation directly.

This is especially the case for emojis that are composed of multiple parts, for example the woman technologist emoji 👩‍💻 which in some editors and terminals renders as 👩💻.

It can also be easier to differentiate between hard to spot differences, for example the grinning cat 😺 and cat face 🐱

from UnicodeEmoji import Emoji

print(f"Can you see the difference between a grinning cat {Emoji.grinning_cat} and a cat face {Emoji.cat_face}?")

# >>> Can you see the difference between a grinning cat 😺 and a cat face 🐱?

Detecting emojis in text

It can also be useful to detect if a string contains an emoji:

from UnicodeEmoji import Emoji

input = "Hi there! 😄"

all_emojis = [str(emoji) for emoji in Emoji]
input_contains_emoji = any(c in all_emojis for c in input)

print(input_contains_emoji)

# >>> True

Metadata

Release files for UnicodeEmoji 0.0.2

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

Source distribution (sdist)

Source distribution for UnicodeEmoji 0.0.2
File Size Uploaded
UnicodeEmoji-0.0.2.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for UnicodeEmoji 0.0.2
File Interpreter ABI Platform
UnicodeEmoji-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 38.3 kB

Release files / UnicodeEmoji-0.0.2.tar.gz

Download URL UnicodeEmoji-0.0.2.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2ee96f0993832518c362e29b73b38f6a2af80413cbd49e3a6ef1e71b5dba5d08
BLAKE2b-256 checksum
How to use checksums
a87dfb26463ba7e1ea9ce1944af016661c5f0b439181b99081296507a5b52cc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / UnicodeEmoji-0.0.2-py3-none-any.whl

Download URL UnicodeEmoji-0.0.2-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4920404742d0c91a106eaccce717b8cfe1a4ece30919251bf1a6087c5393e1d5
BLAKE2b-256 checksum
How to use checksums
8419037d02f817eb4dc7c8cada5ba98750497a3ce107e1fc9220ab8cee73e49a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

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