/ecoji-py

Encode and decode data as emojis, in Python

Primary LanguagePythonApache License 2.0Apache-2.0

Ecoji-py πŸ£πŸ”‰πŸ¦πŸ”ΌπŸ½πŸšƒπŸ”“β˜•

A Python3 implemention of Ecoji. Ecoji encodes data as 1024 emojis, its base1024 with an emoji character set. Give Ecoji a try at ecoji.io.

Installing

  • with pip
$pip3 install ecoji
  • with source code
$git clone git@github.com:mecforlove/ecoji-py.git && cd ecoji-py && python3 setup.py install

For CLI usage

  • encode
$echo -n hello | ecoji
πŸ‘²πŸ”©πŸš—πŸŒ·
  • decode
$echo -n πŸ‘²πŸ”©πŸš—πŸŒ· | ecoji -d
hello%

Run ecoji -h to learn more about the CLI.

For python lib

  • encode
>>> import io
>>> from ecoji import encode
>>> r = io.BytesIO(b'hello')
>>> w = io.StringIO()
>>> encode(r, w)
>>> print(w.getvalue())
πŸ‘²πŸ”©πŸš—πŸŒ·
  • decode
>>> import io
>>> from ecoji import decode
>>> r = io.StringIO('πŸ‘²πŸ”©πŸš—πŸŒ·')
>>> w = io.BytesIO()
>>> decode(r, w)
>>> print(w.getvalue())
b'hello'

Last but not the least, only Python3.x is supported.