A basic emoji manipulator for Python.
Project description
๐ Features
๐ Emoji lookup by name, alias, unicode, hexcode, shortcode, or order
๐ง Fast emoji search by keyword, label, shortcode, or tag
๐ณ Emoji Kitchen-style mashups (Google Emoji Kitchen)
๐ท๏ธ Convert between emoji and shortcode (emojize/demojize)
๐งฉ Emoji grouping and subgrouping
๐ฆ Bundled emoji data, no internet required
๐ช Zero dependencies, pure Python
๐ Usage & Quick Start
from emojis import (
is_emoji, emoji_count,
get_emoji_from_name, get_emoji_from_hexcode, get_emoji_from_shortcode, get_emoji_from_order,
get_all_emojis, emojize, demojize,
get_group, get_subgroup, get_all_groups, get_all_subgroups,
emoji_kitchen, search_emojis, Emoji
)
# Check if a character is an emoji
print(is_emoji("๐ฅ")) # True
# Count emojis in a string
print(emoji_count("I love ๐ and ๐!")) # 2
# Lookup emoji by name, hexcode, shortcode, or order
print(get_emoji_from_name("grinning face").emoji) # ๐
print(get_emoji_from_hexcode("1F525").emoji) # ๐ฅ
print(get_emoji_from_shortcode("fire").emoji) # ๐ฅ
print(get_emoji_from_order(0).emoji) # First emoji in database
# List all emojis (print only emoji characters)
all_emojis = get_all_emojis()
print([e.emoji for e in all_emojis[:5]]) # ['๐', '๐', '๐', ...]
# Convert shortcodes to emojis and vice versa
print(emojize("I am :fire:!")) # I am ๐ฅ!
print(demojize("I am ๐ฅ!")) # I am :fire:!
# Emoji details and grouping
emoji = Emoji("๐ฆ")
print(emoji.label) # 'unicorn'
print(get_group(emoji).name) # Group name
print(get_subgroup(emoji).name) # Subgroup name
# List all groups and subgroups (print names)
print([g.name for g in get_all_groups()])
print([sg.name for sg in get_all_subgroups()])
# Emoji Kitchen-style combo (returns a URL)
print(emoji_kitchen(Emoji("๐ฅฒ"), Emoji("๐")))
# Search for emojis by keyword, label, shortcode, or tag (print emoji characters)
print([e.emoji for e in search_emojis("cat")]) # ['๐ฑ', '๐บ', ...]
๐ฆ Included Emoji Data
This library bundles static emoji data from:
All data is included upfront โ no runtime fetching or internet required ๐
โ๏ธ Installation
Requires Python 3.8+ ๐
To install the latest stable release:
# Unix / macOS ๐๐ง
python3 -m pip install "emojis.py"
# Windows ๐ช
py -m pip install "emojis.py"
To install the development version:
git clone https://github.com/Ombucha/emojis.py
cd emojis.py
pip install -e .
๐ Contributing
Contributions are welcome! If you have suggestions, bug reports, or want to add features, please open an issue or submit a pull request on GitHub.
Read the Contributing Guide for best practices.
Make sure your code is tested and documented.
Be kind and respectful in all interactions.
Thank you for helping make emojis.py better! ๐
๐ Links
๐งช Explore, search, and play with emojis in Python โ your code just got way more expressive! ๐๐จ๐
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 emojis_py-1.3.0.tar.gz.
File metadata
- Download URL: emojis_py-1.3.0.tar.gz
- Upload date:
- Size: 8.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
618210f459b5642ff15c28808c797c4da513b9c3b9edacbb71fed257ed08a233
|
|
| MD5 |
3fd06c4c73551bcc54ad9b80aa5748ab
|
|
| BLAKE2b-256 |
963261aa2ea8e6e37ebda8e10e8fbd7325ed589855a7a2623a8159f01fd4169b
|
File details
Details for the file emojis_py-1.3.0-py3-none-any.whl.
File metadata
- Download URL: emojis_py-1.3.0-py3-none-any.whl
- Upload date:
- Size: 8.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e0ebf16c419cd7718df3245b44fb9f7fd90cda6f63c77ef420b27a911c872c8
|
|
| MD5 |
2ad98bbd1b9cdcd20ce8428671da7013
|
|
| BLAKE2b-256 |
e8e9074c890b663e53dc488e7fca7d29b31f71e1a1ccc099ef62744719d19563
|