Skip to main content

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

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


Download files

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

Source Distribution

keptcha-0.1.2.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

keptcha-0.1.2-py3-none-any.whl (7.4 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