Steven5538

emotlib: Python emoji + emoticon Library

Word count: 179Reading time: 1 min
2018/06/18 Share

增添工作時的樂趣而寫的 library..

Github
Doc

Installation

To install emotlib, simply use pipenv (or pip, of course):

1
2
$ pipenv install emotlib
🍩🎉

Satisfaction guaranteed.

Example

Note: In python2.x, your string need to be unicode. Ex: u’I\’m :elf:’

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
>> import emotlib
>> print(emotlib.emoji())
🧙‍
>> print(emotlib.emoji(category='food-fruit'))
🍉
>> print(emotlib.emoji(num=3))
👨‍🚀👨‍🚀👨‍🚀
>> print(emotlib.emoji(num=3, sep= ' ~ '))
🤸 ~ 🤸 ~ 🤸 ~
>> print(emotlib.emojify('I am :man_technologist:'))
I am 👨‍💻
>> print(emotlib.emojify('I am :man~technologist:', alias='~'))
I am 👨‍💻
>> print(emotlib.demojify('I am 👨‍💻'))
I am :man_technologist:
>> print(emotlib.demojify('I am 👨‍💻', alias='~'))
I am :man~technologist:


>> print(emotlib.emoticon())
( ´ ▽ ` )ノ
>> print(emotlib.emoticon(feel='confused'))
(´−`) ンー
>> print(emotlib.emoticon(num=3))
┌(★o☆)┘┌(★o☆)┘┌(★o☆)┘
>> print(emotlib.emoticon(num=3, sep=' ~ '))
(´∇ノ`*)ノ ~ (´∇ノ`*)ノ ~ (´∇ノ`*)ノ ~
>> print(emotlib.emoticonify('I am a happy developer.'))
I am a happy developer. *(*´∀`*)☆

Check categories & feels

1
2
3
>> import emotlib
>> emotlib.emoji_categories
>> emotlib.emoticon_feels

CATALOG
  1. 1. Installation
  2. 2. Example