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!

Emoji notation expansion.

Project Description

A simple script to replace emoji string notation such as :simple_smile: with an HTML image tag. By default, inject-emoji reads from STDIN, and writes to STDOUT.


So many offline GitHub Flavored Markdown renderers, yet so few with GitHub Flavored Markdown Emoji. Until now.

The Interface

inject-emoji is available both as a Python module and a command-line application (powered by Python).

The Python Module

*injectemoji.InjectEmoji([Input FileObj], [Output FileObj], [emoji_directory])* If input and/or output FileObjects are provided, they will be used accordingly. If none are provided, sys.stdin and sys.stdout, respectively, will be used. If an emoji directory (say, from your own checkout of WebpageFX/, the substitutions provided to the regular expression in inject-emoji will be a reflection of the filenames in that directory.

The CLI Tool

usage: inject-emoji [-h] [-o FILE] [-d EMOJI_DIR] [FILE]

Convert emoji-cheat-sheet notation to HTML image tags.

positional arguments:
  FILE                  Read from FILE instead of stdin

optional arguments:
  -h, --help            show this help message and exit
  -o FILE, --output FILE
                        Write to FILE instead of stdout
                        Read emoji directory listing from EMOJI_DIR instead of
                        bundled emoji

The Installation

$ pip install inject-emoji

The RegEx

The regular expression match is Python-flavored. The shorthand view of it is:


Regular expression visualization

Debuggex Demo

However, in the source itself, all 800+ emoji names are compiled into the regex.

The Why

I wrote this script to enhance Github Flavored Markdown generated by Marked 2. To use it with Marked 2, configure it as a preprocessor like so:

Marked 2 Config

Release History

Release History

This version
History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
inject_emoji-1.0.0-py2.py3-none-any.whl (13.3 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Oct 14, 2016
inject-emoji-1.0.0.tar.gz (3.9 MB) Copy SHA256 Checksum SHA256 Source Oct 14, 2016

Supported By

WebFaction WebFaction Technical Writing 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 Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting