Skip to main content

Define your own shortnames to be replaced with emojis or other content.

Project description

Emojito

There are many packages that provide shortnames for emojis. This package allows you to provide your own shortnames and with what to replace them.

Features

  • Find and replace shortnames. You provide the shortnames and the content with which to replace them. You can also provide a callable from which you can in stead generate the content.
  • Compatible with HTML. In stead of indiscrimnately finding and replacing shortnames anywhere in the text, accidentally replacing content that overlaps with tags, the HTML will be parsed and only the plain text within tags will be affected.

Example

from emojito import Emojitos


# Define your shortnames and their replacements.
emojitos = Emojitos()
emojitos.add(['one'], '1️⃣')
emojitos.add(['two'], '2️⃣')
emojitos.add(['three'], '3️⃣')


# Provide a text containing your shortnames.
document = """
<h1>This is an example of Emojito</h1>

<ul>
    <li>:one: Number One</li>
    <li>:two: Number Two</li>
    <li>:three: Number Three</li>
</ul>
"""

# Replace all instances of your shortnames in the document.
result = emojitos.replace(document)

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

emojito-0.1.0.post1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

emojito-0.1.0.post1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file emojito-0.1.0.post1.tar.gz.

File metadata

  • Download URL: emojito-0.1.0.post1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for emojito-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 35874c76018fd3eb64644ac770d374e77708c3f6aab968def1286677e1df3792
MD5 6efc271ecd31b26712112c21c6e86a23
BLAKE2b-256 471ffd217dc8ff7fe6815c0c2dd70b85b625fdf3edcf2218799c8a9760b6bb46

See more details on using hashes here.

File details

Details for the file emojito-0.1.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for emojito-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 f03aeebbf33fd3967d0698ce69dc6ecdd6fa424b1e5191bc318b12f0f9ffeeae
MD5 d21cacfd5d782ffcc6daa44215392edd
BLAKE2b-256 2054170bdca909d81f084c2fa971151c263b11c9a185acc385ea25e1f16f3bc3

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