# IMOJIFY
a python library that maps almost every emoji to its color image
it's used to get visual representation of emoji unicode
imojify can be used to solve the problem of plotting emojis as labels in python plotting libraries
## Installation
`pip install imojify`
## Quickstart
### Get emoji Image
```python
from PIL import Image
from imojify import imojify
Image.open(imojify.get_img_path('😂'))
```
![output](https://raw.githubusercontent.com/abdulrahmankhayal/imojify/main/media/emoji.png)
multiple emoji is also supported
```python
from PIL import Image
from imojify import imojify
Image.open(imojify.get_img_path('😂😂😂😂'))
```
![output](https://raw.githubusercontent.com/abdulrahmankhayal/imojify/main/media/Mulit_emoji.png)
### Plotting emojis in matplotlib
```python
from imojify import imojify
from matplotlib import pyplot as plt
from matplotlib.offsetbox import OffsetImage,AnnotationBbox
def offset_image(cords, emoji, ax):
img = plt.imread(imojify.get_img_path(emoji))
im = OffsetImage(img, zoom=0.08)
im.image.axes = ax
ab = AnnotationBbox(im, (cords[0], cords[1]), frameon=False, pad=0)
ax.add_artist(ab)
emjis = ['😂', '🤣', '😔', '😏','😍', '🥰', '😘']
values =[30, 50, 15, 29, 15, 50, 12]
fig, ax = plt.subplots(figsize=(12,8))
ax.bar(range(len(emjis)), values, width=0.5,align="center")
ax.set_xticks(range(len(emjis)))
ax.set_xticklabels([])
ax.tick_params(axis='x', which='major', pad=26)
ax.set_ylim((0, ax.get_ylim()[1]+10))
for i, e in enumerate(emjis):
offset_image([i,values[i]+5], e, ax)
```
![output](https://raw.githubusercontent.com/abdulrahmankhayal/imojify/main/media/plt_emoji.png)
Raw data
{
"_id": null,
"home_page": "https://github.com/abdulrahmankhayal/imojify",
"name": "imojify",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Abdul-Rahman Khayyal",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/a3/9d/677c7833193fdae949803ccb10ff8388b0de1a51c03718c5ffac43eedc73/imojify-0.1.1.tar.gz",
"platform": null,
"description": "# IMOJIFY\n\n\n\na python library that maps almost every emoji to its color image\n\nit's used to get visual representation of emoji unicode\n\n\n\nimojify can be used to solve the problem of plotting emojis as labels in python plotting libraries\n\n\n\n## Installation\n\n\n\n\u00a0\u00a0\u00a0\u00a0`pip install imojify`\n\n\n\n## Quickstart\n\n\n\n### Get emoji Image\n\n\n\n```python\n\nfrom PIL import Image\n\nfrom imojify import imojify\n\nImage.open(imojify.get_img_path('\ud83d\ude02'))\n\n```\n\n![output](https://raw.githubusercontent.com/abdulrahmankhayal/imojify/main/media/emoji.png)\n\n\n\n\n\n\n\nmultiple emoji is also supported \n\n\n\n```python\n\nfrom PIL import Image\n\nfrom imojify import imojify\n\nImage.open(imojify.get_img_path('\ud83d\ude02\ud83d\ude02\ud83d\ude02\ud83d\ude02'))\n\n```\n\n![output](https://raw.githubusercontent.com/abdulrahmankhayal/imojify/main/media/Mulit_emoji.png)\n\n\n\n\n\n\n\n### Plotting emojis in matplotlib\n\n\n\n```python\n\nfrom imojify import imojify\n\nfrom matplotlib import pyplot as plt \n\nfrom matplotlib.offsetbox import OffsetImage,AnnotationBbox\n\ndef offset_image(cords, emoji, ax):\n\n img = plt.imread(imojify.get_img_path(emoji))\n\n im = OffsetImage(img, zoom=0.08)\n\n im.image.axes = ax\n\n ab = AnnotationBbox(im, (cords[0], cords[1]), frameon=False, pad=0)\n\n ax.add_artist(ab)\n\n\n\n\n\n\n\nemjis = ['\ud83d\ude02', '\ud83e\udd23', '\ud83d\ude14', '\ud83d\ude0f','\ud83d\ude0d', '\ud83e\udd70', '\ud83d\ude18']\n\nvalues =[30, 50, 15, 29, 15, 50, 12]\n\n\n\nfig, ax = plt.subplots(figsize=(12,8))\n\nax.bar(range(len(emjis)), values, width=0.5,align=\"center\")\n\nax.set_xticks(range(len(emjis)))\n\nax.set_xticklabels([])\n\nax.tick_params(axis='x', which='major', pad=26)\n\nax.set_ylim((0, ax.get_ylim()[1]+10))\n\n\n\nfor i, e in enumerate(emjis):\n\n offset_image([i,values[i]+5], e, ax)\n\n```\n\n![output](https://raw.githubusercontent.com/abdulrahmankhayal/imojify/main/media/plt_emoji.png)\n\n\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "a python library that imagify emoji-unicode",
"version": "0.1.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "82f913f3e810b3e65e0af9ae7786698f",
"sha256": "51897408a2ca1b6b603f31c20db99505f5c58fffa754e4b51253d99c6db679e0"
},
"downloads": -1,
"filename": "imojify-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "82f913f3e810b3e65e0af9ae7786698f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 142105230,
"upload_time": "2022-11-20T19:41:46",
"upload_time_iso_8601": "2022-11-20T19:41:46.397573Z",
"url": "https://files.pythonhosted.org/packages/95/10/d5680b4a0eb7e980b8367b6da179a516eeb8adbc1a2019e421253d6d63fb/imojify-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "8b4d0c3959f8bbe7fb7a85764b3da54f",
"sha256": "9f714ebe56082fd744a44e8414be0db6e4f3db369baded1918bafeb90476cf61"
},
"downloads": -1,
"filename": "imojify-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "8b4d0c3959f8bbe7fb7a85764b3da54f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 141702117,
"upload_time": "2022-11-20T20:07:51",
"upload_time_iso_8601": "2022-11-20T20:07:51.752429Z",
"url": "https://files.pythonhosted.org/packages/a3/9d/677c7833193fdae949803ccb10ff8388b0de1a51c03718c5ffac43eedc73/imojify-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-11-20 20:07:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "abdulrahmankhayal",
"github_project": "imojify",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "imojify"
}