Encode any data to emojis
Project description
BaseEmoji
BaseEmoji is a python module for encoding any ASCII string or byte object into emoticons and back. It can be used to hide information in text conversations, e.g. chat or twitter or to display hashes in a graphica/more comparable way.
It supports two codecs: anybase and group256. This module is also the reference implementation of these two codecs.
Made with ❤️ at 36c3!
Install
pip install emojibase
View on PyPi via https://pypi.org/project/emojibase/
Usage
anybase
anybase is a BaseEmoji codec which works by converting the input to the base of the amount of emojis, set by the filter.
import BaseEmoji
e = BaseEmoji.anybase()
e.encode('giv mee emojiiis'.encode())
# ✴️🥎🐑⛈️🈺🚉⚕️🚅🇵🇪🥏🥇📍
e.decode('✴️🥎🐑⛈️🈺🚉⚕️🚅🇵🇪🥏🥇📍').decode('ascii')
# giv mee emojiiis
group256
This codec distributes all (filtered) emojis to 256 groups. With this, it can encode any ASCII string to emojis.
import BaseEmoji
e = BaseEmoji.group256()
e.encode('giv mee emojiiis')
# 😸😻💖🤨😿🤖🥔🐢🕢🧅🙈😼🥒🕤💸💌
e.decode('😸😻💖🤨😿🤖🥔🐢🕢🧅🙈😼🥒🕤💸💌')
# giv mee emojiiis
Filters
There are currently three filter options for changing the emojis for en/decoding:
- Groups (e.g. flags)
- Skin Tone Support
- Unicode Version
e.set_filter(['Symbols'], False, 12.0)
e.encode('giv mee symbol emojiiis'.encode())
# 📛⭕✳️⬅️✖️⚜️⚜️⬅️➰‼️✖️⚕️❎✔️⬅️⚜️✖️❎✅⭕⭕⭕➰
e.get_groups()
# {'Smileys & Emotion', 'Travel & Places', 'Activities', 'Flags', 'Animals & Nature', 'Symbols', 'People & Body', 'Objects', 'Food & Drink'}
Roadmap
- Add filter options to encoded data for automatic decoding
Credits
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file emojibase-0.0.2.tar.gz
.
File metadata
- Download URL: emojibase-0.0.2.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62e75e5d14b9a81934333e9499bf56ff7eee1aa17f9716de76956073c74c09f4 |
|
MD5 | acc695e7ca8eb522d5953c78a03b3d8b |
|
BLAKE2b-256 | 6752a7c10203a99154c09371317480f444767b64903a490d3739678ab07d6079 |
File details
Details for the file emojibase-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: emojibase-0.0.2-py3-none-any.whl
- Upload date:
- Size: 47.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fd3739657cd7e5b6f66623257840d7e99a46c7d798276e18cf88e1c441f5cbf |
|
MD5 | c85aeed5b5340bb7789061d3558241cc |
|
BLAKE2b-256 | f85d94b9c546ac177700653cb04c5bd7c5ae9f94a095bba49ad3d8104ed47f53 |