Description
Emoji ===== Emoji for Python. This project was inspired by `kyokomi <https://github.com/kyokomi/emoji>`__. Example ------- The entire set of Emoji codes as defined by the `Unicode consortium <https://unicode.org/emoji/charts/full-emoji-list.html>`__ is supported in addition to a bunch of `aliases <https://www.webfx.com/tools/emoji-cheat-sheet/>`__. By default, only the official list is enabled but doing ``emoji.emojize(language='alias')`` enables both the full list and aliases. .. code-block:: python >>> import emoji >>> print(emoji.emojize('Python is :thumbs_up:')) Python is 👍 >>> print(emoji.emojize('Python is :thumbsup:', language='alias')) Python is 👍 >>> print(emoji.demojize('Python is 👍')) Python is :thumbs_up: >>> print(emoji.emojize("Python is fun :red_heart:")) Python is fun ❤ >>> print(emoji.emojize("Python is fun :red_heart:", variant="emoji_type")) Python is fun ❤️ #red heart, not black heart >>> print(emoji.is_emoji("👍")) True .. By default, the language is English (``language='en'``) but also supported languages are: * Spanish (``'es'``) * Portuguese (``'pt'``) * Italian (``'it'``) * French (``'fr'``) * German (``'de'``) * Farsi/Persian (``'fa'``) * Indonesian (``'id'``) * Simplified Chinese (``'zh'``) * Japanese (``'ja'``) * Korean (``'ko'``) * Russian (``'ru'``) * Arabic (``'ar'``) * Turkish (``'tr'``) .. code-block:: python >>> print(emoji.emojize('Python es :pulgar_hacia_arriba:', language='es')) Python es 👍 >>> print(emoji.demojize('Python es 👍', language='es')) Python es :pulgar_hacia_arriba: >>> print(emoji.emojize("Python é :polegar_para_cima:", language='pt')) Python é 👍 >>> print(emoji.demojize("Python é 👍", language='pt')) Python é :polegar_para_cima:️ .. Installation ------------ Via pip: .. code-block:: console $ python -m pip install emoji --upgrade From master branch: .. code-block:: console $ git clone https://github.com/carpedm20/emoji.git $ cd emoji $ python -m pip install . Developing ---------- .. code-block:: console $ git clone https://github.com/carpedm20/emoji.git $ cd emoji $ python -m pip install -e .\[dev\] $ pytest $ coverage run -m pytest $ coverage report The ``utils/generate_emoji.py`` script is used to generate ``unicode_codes/emoji.json``. Generally speaking it scrapes a table on the `Unicode Consortium's website <https://www.unicode.org/reports/tr51/#emoji_data>`__ with `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`__ For more information take a look in the `utils/README.md <utils/README.md>`__ file. Check the code style with: .. code-block:: console $ python -m pip install ruff $ ruff check emoji Test the type checks with: .. code-block:: console $ python -m pip install pyright mypy typeguard $ pyright emoji $ pyright tests $ mypy emoji $ pytest --typeguard-packages=emoji Links ----- **Documentation** `https://carpedm20.github.io/emoji/docs/ <https://carpedm20.github.io/emoji/docs/>`__ **Overview of all emoji:** `https://carpedm20.github.io/emoji/ <https://carpedm20.github.io/emoji/>`__ (auto-generated list of the emoji that are supported by the current version of this package) **For English:** `Emoji Cheat Sheet <https://www.webfx.com/tools/emoji-cheat-sheet/>`__ `Official Unicode list <http://www.unicode.org/emoji/charts/full-emoji-list.html>`__ **For Spanish:** `Unicode list <https://emojiterra.com/es/lista-es/>`__ **For Portuguese:** `Unicode list <https://emojiterra.com/pt/lista/>`__ **For Italian:** `Unicode list <https://emojiterra.com/it/lista-it/>`__ **For French:** `Unicode list <https://emojiterra.com/fr/liste-fr/>`__ **For German:** `Unicode list <https://emojiterra.com/de/liste/>`__ Authors ------- Taehoon Kim / `@carpedm20 <http://carpedm20.github.io/about/>`__ Kevin Wurster / `@geowurster <http://twitter.com/geowurster/>`__ Maintainer ---------- Tahir Jalilov / `@TahirJalilov <https://github.com/TahirJalilov>`__
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 2.15.0 | Imported from PyPI (2.15.0) | Low | 4/21/2026 |
| v2.15.0 | * Update to Unicode 17.0 | Low | 9/21/2025 |
| v2.14.1 | * Use importlib.resources to load json files #311 * Update translations to Unicode release-46-1 | Low | 1/16/2025 |
| v2.14.0 | - Change the update script so that it creates JSON files instead of the EMOJI_DATA - Update to Unicode 16.0 | Low | 10/4/2024 |
| v2.13.2 | - typing_extensions dependency not required on Python 3.9 and higher | Low | 9/23/2024 |
| v2.13.1 | - Read JSON files in binary mode to avoid UnicodeDecodeError | Low | 9/23/2024 |
| v2.13.0 | - Use JSON files to store the database of emoji - Load a language into emoji.EMOJI_DATA with emoji.config.load_language("zh") | Low | 9/19/2024 |
| v2.12.1 | * `typing-extensions` requires at least version `4.7.0` | Low | 5/20/2024 |
| v2.12.0 | * Move type annotations inline * Use `functools.lru_cache` for looking up emoji by name with `get_emoji_by_name()` * Move internal functions `get_emoji_unicode_dict()`, `get_aliases_unicode_dict()`, `_EMOJI_UNICODE` and `_ALIASES_UNICODE` to `testutils` * Add type hints to tests * Remove obsolete dev dependency `coveralls` | Low | 5/20/2024 |
| v2.11.1 | * Add missing stubs for purely_emoji | Low | 4/21/2024 |
| v2.11.0 | * Update to Unicode v15.1 | Low | 3/26/2024 |
| v2.10.1 | * Fix slow import when debugging in Python 3.12 | Low | 1/31/2024 |
| v2.10.0 | * Added Arabic and Turkish translations | Low | 1/18/2024 |
| v2.9.0 | * Added Russian translation | Low | 12/5/2023 |
| v2.8.0 | * Update translations to unicode release-43-1 * Include "derived annotations"-translations from unicode CLDR * Fix translations for emoji that have multiple forms with/out \uFE0F (Fixes Partially missing languages #272 ) * Remove multiple underscore __, ___, ____ and _-_ from translations | Low | 8/16/2023 |
| v2.7.0 | - Extract aliases from cheat sheet and youtube - Fix extracting translations from emojiterra - Update EMOJI_DATA with new aliases and translations | Low | 7/25/2023 |
| v2.6.0 | - Added new function purely_emoji() | Check if a string contains only emojis | Low | 6/28/2023 |
| v2.5.1 | * Fix Malformed zero width joiner (\u200d) causes IndexError | Low | 6/15/2023 |
| v2.5.0 | - Added support for Multi-person skintones - Removed support for Python 2, 3.4, 3.5 - The logic from demojize() is moved to two separate private function tokenize() and filter_tokens() in a new file emoji/tokenizer.py - A new public function analyze() is available and that supports the multi-person skintones | Low | 6/8/2023 |
| v2.4.0 | * Added Japanese and Korean | Low | 3/12/2023 |
| v2.3.0 | - Add Indonesian and Simplified Chinese - Bug fixing | Low | 2/4/2023 |
| v2.2.0 | * Add support for Unicode Version 15 * Add more translations for existing languages: (similar to Turkish Language) * Add Readme on how to add a language * Fix 2.0.0: sphinx warnings reference target not found | Low | 10/31/2022 |
| v2.1.0 | - Added Farsi support - Added Trove classifiers for Python 3.10 and 3.11 | Low | 9/17/2022 |
| v2.0.0 | - Removed the old dicts EMOJI_UNICODE_, UNICODE_EMOJI_ - Removed unused language=None parameters - Removed use_alias parameter - Removed the get_regexp method - Removed emoji_lis - Removed distinct_emoji_lis - Made the list of languages public: emoji.LANGUAGES = ['en','es','pt','it','fr','de'] - Updated translations to release-41 (no changes compared to release-40) - Generate a documentation for the public functions from the docstrings with Sphinx - Added some more examples to the READM | Low | 6/30/2022 |
| v1.7.0 | * Added emoji_list() and distinct_emoji_list() * Added deprecation warnings for several functions and variables that will be removed in version 2.0.0. If you don't want to see these warnings, you can stay with 1.6.x. For example in pip/requirements.txt you can pin to 1.6.x with emoji~=1.6.3. | Low | 3/7/2022 |
| v1.6.3 | * Added support for counting unique emojis | Low | 1/15/2022 |
| v1.6.2 | * Improve performance of demojize() * Added more tests * Added warning when someone uses any other language than 'en' with use_aliases=True in emojize() | Low | 12/6/2021 |
| v1.6.1 | * Allow multiple aliases * Restored aliases from 1.5.0 | Low | 10/13/2021 |
| v1.6.0 | * Added dict of dict with emoji data, include emoji versions and statuses * emoji.version(string) method added * Included 'variant' in the dict of dicts | Low | 10/4/2021 |
| v1.5.2 | * is_emoji function added | Low | 9/25/2021 |
| v1.5.1 | * Fix Unicode of some emoji in the language files | Low | 9/25/2021 |
| v1.5.0 | * The English version of Emojis has been updated to version 14.0 Emoji Charts. * Current count of emojis - 3633 * Fix matching of non-ASCII emoji names on Python 2 | Low | 9/17/2021 |
| v.1.4.2 | * Delimiter for German time naming changed from ":" to "." | Low | 7/30/2021 |
| v.1.4.1 | * Fix some French emoji names not being matched * Drop seemingly accidentally added colons from German emoji names | Low | 7/18/2021 |
| v.1.4.0 | Added support for German naming of emojis | Low | 6/22/2021 |
| v.1.3.0 | * Added support for French naming of emojis | Low | 6/2/2021 |
| v.1.2.1 | * Added replace_emoji | Low | 3/13/2021 |
| v.1.2.0 | * Emojis of English version updated to the Emoji Charts v.13.1 * Added all emoji modifiers (skin tones) * The current count of emojis - 3521 | Low | 1/27/2021 |
| v.1.1.1 | * Emoji extractor refactored | Low | 1/25/2021 |
| v.1.1.0 | * Added support for Italian naming of emojis * Added Python 3.8 and 3.9 as supported versions | Low | 1/23/2021 |
| v.1.0.1 | * Bug fixing | Low | 1/23/2021 |
| 1.0.0 | * Added support for Spanish naming of emojis * Added support for Portuguese naming of emojis * Emoji packs split by language to different modules | Low | 1/22/2021 |
| v0.3.4 | Release v0.3.4 | Low | 5/19/2015 |
