Skip to main content

Adds support for emoji-strings in Python, which convert emoji names into actual emoji.

Project description

Adds support for emoji-strings in Python, which convert emoji names into actual emoji.

Tests

Linux Test Status Windows Test Status macOS Test Status Coverage

PyPI

PyPI - Package Version PyPI - Supported Python Versions PyPI - Supported Implementations PyPI - Wheel

Activity

GitHub last commit GitHub commits since tagged version Maintenance PyPI - Downloads

QA

CodeFactor Grade Flake8 Status mypy status pre-commit.ci status

Other

License GitHub top language Requirements Status

Installation

emoji-strings can be installed from PyPI.

To install with pip:

$ python -m pip install emoji-strings

Usage

Emoji strings (g-strings for short) are similar to Python’s f-strings. However, rather than using curly braces, g-strings use colons to mark emoji in a string. For example, in the following sentence, :rocket: denotes a substitution, in this case for a 🚀 emoji:

Deploy the app :rocket:

In a Python source file, you can write this as:

print(g"Deploy the app :rocket:")
#     ^ note the "g" prefix character

which would print:

Deploy the app 🚀

Ta da! You no longer need to remember unicode code points or use cumbersome emoji entry dialogs. To enable this magic, add the following comment to the top of your python source file:

# -*- coding: emoji_strings -*-

and add emoji-strings to your requirements.txt file.

Disclaimer

This is a joke.

While this absolutely does work I made it for fun. Someone had asked me if, since Python has f-strings, it also has g-strings? It does now.

Credits

Based on future-fstrings, and uses the emoji library to parse the emoji names.

Project details


Download files

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

Source Distribution

emoji_strings-0.1.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

emoji_strings-0.1.0-py3-none-any.whl (14.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page