📦 EmojiDB
Simple python wrapper for emojidb.com.
⭐️ Usage
pip install emojidb-python
The library can be asynchronously and synchronously.
from asyncio import run
from emojidb import EmojiDBClient
async def main():
async with EmojiDBClient() as client:
emojis = await client.search("love")
print(*emojis, sep=", ")
client.like(emojis[0], query)
run(main())
from emojidb import EmojiDBClient
client = EmojiDBClient()
emojis = client.search("love")
print(*emojis, sep=", ")
You can also do more than just fetch emojis. All of those functions work both async and synchronously. Here are all functionalities.
from emojidb import EmojiDBClient
client = EmojiDBClient()
# fetch emojis
emojis = client.search("love")
print(*emojis, sep=", ")
# if you want to fetch similar emojis,
# you can just use the search function an pass in the emoji
emojis = client.search("🥺")
print(*emojis, sep=", ")
# like an emoji
client.like("🥺", "pleading face")
# dislike an emoji
client.dislike("🥺", "pleading face")
# suggest a new emoji
client.add_emoji("🥺", "pleading face")
If you want to change the caching behavior you can easily do so by just passing a custom cache class in the client.
from emojidb import EmojiDBClient, EmojiCache, DisableEmojiCache, EmojiCacheSqlite
# use sqlite as cache (DEFAULT with expires in 30 days)
client = EmojiDBClient(EmojiCacheSqlite(expire_after_days=1))
# disable the cache
client = EmojiDBClient(DisableEmojiCache())
# custom cache
class MemoryCache(EmojiCache):
"""
This cache only caches everything in memory.
When initializing a new client the cache wouldn't persist
"""
def __init__(self):
self.data = {}
def has_cache(self, query: str) -> bool:
return query in self.data
def get_cache(self, query: str) -> List[str]:
return self.data.get(query, [])
def write_cache(self, query: str, emojis: List[str]):
return self.data[query] = emojis
def clear_cache(self):
self.data = {}
client = EmojiDBClient(MemoryCache())
The functions EmojiCache.clean_cache() and EmojiCache.clear_cache() are never called by the client, but it is recommended to still implement them.
Programms that use this library can use these functions by doing this:
from emojidb import EmojiDBClient
client = EmojiDBClient(DisableEmojiCache())
client.cache.clean_cache()
client.cache.clear_cache()
Features
- use an asynchronous client or a synchronous one
- cache the results using sqlite
- search for emojis
- like and dislike emojis (please do not abuse that)
🪪 License
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
Metadata
Release files for emojidb-client 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| emojidb_client-1.1.0.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| emojidb_client-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.1 kB
Release files / emojidb_client-1.1.0.tar.gz
| Download URL | emojidb_client-1.1.0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afbd740e71342f3f2c6d23a9ce972c643a891cfa20298d991b56031153c3925a
|
|
BLAKE2b-256 checksum How to use checksums |
e7f6632ec3599a1f08a1f051859d41f7140ee81112252d1ccdb8423c45d154ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2025.
Transparency logRelease files / emojidb_client-1.1.0-py3-none-any.whl
| Download URL | emojidb_client-1.1.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
904cb97f27149394f12119cf86f185fb3f0af8d043899a71da0d1aefe33177af
|
|
BLAKE2b-256 checksum How to use checksums |
03f0efa82906efde16c2fa6a03e2559bfa002f27766ca094a549c386337a9b74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2025.
Transparency log