A Python package for integrating hCaptcha, a popular captcha service, into various applications for enhanced security and user verification.
Project description
hcaptcha
hcaptcha is a Python module (unofficial) that provides an easy-to-use interface for verifying hcaptcha responses using the hcaptcha verification API.
Installation
You can install hcaptcha using pip:
pip install hcaptcha
Usage
To use hcaptcha, you'll need an hcaptcha secret key for your site. You can get one by signing up for an account at hcaptcha website.
from hcaptcha.hcaptcha import HCaptchaVerifier, HCaptchaVerificationError
import asyncio
# Initialize the verifier with your hcaptcha secret key
verifier = HCaptchaVerifier(your_hcaptcha_secret_key)
# Verify an hcaptcha response
# You can use await instead of asyncio.run if you are in a async function
try:
is_valid = asyncio.run(verifier.verify(user_response_token))
if is_valid:
print("Captcha verified successfully.")
else:
print("Captcha verification failed.")
except HCaptchaVerificationError as e:
print(f"Verification failed with error: {str(e)}")
Documentation
Documentation for hcaptcha is available here
Contributing
If you find a bug or have a feature request, please open an issue on GitHub.
Licence
hcaptcha is distributed under the MIT License. See LICENSE for more information.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file hcaptcha-0.2.1.tar.gz
.
File metadata
- Download URL: hcaptcha-0.2.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.10 Linux/6.2.7-zen1-1-zen
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3536d67350d9bd3fce7bce97b80868c6dc67e44c5591af0eaa3910f93bb08f65 |
|
MD5 | 10eb6c08498ccc915700ab9e8e35e4f4 |
|
BLAKE2b-256 | 1fe503999e98a0c46652213af3af28560665a48dad069e995a8de7c19f782a60 |
File details
Details for the file hcaptcha-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: hcaptcha-0.2.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.10 Linux/6.2.7-zen1-1-zen
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08f3be3eb08a6c59289af7de32d359d869a325215f615e2495a314d39921274d |
|
MD5 | 2eda5dc4c39ce197e071ed0857454d49 |
|
BLAKE2b-256 | 87a1d0b819d685da33c4fb80a674094e99298d4d4baca979d54501b21ea3648c |