Metadata-Version: 2.1
Name: surrogates
Version: 1.0.2
Summary: Encode and decode pairs of surrogate characters
Home-page: https://github.com/hartwork/surrogates
Author: Sebastian Pipping
Author-email: sebastian@pipping.org
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Text Processing
Requires-Python: >=3.5
Description-Content-Type: text/markdown

# Surrogates

`surrogates` is a small, tested Python 3 package
to encode and decode pairs of
[surrogate characters](https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates)
in Python strings.
It is licensed under [the MIT license](https://opensource.org/licenses/MIT).


# Installation
```console
# pip3 install --user surrogates
```


# Usage

```console
# python3 -m IPython
[..]
In [1]: import surrogates

In [2]: surrogates.encode('😘')
Out[2]: '\ud83d\ude18'

In [3]: surrogates.decode('\uD83D\uDE18')
Out[3]: '😘'

In [4]: hex(ord('😘'))
Out[4]: '0x1f618'
```


# Develop & run tests

```
cd "$(mktemp -d)"
git clone https://github.com/hartwork/surrogates
cd surrogates/
python3 -m venv py3
source py3/bin/activate
./setup.py test
```


