This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Emojificate is a Python implementation of a concept of using fallback images, alt text, title text and aria labels to represent emoji in HTML code in a more accessible method.

Usage

To convert a string from the command line:

$ python3 -m emojificate "I πŸ’œ emoji 😊"
I <img src="https://twemoji.maxcdn.com/36x36/1f49c.png" alt="πŸ’œ" title="Purple Heart"
aria-label="Emoji: Purple Heart"> emoji <img src="https://twemoji.maxcdn.com/36x36/1f60a.png"
alt="😊" title="Smiling Face With Smiling Eyes" aria-label="Emoji: Smiling Face With Smiling Eyes">

Or, if you’ve got a Django project, put emojificate into your INSTALLED_APPS, and then use the following in a template:

{% load emojificate %}
This is some {{ user_content|emojificate }} that has emoji in it.

{% emojified %}
This is some template content that πŸ’œ emoji as well.
{% endemojified %}

Implementation

TL;DR: Take a string, split it into token, and if a token is emoji, process it into a nice format.

Splitting the string is a problem, because at the moment it does not handle Zero Width Joining sequences. However, native Python string tokenization does work for the most part.

Given a list of tokens, we can leverage the native unicodedata to:

  • see if a token is a unicode Symbol (an emoji)
  • get the codepoint for the emoji, and
  • get the name of the emoji

From there, we construct an <img> replacement for the emoji:

  • Use images from twemoji, Twitter’s emoji set
  • Have an alt parameter containing the original emoji. This allows for copying-pasting.
  • Use the name of the emoji in the title parameter. This allows for hover-tooltips.
  • Add an aria-label for screen-reader accessibility.

For more information, see Solve For Emoji.

Limitations

  • Does not handle Zero Width Join Sequences; for example: πŸ–πŸ½, πŸ‘©β€πŸ‘©β€πŸ‘§
Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
emojificate-0.1.2-py2.py3-none-any.whl (6.2 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Sep 15, 2016
emojificate-0.1.2.tar.gz (4.4 kB) Copy SHA256 Checksum SHA256 – Source Sep 15, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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