Skip to main content

provides `string.emojis` (all emoji characters from unicode.org)

Project description

emoji entities

This module downloads the latest list of emoji characters from unicode.org and adds string.emojis, a concatenated str containing all characters, to be used just as the other string entities (e.g. string.letters).

Dependencies

requests

Installation

  • using pip or similar:
pip install emojientities
  • manually:

    • Clone this repository
    git clone https://gitlab.com/christoph.fink/python-emojientities.git
    
    • Change to the cloned directory
    • Use the Python setuptools to install the package:
    python ./setup.py install
    

Usage

This module extends the character classes provided by the string standard library to include an emoji range. To use it, import emojientities and string and use string.emojis to, for instance, filter emojis in a text:

import emojientities
import string

# example string from: Hiippala et al. (2018) Exploring the linguistic landscape of 
# geotagged social media content in urban environments. Digital Scholarship in the Humanities.
photoCaption = "Great weather in Helsinki!!! On holiday with @username.:-) #helsinki #visitfinland 🤓☀️🛳️"

emojisOnly = "".join(
    [c for c in photoCaption if c in string.emojis]
)
# '🤓☀️🛳️'

photoCaptionWithoutEmojis = "".join(
    [c for c in photoCaption if c not in string.emojis]
)
# 'Great weather in Helsinki!!! On holiday with @username.:-) #helsinki #visitfinland '

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

emojientities-0.1.2.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

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

emojientities-0.1.2-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file emojientities-0.1.2.tar.gz.

File metadata

  • Download URL: emojientities-0.1.2.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for emojientities-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5d0c77b18d48f54c1ef514e6a7641769280a9099e9d1de4016d2d3ceec09f509
MD5 bd0b758485bcee0e86c011c581320a1d
BLAKE2b-256 d8b15b9e53e649507fe8167f2ca27bbf41c50782170278146aff9ed0e9b1eb6d

See more details on using hashes here.

File details

Details for the file emojientities-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: emojientities-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for emojientities-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 22396c96d52366fe3a63babf57f92e9e375fc996a8e254f90ab99c01b2543be4
MD5 4a21eb3a3a6e5c96bdf3e07877ee593b
BLAKE2b-256 73e2e0176cfd9b380ed825ae38117aff8d16e81f123690361e467f547eb9fd5c

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