Skip to main content

No project description provided

Project description

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 your-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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

capcha-1.6.tar.gz (35.3 kB view hashes)

Uploaded Source

Built Distribution

capcha-1.6-py3-none-any.whl (37.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page