Skip to main content

No project description provided

Project description

ecode-py

Build Status codecov PyPI version

:musical_score: 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ecode, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size ecode-0.1.5-py3-none-any.whl (5.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page