Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.940 runs
installs and imports cleanly · install 0.0s · import 0.421s · 18MB
glibcpy 3.10–3.940 runs
installs and imports cleanly · install 1.5s · import 0.410s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
findall
✓ demoji.findall(text_string)
replace
✓ demoji.replace(text_string, repl='')
replace_with_desc
✓ demoji.replace_with_desc(text_string, sep=':')
✗ emoji.demojize(text_string)
The `emoji` library (a separate project) uses `emoji.demojize` for converting emojis to shortcodes. `demoji` uses `demoji.replace_with_desc` for replacing emojis with their descriptions.
This quickstart demonstrates how to import the `demoji` library, find all emojis and their descriptions within a string, remove emojis entirely, and replace them with their textual descriptions.
import demoji
tweet = """
#startspreadingthenews yankees win great start by 🎅🏾 going 5strong innings with 5k's🔥 🐂
solo homerun 🌋🌋 with 2 solo homeruns and👹 3run homerun… 🤡 🚣🏼 👨🏽⚖️ with rbi's … 🔥🔥
🇲🇽 and 🇳🇮 to close the game🔥🔥!!!….
WHAT A GAME!!..
"""
# Find all emojis and their descriptions
emojis_found = demoji.findall(tweet)
print("Emojis found:", emojis_found)
# Replace emojis with an empty string (remove them)
clean_text = demoji.replace(tweet, '')
print("Text with emojis removed:", clean_text)
# Replace emojis with their descriptions (e.g., :fire:)
desc_text = demoji.replace_with_desc(tweet)
print("Text with emoji descriptions:", desc_text)
Errors
Common errors & fixes
AttributeError: module 'demoji' has no attribute 'download_codes'
Attempting to call `demoji.download_codes()` after upgrading to version 1.0.0 or later. This function was removed because emoji data is now bundled with the package.
fixRemove the call to `demoji.download_codes()`. Emoji data is automatically available when `demoji` is imported in versions 1.0.0+.
ModuleNotFoundError: No module named 'demoji'
The `demoji` package is not installed in the current Python environment, or the environment where it was installed is not active.
fixInstall the package using `pip install demoji`. If using virtual environments, ensure the correct environment is activated before running your script.
Upgrade
Version history
2.0.0latest on PyPI · released Apr 19, 2026
Audit
Dependencies
importlib_resourcesrequiredRequired for Python versions < 3.7 (e.g., Python 3.6) as a backport for accessing package resources.
ujsonoptionalOptional dependency for faster loading of emoji data compared to the standard library's `json` module.