Metadata-Version: 2.4
Name: CaptchaGenerator
Version: 2.0.0
Summary: A modular and customizable CAPTCHA generation library.
Project-URL: Documentation, https://github.com/Sepehr0Day/CaptchaGenerator/wiki
Project-URL: Repository, https://github.com/Sepehr0Day/CaptchaGenerator
Project-URL: Issues, https://github.com/Sepehr0Day/CaptchaGenerator/issues
Author: Sepehr0Day
License: MIT
License-File: LICENSE
Keywords: accessibility,captcha,image,pillow,security
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Security
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pillow>=10.0.0
Provides-Extra: audio
Requires-Dist: gtts>=2.3.2; extra == 'audio'
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: telegram
Requires-Dist: telethon>=1.30.0; extra == 'telegram'
Description-Content-Type: text/markdown

# CaptchaGenerator 2.0.0

[![Tests](https://github.com/Sepehr0Day/CaptchaGenerator/actions/workflows/tests.yml/badge.svg)](https://github.com/Sepehr0Day/CaptchaGenerator/actions/workflows/tests.yml)
[![Package](https://github.com/Sepehr0Day/CaptchaGenerator/actions/workflows/package.yml/badge.svg)](https://github.com/Sepehr0Day/CaptchaGenerator/actions/workflows/package.yml)
[![Python](https://img.shields.io/badge/Python-3.11--3.14-3776AB)](https://www.python.org/)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)

Fast, modular CAPTCHA generation for Python with **26 ready-to-use challenges**.

[Documentation](https://github.com/Sepehr0Day/CaptchaGenerator/wiki) ·
[Examples](Examples/CaptchaExamples) ·
[Release 2.0.0](https://github.com/Sepehr0Day/CaptchaGenerator/releases/tag/v2.0.0)

## Install

```bash
pip install CaptchaGenerator
```

Audio support:

```bash
pip install "CaptchaGenerator[audio]"
```

## Quick Start

```python
from CaptchaGenerator import CaptchaConfig, TextCaptcha

config = CaptchaConfig(width=720, height=240, random_seed=42)

answer = TextCaptcha(config).generate(
    number_gen=6,
    values_captcha="ABCDEFGHJKLMNPQRSTUVWXYZ23456789",
    name_export="captcha",
    path_export="./output",
    fonts=[],
    colors=["navy", "darkred"],
    backgrounds=[],
    difficulty="medium",
    style="modern",
)

print(answer)
```

## Included CAPTCHAs

- **Text:** text, random text, words and missing characters
- **Logic:** math, sequences, custom questions and visual logic
- **Images:** grids, rotation, direction, upside-down objects and click points
- **Puzzles:** sliders, irregular pieces, patterns and mazes
- **Visual:** clocks, colors, shapes, odd-one-out and 3D perspective
- **Media:** animated and audio CAPTCHA

All generators are available through `CaptchaGenerator.SUPPORTED_CAPTCHAS`.

## Customization

Use `CaptchaConfig` to control dimensions, colors, fonts, output format,
quality, accessibility text, random seed and render hooks.

Visual challenges return a `ChallengeResult` containing:

- `path` - generated image
- `answer` - expected answer; keep it server-side
- `prompt` - user instruction
- `metadata` - integration data
- `accessibility_text` - accessible description

## Examples

Each CAPTCHA has standalone simple and Tkinter examples:

```text
Examples/CaptchaExamples/<CaptchaName>/
  simple.py
  interactive.py
```

## Security

Never expose answers, target coordinates or puzzle solutions to an untrusted
client. Validate responses on the server.

## License

MIT
