Metadata-Version: 2.4
Name: emoji-sentiment
Version: 0.0.6
Summary: A Python package for emoji sentiment analysis.
Author-email: "Wan, Jiun-Wei" <wei840222@gmail.com>
License-Expression: MIT AND CC-BY-SA-4.0
Project-URL: Homepage, https://github.com/wei840222/emoji-sentiment
Project-URL: Repository, https://github.com/wei840222/emoji-sentiment
Project-URL: Issues, https://github.com/wei840222/emoji-sentiment/issues
Keywords: emoji,sentiment-analysis,nlp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSES/CC-BY-SA-4.0.txt
License-File: NOTICE.md
Requires-Dist: emoji-data-python>=1.6.0
Requires-Dist: pydantic>=2.13.4
Provides-Extra: demo
Requires-Dist: pandas>=3.0.3; extra == "demo"
Requires-Dist: plotly>=6.9.0; extra == "demo"
Requires-Dist: streamlit>=1.59.2; extra == "demo"
Dynamic: license-file

# Emoji Sentiment

A Python package for looking up sentiment scores from the Emoji Sentiment
Ranking 1.0 dataset.

<img width="531" alt="image" src="https://github.com/user-attachments/assets/5b53da6f-be97-4ec2-a2d5-dc09bd6f9917" />

The package provides a score from `-1` (negative) to `1` (positive), together
with the emoji name, character, short names, and sample count. Scores come from
the bundled research dataset; the package does not run a predictive model.

## Installation

Requires Python 3.14 or newer.

```bash
pip install emoji-sentiment
```

## Usage

```python
from emoji_sentiment import EmojiSentiment

emoji_sentiment = EmojiSentiment()
smile_emoji = emoji_sentiment.get("smile")
print(smile_emoji)
```

`get()` is case-insensitive and returns `None` when the short name is unknown or
not present in the dataset. Use `emoji_sentiment.all` to retrieve all 969
entries.

## Demo

```sh
uv run --extra demo streamlit run examples/streamlit_demo.py
```

## Development

Install the locked development environment:

```sh
uv sync --locked --dev
```

Run tests and lint checks:

```sh
uv run pytest --cov=emoji_sentiment --cov-report=term-missing -v tests
uv run pylint src/emoji_sentiment tests/test_emoji_sentiment.py tests/smoke_test.py
```

Build and validate the distribution archives:

```sh
uv build
uv run twine check --strict dist/*
```

## Data source and license

The bundled `Emoji_Sentiment_Data_v1.0.csv` is from:

> Kralj Novak, Petra; Smailović, Jasmina; Sluban, Borut; and Mozetič,
> Igor (2015), *Emoji Sentiment Ranking 1.0*, Slovenian language resource
> repository CLARIN.SI, ISSN 2820-4042.

- Resource: http://hdl.handle.net/11356/1048
- Paper: https://doi.org/10.1371/journal.pone.0144296
- Dataset license: Creative Commons Attribution-ShareAlike 4.0 International
  (CC BY-SA 4.0)

The package source code is licensed under the MIT License in `LICENSE`. The
bundled dataset remains under CC BY-SA 4.0. See
https://github.com/wei840222/emoji-sentiment/blob/main/NOTICE.md for full
attribution and third-party licensing details.
