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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file emoji_strings-0.1.0.tar.gz.

File metadata

  • Download URL: emoji_strings-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for emoji_strings-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5578fe00dedf81f56540395c1afa673de25dfa905d1a55165ffdea440c59d349
MD5 31056ae9c92eb9ab70b3fd57a4f2a12e
BLAKE2b-256 39865b6eb98d252344f60e8cb126c0432ae2c6756541304ec64bec8742f4e193

See more details on using hashes here.

File details

Details for the file emoji_strings-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: emoji_strings-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for emoji_strings-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b57644946963d35066cf318bf26066610e4821e4dee8a958b0bada9d57943e0
MD5 422281b72d4966ef0312a76c0197b77e
BLAKE2b-256 9e935a0215b7c32dd7a95583b14b309f6af989b049f68fccd3caccc7c2bfa2f4

See more details on using hashes here.

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