Metadata-Version: 2.1
Name: ecode
Version: 0.1.4
Summary: 
Home-page: https://github.com/emoji-gen/ecode-py
License: MIT
Author: Emoji Generator
Author-email: ultimate.emoji.gen@gmail.com
Maintainer: Emoji Generator
Maintainer-email: ultimate.emoji.gen@gmail.com
Requires-Python: >=3.6,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Project-URL: Issue tracker, https://github.com/emoji-gen/ecode-py/issues
Project-URL: Repository, https://github.com/emoji-gen/ecode-py
Description-Content-Type: text/markdown

# ecode-py
[![Build Status](https://travis-ci.com/emoji-gen/ecode-py.svg?branch=master)](https://travis-ci.com/emoji-gen/ecode-py)
[![codecov](https://codecov.io/gh/emoji-gen/ecode-py/branch/master/graph/badge.svg)](https://codecov.io/gh/emoji-gen/ecode-py)
[![PyPI version](https://badge.fury.io/py/ecode.svg)](https://badge.fury.io/py/ecode)

:musical_score: The emoji code utilities for Python

## Requirements
- Python 3.6 or later

## Getting started
### Pip

```shell script
$ pip install ecode
```

### Poetry

```shell script
$ poetry add ecode
```

## Usage
### Encoding

```python
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

```python
from ecode import EcodeDecoder

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

## Development
You should install [Poetry](https://python-poetry.org/) first to develop.

```shell script
$ pip install poetry
```

### Install requirements

```shell script
$ poetry install
```

### Upgrade requirements

```shell script
$ poetry update
```

### Test

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

### Publish

```shell script
$ ./scripts/publish-pypi.sh
```

## Ported projects

|Name|Language|
|---|---|
|[ecode-java](https://github.com/emoji-gen/ecode-java)|Java|
|[ecode-js](https://github.com/emoji-gen/ecode-js)|JavaScript|

## License

MIT &copy; [Emoji Generator](https://emoji-gen.ninja)


