skillfed

demoji

Accurately remove and replace emojis in text strings

demoji v2.0.0 338.2K downloads/30d#7,436 on PyPI163
Permissive license Apache-2.0 Active released

What it is and what it does

demoji is a text-processing library that accurately identifies and manipulates emojis in strings. It bundles Unicode Consortium emoji data at install time, so it works offline and requires no network access at runtime. The package handles complex emoji sequences—like skin-tone modifiers, zero-width joiners, and flag combinations—by sorting emoji codes by length and using a greedy regex approach to match longer sequences before shorter ones.

You can use it to find all emojis in a string and get their descriptions, extract emojis as a list, replace them with plain text, or convert them to colon-delimited codes (like `:fire:` for 🔥). It also provides a command-line interface for batch processing files or stdin. The library is typed, actively maintained, and supports modern Python versions.

Use it for:

  • Clean user-generated content (tweets, comments, chat) by replacing emojis with text descriptions for downstream NLP or storage.
  • Extract and catalog emojis from social media feeds or message logs to understand sentiment or trending symbols.
  • Convert emoji-heavy text to plain ASCII for systems that don't render emoji or for accessibility.
  • Validate or audit text fields in forms or databases to detect and flag emoji usage.
  • Build emoji-aware text search or indexing by mapping emojis to their semantic descriptions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

demoji finds and removes emojis from text, mapping each emoji to its Unicode description or replacing it with a plain-text equivalent.

Yes. demoji is lightweight, dependency-free, actively maintained, and solves a real problem with high accuracy. It handles edge cases (multi-character sequences, skin tones, flags) correctly and works offline. Use it whenever you need to find, extract, or normalize emojis in text.

Install

demoji on PyPI

pip

pip install demoji

uv

uv add demoji

poetry

poetry add demoji

Installing demoji

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained, last commit 2026-07-12, with Unicode emoji data bundled at install time so no network calls are needed at runtime.

License in practice

Apache-2.0 is permissive; you can use demoji freely in commercial and private projects with minimal restrictions.

Quickstart

pip install demoji

import demoji

text = "Great game! 🔥 🎉"
print(demoji.findall(text))
# {'🔥': 'fire', '🎉': 'party popper'}

print(demoji.replace_with_desc(text))
# Great game! :fire: :party popper:

Requires Python 3.10 or later (supports 3.10–3.14).

Verify before relying

  • Whether the bundled Unicode emoji data (version 16.0) can be updated independently of package releases.
  • Performance characteristics when processing very large text blobs or documents with thousands of emojis.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 117 days since the last release
Last repo commit
First released
Downloads 338,151/month — #7,436 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: demoji-2.0.0-py3-none-any.whl

Keywords: emoji, emojis, nlp, natural language processing, unicode

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Text ProcessingTopic :: Text Processing :: LinguisticTopic :: UtilitiesTyping :: Typed

Tags

emoji detection and removalfind emojis in textreplace emojis with textemoji to description mappingunicode emoji handlingemoji text processingstrip emojis from strings
emoji-processingtext-normalizationunicode

More Utilities packages