Metadata-Version: 2.2
Name: spacy-polarity
Version: 0.1.2
Summary: Spacy extension for sentiment polarity
Author: sondalex
License: MIT License
        
        Copyright (c) 2025 sondalex
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/sondalex/spacy-polarity
Project-URL: documentation, https://github.com/sondalex/spacy-polarity
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: spacy>=3.1.0
Requires-Dist: textblob>=0.19.0
Requires-Dist: numpy<2.0.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"

# spacy-polarity

![pyversion](https://img.shields.io/badge/python-3.10+-blue.svg)

**Measure sentiment polarity of sentences and documents**

## Installation

```python
pip install spacy-polarity
```

## Usage

```python
import spacy
import spacy_polarity

nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("spacy_polarity")

doc = nlp("The financial markets are performing well, bringing good returns to investors. The stock markets in USA grew by 5% this year.")

# Sentence level polarity  
for sent in doc.sents:
    print(sent._.polarity)

# Document level polarity
print(doc._.polarity)
```

## Development

### Style and linting

```bash
ruff check
```

```bash
ruff format
```

### Testing

```bash
pip install ".[test]"
```

```bash
pytest -vvv
```

