def emoji_api(key=''): """ Fetch an Emoji --- tags: - emoji parameters: - in: path name: key required: true schema: type: string example: dog description: the emoji you would like to search for responses: 200: description: A random emoji matching your search content: text/plain: schema: type: string example: 🐩 """ by_key = list(emojislib.by_key(key)) by_name = [emojislib.by_name(key).char] if emojislib.by_name(key) else [] search_by_name = list(emojislib.search_by_name(key)) search_by_key = list(emojislib.search_by_key(key)) search_by_category = list(emojislib.search_by_cate(key)) emojis = set(by_key or by_name or search_by_name or search_by_key or search_by_category) if emojis: return plain_textify(str(random.choice(list(emojis)))) else: abort(404)
import emojislib as emojy emojy = emojy.by_name('rose') print("name:", emojy.name) print("char:", emojy.char) print("key:", emojy.keywords)
import emojislib as e emoji = e.by_name('heart') print("name:", emoji.name) print("char:", emoji.char) print("category:", emoji.category) print("keywords:", emoji.keywords)
import emoji print(emoji.emojize('Python is :thumbsup: ', use_aliases=True)) print() print() import emojislib as emojis emoji = emojis.by_name('eyes') print("name:",emoji.name) print("char:",emoji.char) print("category:",emoji.category) print("keywords:",emoji.keywords) print() print() emoji = emojis.by_cate('animals_and_nature') print(emoji) print() print(emoji[0])
import emojislib as emojis emoji = emojis.by_name('rose') print("name:", emoji.name) print("char:", emoji.char) print("category:", emoji.category) print("keywords:", emoji.keywords)
import emojislib as em em = em.by_name('banana') print("name:", em.name) print("char:", em.char)