Metadata-Version: 2.4
Name: prune_captcha
Version: 1.2.0
Summary: A tool to protect formulaire from spam.
Author-email: Arnout <bastien@prune.sh>
Project-URL: Made_by, https://prune.sh/
Keywords: captcha,django,code-quality
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: <4.0,>=3.12
Description-Content-Type: text/markdown
Requires-Dist: django>=5.2
Requires-Dist: psycopg2-binary>=2.9.10
Requires-Dist: pydantic>=2.11.4
Requires-Dist: pydantic-settings>=2.9.1

# Prune's Captcha

## What is it for?

Captcha helps prevent robots from spamming using your forms.

## Prerequisites

-   To be installed on a Prune Django project that uses poetry or UV

## UV project

### Installation

Run the following command in the console:

```bash
uv add captcha_prune
```

### Running the captcha

To run the package, simply enter in the console:

```bash
captcha_prune
```

### Updating the captcha

Don't hesitate to regularly run `uv sync --upgrade`, as the captcha evolves with time and our practices!

## Poetry project

### Installation

Run the following command:

```bash
poetry add prune_captcha
```

### Running the captcha

```bash
poetry run prune_captcha
```

### Updating the captcha

Don't hesitate to regularly run `poetry update`, as the captcha evolves with time and our practices!

## Captcha Integration

Once the project is launched, the application's URLs need to be linked to the form.

-   When making a **GET** request to the form page, the API must be called via the **creation endpoint**. The response will contain the necessary information to display the captcha.
-   When submitting the form via **POST**, the API must be called via the **verification endpoint**. The response will indicate whether the captcha is valid or not.

## Captcha Display

To display the captcha correctly, use the data received in the response from the creation request. This data includes:

-   the captcha's width and height,
-   the piece's width and height,
-   the current position of the piece,
-   the target position (where the piece should be placed),
-   the expected precision (captcha difficulty level).

# Available Versions

| Version | Date       | Notes                                  |
| ------- | ---------- | -------------------------------------- |
| 1.0.0   | 2025-03-14 | First version of the `captcha` package |
