Emot is a python library to extract the emojis and emoticons from a text(string). All the emojis and emoticons are taken from a reliable source i.e. Wikipedia.org.
It works fine in any Python 2.xx and 3.xx.
The Emot library takes a string as an input and returns a list of dictonary.
>>> import emot >>> text = "I love python 👨 :-)" >>> emot.emoji(text) >>> [{'value': '👨', 'mean': ':man:', 'location': [14, 14], 'flag': True}] >>> emot.emoticons(text) >>> {'value': [':-)'], 'location': [[16, 19]], 'mean': ['Happy face smiley'], 'flag': True}
New version 2.0 of emot library return dictonary of and you can loop every data based on below example. Here, value, location, mean are list and flag is boolean.
>>> text = "I love python 👨 :-)" >>> ans = emot.emoticons(text) >>> ans {'value': [':-)'], 'location': [[16, 19]], 'mean': ['Happy face smiley'], 'flag': True} >>> ans['value'] ':-)' >>> ans['location'] [16, 19] >>> ans['mean'] ['Happy face smiley'] >>> ans['flag'] True
Via pip:
$ pip install emot --upgrade
From master branch:
$ git clone https://github.com/NeelShah18/emot.git $ cd emot $ python setup.py install
$ git clone https://github.com/NeelShah18/emot.git $ cd emot
Neel Shah / [@NeelShah18]
Shubham Rohilla / [@kakashubham]
[@NeelShah18]: https://github.com/NeelShah18 [@kakashubham]: https://github.com/kakashubham