Name | UnicodeEmoji JSON |
Version |
0.0.2
JSON |
| download |
home_page | |
Summary | Provides all Unicode Emojis as an enum. |
upload_time | 2024-01-07 01:08:07 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
license | MIT |
keywords |
emoji
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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:
```python
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 🐱`
```python
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:
```python
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
```
Raw data
{
"_id": null,
"home_page": "",
"name": "UnicodeEmoji",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "emoji",
"author": "",
"author_email": "Daan Knoope <daan@knoope.dev>",
"download_url": "https://files.pythonhosted.org/packages/a8/7d/fb26463ba7e1ea9ce1944af016661c5f0b439181b99081296507a5b52cc7/UnicodeEmoji-0.0.2.tar.gz",
"platform": null,
"description": "# Unicode Emoji\n\nThis library provides all unicode emojis as an enum. You can use it to:\n\n* Turn emojis into descriptions;\n* Use emojis from code by textual description;\n* Detecting emojis in text;\n\n# Turn an emoji into a description\nYou can turn an emoji into a description (for example for sentiment analysis) by converting a string into an `Emoji` enum:\n\n```python\nfrom UnicodeEmoji import Emoji\n\nprint(Emoji(\"\ud83d\ude38\").name)\n\n# >>> 'grinning_cat_with_smiling_eyes'\n\n```\n\n# Using Emojis from code by description\nSometimes it is easier to use textual descriptions of emojis in your code instead of the unicode representation directly. \n\nThis is especially the case for emojis that are composed of multiple parts, for example the woman `technologist emoji \ud83d\udc69\u200d\ud83d\udcbb` which in some editors and terminals renders as `\ud83d\udc69\ud83d\udcbb`. \n\nIt can also be easier to differentiate between hard to spot differences, for example the `grinning cat \ud83d\ude3a` and `cat face \ud83d\udc31`\n\n```python\nfrom UnicodeEmoji import Emoji\n\nprint(f\"Can you see the difference between a grinning cat {Emoji.grinning_cat} and a cat face {Emoji.cat_face}?\")\n\n# >>> Can you see the difference between a grinning cat \ud83d\ude3a and a cat face \ud83d\udc31?\n```\n\n# Detecting emojis in text\nIt can also be useful to detect if a string contains an emoji:\n\n```python\nfrom UnicodeEmoji import Emoji\n\ninput = \"Hi there! \ud83d\ude04\"\n\nall_emojis = [str(emoji) for emoji in Emoji]\ninput_contains_emoji = any(c in all_emojis for c in input)\n\nprint(input_contains_emoji)\n\n# >>> True\n\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Provides all Unicode Emojis as an enum.",
"version": "0.0.2",
"project_urls": null,
"split_keywords": [
"emoji"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8419037d02f817eb4dc7c8cada5ba98750497a3ce107e1fc9220ab8cee73e49a",
"md5": "5666a7ab90a7e2216061ef97e2b64b75",
"sha256": "4920404742d0c91a106eaccce717b8cfe1a4ece30919251bf1a6087c5393e1d5"
},
"downloads": -1,
"filename": "UnicodeEmoji-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5666a7ab90a7e2216061ef97e2b64b75",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 18833,
"upload_time": "2024-01-07T01:08:04",
"upload_time_iso_8601": "2024-01-07T01:08:04.882905Z",
"url": "https://files.pythonhosted.org/packages/84/19/037d02f817eb4dc7c8cada5ba98750497a3ce107e1fc9220ab8cee73e49a/UnicodeEmoji-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a87dfb26463ba7e1ea9ce1944af016661c5f0b439181b99081296507a5b52cc7",
"md5": "1e4c8c9f35fddf80df2caaf52e84f1d4",
"sha256": "2ee96f0993832518c362e29b73b38f6a2af80413cbd49e3a6ef1e71b5dba5d08"
},
"downloads": -1,
"filename": "UnicodeEmoji-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "1e4c8c9f35fddf80df2caaf52e84f1d4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 19486,
"upload_time": "2024-01-07T01:08:07",
"upload_time_iso_8601": "2024-01-07T01:08:07.069949Z",
"url": "https://files.pythonhosted.org/packages/a8/7d/fb26463ba7e1ea9ce1944af016661c5f0b439181b99081296507a5b52cc7/UnicodeEmoji-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-07 01:08:07",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "unicodeemoji"
}