Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Module providing Emoji encoding for Python

Project Description

# Emoji encoding for ๐Ÿ

This module provides a custom source code encoding allowing usage of Emoji's for things like variable names or function names.

## Usage

Install the package with pip:
pip install emoji-encoding
**It's recommended to install it in [a virtualenv](**

After installation you can specify the encoding in the beginning of a Python file:

# -*- coding: emoji -*-
def ๐Ÿ“ข(โœ‰๏ธ):

๐Ÿ“ข("โœ‹ ๐ŸŒ")

## Uninstalling

This package will create `emoji.pth` file in your `site-packages` directory to autoload the codec. After removing the module you need to remove this file manually.

## Known issues

Currently the encoding is only available in imported modules so trying to run Emoji encoded file directly will fail:

$ python
File "", line 1
SyntaxError: encoding problem: emoji

Easy workaround is to have an another file that imports the Emoji encoded file:

$ cat
import emoji
$ python
โœ‹ ๐ŸŒ

## History

It all started with Ola Sendecka's talk about [Emoji Driven Development]( which made me wonder: "why *can't* we use Emoji's in Python?". After a bit of hacking I was able to use them [with a patched cpython]( This wasn't a perfect solution so playing with this idea I ended up with custom [codec]( that translates Emoji's to their ASCII representations and adds prefix/suffix to decode such unique string back to Unicode.

Release History

This version
History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(4.3 kB) Copy SHA256 Hash SHA256
Source None Feb 21, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting