ecode

🎼 The emoji code utilities for Python


Keywords
emoji, python, python3
License
MIT
Install
pip install ecode==0.1.5

Documentation

ecode-py

Build Status codecov PyPI version

🎼 The emoji code utilities for Python

Requirements

  • Python 3.6 or later

Getting started

Pip

$ pip install ecode

Poetry

$ poetry add ecode

Usage

Encoding

from ecode import *

ecode = Ecode(
    locale=EcodeLocale.EN,
    flags=frozenset(EcodeFlag.SIZE_FIXED, EcodeFlag.STRETCH),
    align=EcodeAlign.CENTER,
    size=EcodeSize.XHDPI,
    format=EcodeFmt.WEBP,
    font_id=0xcf,
    foreground_color=0x12345678,
    background_color=0x9abcdef0,
    text='ab\nc'
)


code = EcodeEncoder().encode(ecode)
print(code) #=> 'BA0hzxI0VniavN7wYWIKYw'

Decoding

from ecode import EcodeDecoder

ecode = EcodeDecoder().decode('BA0hzxI0VniavN7wYWIKYw')
print(ecode.text) #=> 'ab\nc'

Development

You should install Poetry first to develop.

$ pip install poetry

Install requirements

$ poetry install

Upgrade requirements

$ poetry update

Test

$ poetry run pytest        # Test
$ poetry run mypy -p ecode # Type checking

Publish

$ ./scripts/publish-pypi.sh

Ported projects

Name Language
ecode-java Java
ecode-js JavaScript

License

MIT © Emoji Generator