Metadata-Version: 2.4
Name: pyspamdetector
Version: 0.0.1
Summary: A Python library for detecting spam messages using machine learning models
Project-URL: Homepage, https://github.com/Psunday2000/pyspamdetector
Project-URL: Issues, https://github.com/Psunday2000/pyspamdetector
Author-email: Praise Chiedozie Sunday <psunday2000@gmail.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.0
Description-Content-Type: text/markdown

# **pyspamdetector**

`pyspamdetector` is a Python library that allows you to easily classify text messages as **Spam** or **Not Spam** using a pre-trained machine learning model. The library is designed to be simple and intuitive, with built-in methods to classify and describe text messages.

---

## **Table of Contents**

1. [Usage](#usage)
    - [Basic Usage](#basic-usage)
    - [Method Descriptions](#method-descriptions)
2. [License](#license)
3. [Contributing](#contributing)

---

## **Usage**

Once you have the library installed, you can easily classify text messages. The main features are:

### **Basic Usage**

To classify a message as spam or not, you simply need to import `pyspamdetector` and call the `readText()` method. Here's an example:

```python
from pyspamdetector import PySpamDetector

# Instantiate the classifier
detector = PySpamDetector()

# Classify a message
is_spam = detector.readText("Congratulations, you've won a $1000 gift card! Click here to claim your prize.")

# Output classification result
print(is_spam)  # Output will be True (Spam) or False (Not Spam)
```

### **Method Descriptions**

1. **`readText(text: str) -> bool`**  
   - **Purpose**: Classifies the provided text as Spam or Not Spam.
   - **Arguments**: `text` (str) - The message you want to classify.
   - **Returns**: `bool` - `True` for Spam, `False` for Not Spam.

2. **`describeText(text: str) -> dict`**  
   - **Purpose**: Provides a general description of the message without classifying it.
   - **Arguments**: `text` (str) - The message you want to describe.
   - **Returns**: `dict` - A JSON-like dictionary that includes:
     - The original message.
     - A classification (`Spam` or `Not Spam`).
     - An advice or warning about the message's nature.

Example:

```python
description = detector.describeText("Congratulations, you've won a $1000 gift card! Click here to claim your prize.")

# Example output
{
    "message": "Congratulations, you've won a $1000 gift card! Click here to claim your prize.",
    "classification": "Spam",
    "advice": "Be cautious! This message appears to be spam. Avoid clicking on links or providing sensitive information."
}
```

---

## **License**

`pyspamdetector` is open-source and released under the GNU General Public License v3 (GPLv3). See the [LICENSE](LICENSE) file for more details.

---

## **Contributing**

If you'd like to contribute to the project, feel free to fork the repository and submit a pull request. We welcome improvements and fixes!

---