Git Product home page Git Product logo

baseemoji's Introduction

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

baseemoji's People

Contributors

tejado avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.