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.post2.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: emojito-0.1.0.post2.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for emojito-0.1.0.post2.tar.gz
Algorithm Hash digest
SHA256 fa8846aac53a095b8110111c7e2d32d138030a318da4acf2c5684faab3b55628
MD5 45d38ce49197221d33c908088f7a4dde
BLAKE2b-256 c2349fcd8e6959e491c4737dd9fa560f375f8870a82524cdac418970e157d2f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for emojito-0.1.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d03880290a5e5b4cbc1cbdc12776d873dd8538d28d5118ee9ab500049400684
MD5 d3438708387bb77c7a0ecfe6b20af3cb
BLAKE2b-256 bced85df193c9674cc9bc48c940dfc9e0462cd70ce40ac16e1f465def6cf258a

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