Skip to main content

provides `string.emojis` (all emoji chars 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.4.tar.gz (32.5 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.4-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: emojientities-0.1.4.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for emojientities-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a4fdcfa99ee87e45b326ad499215dd9de07ce728c93fb592ac20357745616b00
MD5 de1d6525f178c183c3f664afb28c76eb
BLAKE2b-256 d9334b6f022ed293142769fa0afb0f2cfd57bd74ec1c4b92c1e51b2f319b4826

See more details on using hashes here.

File details

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

File metadata

  • Download URL: emojientities-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for emojientities-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 05f017a006c263590fed2d8a06dbe439fb1dc19823d2eca4efdd7d9107ea4a18
MD5 b70120ed8c0a3a93d696e93b3022c517
BLAKE2b-256 8a2e2920eac0d2900ced414e68ea4fbb8e40f08066a2d6b91c1376bab7a73324

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