Skip to content

Paillat-dev/dismoji

Repository files navigation

dismoji

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

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

Table of Contents

Overview

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.

Installation

pip install dismoji

Quick Start

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •