Giter Club home page Giter Club logo

python-emojipedia's Introduction

python-emojipedia

Build Status Code Climate PyPI version Documentation Status Test Coverage

Emoji data from Emojipedia ๐Ÿ˜Ž

Basic Usage

>>>from emojipedia import Emojipedia
>>>taco = Emojipedia.search('taco')
>>>taco
# <Emoji - 'Taco' - character: ๐ŸŒฎ, description: A taco; a Mexicanย fo...>

Installation:

To install, simply run pip install emojipedia.

To install from source, run the following from within the main project directory:

python setup.py build
python setup.py install

Usage:

from emojipedia import Emojipedia

# Search for emoji by title
taco = Emojipedia.search('taco')

# Emojipedia description
print(taco.description)  # "A taco; a Mexican food item displayed with a variety of fillings. ..."

# Emojipedia codepoints
print(taco.codepoints)  # "U+1F32E"

# Emojipedia listed platforms 
# Contains title, Emojipedia platform url, and platform specific emoji img url
platforms = taco.platforms 
print(platforms[0])  # Platform(name=u'Apple', image_url=u'.../taco_1f32e.png')

joy = Emojipedia.search('face-with-tears-of-joy')
# Emoji shortcodes
joy.shortcodes  # ":joy:"

# Search for emoji by emoji
smirk = Emojipedia.search('๐Ÿ˜')
# Custom Emoji string preview
print(str(smirk))  # <Emoji - 'Smirking Face' - character: ๐Ÿ˜, description: A sly smile, often u...>

# Get a category of emoji
people = Emojipedia.category('people')
people[0].title  # <Emoji - 'Grinning Face' - character: ๐Ÿ˜€, description: A face with a big op...>
print(len(people))  # 306

# Get all the emoji
# NOTE: This is temporarily broken, as it seems visiting emojipedia.org/emoji always times out
emojis = Emojipedia.all()
print(len(emojis))  # 2621
for emoji in emojis:
    print(emoji.title)

Documentation

Read more about python-emojipedia on the ReadTheDocs page.

Contributing

Contributions to python-emojipedia are welcomed! ๐Ÿ˜

  1. Fork the repo.
  2. Create a new feature branch.
  3. Add your feature / make your changes.
  4. Install pep8 and run pep8 *.py in the root project directory to lint your changes. Fix any linting errors.
  5. Create a PR.
  6. ???
  7. ๐ŸŽ‰ Profit. ๐ŸŽ‰

python-emojipedia's People

Contributors

bcongdon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-emojipedia's Issues

TypeError: 'NoneType' object is not subscriptable

Traceback (most recent call last): File "/home/development/backend/venv/lib/python3.10/site-packages/asgiref/sync.py", line 486, in thread_handler raise exc_info[1] File "/home/development/backend/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 42, in inner response = await get_response(request) File "/home/development/backend/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 253, in _get_response_async response = await wrapped_callback( File "/home/development/backend/venv/lib/python3.10/site-packages/asgiref/sync.py", line 448, in __call__ ret = await asyncio.wait_for(future, timeout=None) File "/usr/lib/python3.10/asyncio/tasks.py", line 408, in wait_for return await fut File "/home/development/backend/venv/lib/python3.10/site-packages/asgiref/current_thread_executor.py", line 22, in run result = self.fn(*self.args, **self.kwargs) File "/home/development/backend/venv/lib/python3.10/site-packages/asgiref/sync.py", line 490, in thread_handler return func(*args, **kwargs) File "/usr/lib/python3.10/contextlib.py", line 79, in inner return func(*args, **kwds) File "/home/development/backend/venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "/home/development/backend/venv/lib/python3.10/site-packages/rest_framework/viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) File "/home/development/backend/venv/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch response = self.handle_exception(exc) File "/home/development/backend/venv/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "/home/development/backend/venv/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception raise exc File "/home/development/backend/venv/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "/home/development/backend/apps/emojis/api/v1/views.py", line 16, in list queryset = self.get_queryset() File "/home/development/backend/apps/emojis/api/v1/views.py", line 26, in get_queryset return Emojipedia.category('nature') File "/home/development/backend/venv/lib/python3.10/site-packages/emojipedia/emojipedia.py", line 49, in category url = emoji_entry.find('a')['href'] TypeError: 'NoneType' object is not subscriptable

error

For all functions I get: TypeError: __repr__ returned non-string (type bytes).

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.