keptcha is an API wrapper for https://captcha-api.akshit.me written in Python.
Project description
Keptcha py
keptcha
is an API wrapper (python) for captcha-api. Provides both Synchronous and Asynchronous interfaces to interact with the API.
Installation
pip install keptcha
The project is not yet released on pypi so above would not work, proceed with git installation.
OR using git
pip install git+https://github.com/captcha-api/keptcha-py
Usage
keptcha
supports both Sync and Async usage.
Sync
from keptcha import Captcha
my_captcha = Captcha.new()
my_captcha.decode()
if my_captcha.verify("1337H4kOr"):
print("You are not a bot!")
Async
from keptcha import AsyncCaptcha
my_captcha = await AsyncCaptcha.new()
await my_captcha.decode()
if (await my_captcha.verify("1337H4kOr")):
print("You are not a bot!")
Configuration
You can pass some keyword arguments to personalize your captcha.
my_captcha = Captcha.new(height=100, width=250, circles=100, length=5)
How to handle bad input?
You can do exception handling.
from keptcha.errors import IncorrectCaptcha
try:
my_captcha.verify("bad input")
except IncorrectCaptcha:
print("sir you suck")
Contributing
Feel free to submit a pull request. We very much appreciate it!
License
Licenced under MIT.
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 keptcha-0.1.1.tar.gz
.
File metadata
- Download URL: keptcha-0.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6f46422c2a0a671d102169e4418945b90ff6f826af7ec6f1aff9f9a66a8fe03 |
|
MD5 | 1caea66a23ec811238273a1a501a7dee |
|
BLAKE2b-256 | 0cac31c2cf28ef582e8f6b46550f65bec5e8006e45160f953a3f6a41ba730198 |
File details
Details for the file keptcha-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: keptcha-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5a52b83ff73fe2dabe9c599a654a320c8bd425593cc5691484ee1755e10df97 |
|
MD5 | b05b5366daabc7548f3e70c39cb80d6d |
|
BLAKE2b-256 | 46a63689baaba5d1747c8fcdca6a42027acf5f3791f0a3e7746a4e077f8a9e2b |