Skip to main content

A Python library for converting Discord emoji names to their Unicode equivalents.

Project description

PyPI - Version PyPI - Python Version PyPI - Types PyPI - License GitHub Actions Workflow Status pre-commit.ci status


Dismoji is a lightweight Python library that provides a simple way to convert Discord emoji names to their Unicode equivalents and vice versa. With just two function calls, you can transform text containing Discord-style emoji codes (like :smile:) into text with actual Unicode emoji characters (like "😄") and back again.

This library uses Paillat-dev/discord-emojis as the source for Discord emoji names and aliases.

import dismoji

# Convert Discord emoji names to Unicode emojis
text = "Hello, :wave: I'm excited! :partying_face:"
converted_text = dismoji.emojize(text)
print(converted_text)  # Output: "Hello, 👋 I'm excited! 🥳"

# Convert Unicode emojis back to Discord emoji names
emoji_text = "Hello, 👋 I'm excited! 🥳"
named_text = dismoji.demojize(emoji_text)
print(named_text)  # Output: "Hello, :wave: I'm excited! :partying_face:"

Features

  • Simple API: Just two functions to remember - dismoji.emojize() and dismoji.demojize()
  • Discord Compatible: Supports Discord's emoji naming conventions
  • Comprehensive: Includes all standard emojis available on Discord
  • Type Safe: Fully type-annotated for better IDE integration
  • Zero Dependencies: Lightweight with no external dependencies
  • Fast: Optimized for quick emoji replacement
  • Bidirectional: Convert between emoji names and characters in both directions

Getting Help

If you encounter issues or have questions about dismoji:

Development

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run linter, formatter and type checker: ruff check ., ruff format ., basedpyright .
  5. Submit a pull request

Development Tools:

  • uv: For dependency management
  • Ruff: For linting and formatting
  • HashiCorp Copywrite: For managing license headers
  • basedpyright: For type checking

Acknowledgements

  • emoji as inspiration for the API design

License

MIT License - Copyright (c) 2025 Paillat-dev


Made with ❤ by Paillat-dev

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

dismoji-0.3.1.tar.gz (128.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dismoji-0.3.1-py3-none-any.whl (132.8 kB view details)

Uploaded Python 3

File details

Details for the file dismoji-0.3.1.tar.gz.

File metadata

  • Download URL: dismoji-0.3.1.tar.gz
  • Upload date:
  • Size: 128.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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

Hashes for dismoji-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b915dcca18b17a5c91f8b7fcee063d4f4d7178b523e5df6d47135f4bc5cd2db0
MD5 c8be3f553a68008db3d36a2ae1624feb
BLAKE2b-256 1493d44480d3e87642e9956570234bd4c501794201c75f5998a2125dc39b32c9

See more details on using hashes here.

File details

Details for the file dismoji-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: dismoji-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 132.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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

Hashes for dismoji-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a783d33f4dba9450328e385025290e87182493dc219cf2d22f80d4f775bfd1f
MD5 9cdb81ba4109084b9cdb89d097693844
BLAKE2b-256 cdd6ab70cea5a74cd6487e0012f221ef763f8ef76bd146c3faafe62649b42b4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page