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 |
|
---|---|
PyPI |
|
Activity |
|
QA |
|
Other |
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5578fe00dedf81f56540395c1afa673de25dfa905d1a55165ffdea440c59d349 |
|
MD5 | 31056ae9c92eb9ab70b3fd57a4f2a12e |
|
BLAKE2b-256 | 39865b6eb98d252344f60e8cb126c0432ae2c6756541304ec64bec8742f4e193 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b57644946963d35066cf318bf26066610e4821e4dee8a958b0bada9d57943e0 |
|
MD5 | 422281b72d4966ef0312a76c0197b77e |
|
BLAKE2b-256 | 9e935a0215b7c32dd7a95583b14b309f6af989b049f68fccd3caccc7c2bfa2f4 |