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 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file capcha-3.3.tar.gz.
File metadata
- Download URL: capcha-3.3.tar.gz
- Upload date:
- Size: 166.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b089c01ecbf0da16fdebb91fcaf36dc06007a09c7eaffc065c7e0c936fb319f4
|
|
| MD5 |
315f56270097ea2d5b89cb8ea0637ab7
|
|
| BLAKE2b-256 |
bc7f1011d3a6965fc4f0b2e630fbdaa638edd2960f4a1862eb67d076a74dbd09
|
File details
Details for the file capcha-3.3-py3-none-any.whl.
File metadata
- Download URL: capcha-3.3-py3-none-any.whl
- Upload date:
- Size: 162.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43b2da9530dd8a2c4377a0c163a313eef9abe18e9aee83c602bb6fc8e5cd00e7
|
|
| MD5 |
22f7f70e3ec9cab7743e0d0d7cb707d5
|
|
| BLAKE2b-256 |
d93f135436aa7be2d356f81346b7d6ac6e165d6c2df15586b776d451d5d0d142
|