Pilmoji for nonebot-plugin-parser
Project description
Apilmoji
An asynchronous emoji rendering Extension for PIL
✨ Features
- 🎨 Unicode Emoji Support - Render standard Unicode emojis
- 💬 Discord Emoji Support - Render custom Discord emojis
- 🔄 Concurrent Downloads - Support concurrent emoji downloads for better performance
- 💾 Smart Caching - Local file caching to avoid repeated downloads
- 🎭 Multiple Styles - Support for Apple, Google, Twitter, Facebook, and other styles
- 📊 Progress Display - Optional progress bar for download progress
📦 Installation
Requirements: Python 3.10 or higher
uv add apilmoji
Or install from source:
uv add git+https://github.com/fllesser/apilmoji
🚀 Quick Start
Basic Usage (Unicode Emojis Only)
import asyncio
from PIL import Image, ImageFont
from apilmoji import Apilmoji
async def main():
text = """
Hello, world! 👋
"We have standard emojis: 😂, 🚀, 🐍, 💻.",
"And some more: 🌟✨🔥💯.",
"""
# create image
image = Image.new("RGB", (550, 150), (255, 255, 255))
font = ImageFont.truetype("arial.ttf", 24)
# render text with emojis
await Apilmoji.text(image, (10, 10), text.strip(), font, fill=(0, 0, 0))
image.save("output.png")
image.show()
asyncio.run(main())
Discord Emoji Support
import asyncio
from PIL import Image, ImageFont
from apilmoji import Apilmoji, EmojiCDNSource
async def main():
text = """
Unicode emojis: 👋 🎨 😎
Discord emojis: <:rooThink:123456789012345678>
"""
image = Image.new("RGB", (550, 100), (255, 255, 255))
font = ImageFont.truetype("arial.ttf", 24)
source = EmojiCDNSource(enable_discord=True)
await Apilmoji.text(
image,
(10, 40),
text,
font,
fill=(0, 0, 0),
support_ds_emj=True,
source=source,
)
image.save("output.png")
asyncio.run(main())
🎨 Emoji Styles
Choose different emoji styles:
from apilmoji import Apilmoji, EmojiCDNSource, EmojiStyle
# Apple style (default)
source = EmojiCDNSource(style=EmojiStyle.APPLE)
# Google style
source = EmojiCDNSource(style=EmojiStyle.GOOGLE)
await Apilmoji.text(
image,
(10, 10),
"Hello 👋",
font,
source=source
)
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🐛 Issues
If you encounter any issues, please report them on the GitHub Issues page.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apilmoji-0.2.3.tar.gz.
File metadata
- Download URL: apilmoji-0.2.3.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
744ed123c88edeb954e98dc0cea775dfee7894eb49df1401b00f1e012afed86b
|
|
| MD5 |
434e803fa463fa87ee3f9a67d3208626
|
|
| BLAKE2b-256 |
c4151a7c474a64920691ea649a76e63d6964efe2c63fcb7c3855b9b2827415d3
|
File details
Details for the file apilmoji-0.2.3-py3-none-any.whl.
File metadata
- Download URL: apilmoji-0.2.3-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54aa7b5fc9d74c295903e75db4839c4057497d0d0c5c50e8e17d6e3ecdd211b1
|
|
| MD5 |
b3a87e75b2beb323380d9730b632d75e
|
|
| BLAKE2b-256 |
6f5037dfc418db7adf0487afdfc2081d544359b862cd46b77ad90588e091bf72
|