1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.
Pilmoji
Pilmoji is an emoji renderer for Pillow, Python's imaging library.
Pilmoji comes equipped with support for both unicode emojis and Discord emojis.
Features
- Discord emoji support
- Multi-line rendering support
- Emoji position and/or size adjusting
- Many built-in emoji sources
- Optional caching
Installation and Requirements
You must have Python 3.8 or higher in order to install Pilmoji.
Installation can be done with pip:
$ pip install -U pilmoji
Optionally, you can add the [requests] option to install requests
alongside Pilmoji:
$ pip install -U pilmoji[requests]
The option is not required, instead if requests is not installed,
Pilmoji will fallback to use the builtin urllib.
You may also install from Github.
Usage
from pilmoji import Pilmoji
from PIL import Image, ImageFont
my_string = '''
Hello, world! 👋 Here are some emojis: 🎨 🌊 😎
I also support Discord emoji: <:rooThink:596576798351949847>
'''
with Image.new('RGB', (550, 80), (255, 255, 255)) as image:
font = ImageFont.truetype('arial.ttf', 24)
with Pilmoji(image) as pilmoji:
pilmoji.text((10, 10), my_string.strip(), (0, 0, 0), font)
image.show()
Result
Switching emoji sources
As seen from the example, Pilmoji defaults to the Twemoji emoji source.
If you prefer emojis from a different source, for example Microsoft, simply
set the source kwarg in the constructor to a source found in the
pilmoji.source module:
from pilmoji.source import MicrosoftEmojiSource
with Pilmoji(image, source=MicrosoftEmojiSource) as pilmoji:
...
It is also possible to create your own emoji sources via subclass.
Fine adjustments
If an emoji looks too small or too big, or out of place, you can make fine adjustments
with the emoji_scale_factor and emoji_position_offset kwargs:
pilmoji.text((10, 10), my_string.strip(), (0, 0, 0), font,
emoji_scale_factor=1.15, emoji_position_offset=(0, -2))
Contributing
Contributions are welcome. Make sure to follow PEP-8 styling guidelines.
Metadata
Release files for pilmoji 2.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
File added late
1 file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release files before installing.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pilmoji-2.0.5.tar.gz | 11.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pilmoji-2.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.6 kB
Release files / pilmoji-2.0.5.tar.gz
| Download URL | pilmoji-2.0.5.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e038532c97b79b3d55c29f5a6c2b6b627105b8cd1db0c1d2271402b3e4e9be18
|
|
BLAKE2b-256 checksum How to use checksums |
0575e5430da7a99ea66c9b93cdbd66372a010022398887eb3f8fcccb866010ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.12
|
Release files / pilmoji-2.0.5-py3-none-any.whl
File added late
This file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release file before installing.
| Download URL | pilmoji-2.0.5-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
856ddf827d42d8c8d2a1f879fdc1ae318ffb72435c4adc934be6d3e48376173d
|
|
BLAKE2b-256 checksum How to use checksums |
24092dcc3fa1e0627f95143b61cc2c8a13042f5dcd7e11d1e12b0ba5e205aeca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for pilmoji 2.0.5
Upload timing
File added late
1 file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.