Giter Site home page Giter Site logo

emojitations's Introduction

Emojitations

A library for using Unicode emoji annotations. Emoji annotations can provide your scripts with a simple way to interpret emoji, or select a random one satisfying certain criteria. Annotations can be seen listed here on the Unicode website: http://unicode.org/emoji/charts/full-emoji-list.html

Requirements

  1. Python 3.+

This library is pure python 3 and has no other requirements.

Installation

python3 setup.py install

Usage

Emoji are available under their names at emoji.whatever. These objects include an annotations set and you can use the emoji attribute or str() to get their emoji strings. To get all emoji in an annotation, use emoji.annotation.whatever. This returns frozen sets which then can be combined using set operations.

To get info on a particular emoji, you can request emoji['πŸ”β€™] or emoji.get(β€™πŸ”β€™) and look at its name and annotations.

(Should Python ever support emoji identifiers, emoji.😜 would also work. Unfortunately we do not yet live in that beautiful world.)

The library also provides (preliminary) support for foreign languages, available as emoji.de.kreditkarte for example. Names & annotations are drawn from the Unicode LDML, and differ for different languages, so emoji.en[β€˜πŸŽ²β€™] != emoji.de[β€˜πŸŽ²β€™].

See the examples below for details.

>>> from emojitations import emoji
>>> emoji.grinning_face.annotations
frozenset({'grin', 'face'})
>>> print(''.join(str(grin) for grin in emoji.annotation.grin))
πŸ˜ΈπŸ˜πŸ˜€
>>> print(''.join(str(grin) for grin in emoji.annotation.grin & emoji.annotation.cat))
😸
>>> print(str(emoji.de.kreditkarte))
πŸ’³

emojitations's People

Contributors

kcsaff avatar

Watchers

James Cloos avatar Wannaphong Phatthiyaphaibun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.