🎼 The emoji code utilities for Python
- Python 3.6 or later
$ pip install ecode
$ poetry add ecode
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'
from ecode import EcodeDecoder
ecode = EcodeDecoder().decode('BA0hzxI0VniavN7wYWIKYw')
print(ecode.text) #=> 'ab\nc'
You should install Poetry first to develop.
$ pip install poetry
$ poetry install
$ poetry update
$ poetry run pytest # Test
$ poetry run mypy -p ecode # Type checking
$ ./scripts/publish-pypi.sh
Name | Language |
---|---|
ecode-java | Java |
ecode-js | JavaScript |
MIT © Emoji Generator