Metadata-Version: 2.1
Name: capcha
Version: 3.3
Author: BornTheHell
Author-email: 
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13
Description-Content-Type: text/markdown

CAPCHA Library (Python)
A Python library designed to implement CAPCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) functionality in web applications. This library is lightweight, flexible, and aims to provide a reliable solution for preventing automated bot attacks on your web forms.

Features
Easy Integration: Seamlessly integrate CAPTCHA challenges into your web forms with minimal effort.
Customization: Customize the appearance and complexity of CAPTCHAs to suit your application's needs.
Security: Generate secure and random challenges to effectively thwart automated bots.
Accessibility: Prioritize user accessibility by incorporating accessibility features into the CAPTCHA design.
Compatibility: Compatible with various Python web development frameworks.
Installation
Install the library using pip:

pip install capcha

## Usage Example

from capcha import Capcha
from flask import Flask, render_template, request

app = Flask(__name__)
captcha = Capcha()

@app.route('/')
def index():
    # Генерация CAPTCHA при загрузке страницы
    captcha_image = captcha.generate()
    return render_template('index.html', captcha_image=captcha_image)

@app.route('/submit', methods=['POST'])
def submit():
    user_entered_captcha = request.form.get('captcha')
    expected_captcha = # получите ожидаемое значение из вашего хранилища данных

    is_valid_captcha = captcha.validate(user_entered_captcha, expected_captcha)

    if is_valid_captcha:
        # Продолжить с отправкой формы
        pass
    else:
        # Вывести сообщение об ошибке пользователю
        pass
