Giter Site home page Giter Site logo

azcaptchaapi's Introduction

AZCaptcha.com Python API

This library implements a simple to use wrapper around the AZCaptcha.com API.

Installation

From PyPi

pip install azcaptchaapi

From source

git clone https://github.com/azcaptcha/azcaptchaapi.git
cd azcaptchaapi
python setup.py install

Examples

Initializing the API

from azcaptcha import AZCaptchaApi
api = AZCaptchaApi('<API KEY>')

Solving a captcha blocking

with open('/my/captcha/path.png', 'rb') as captcha_file:
    captcha = api.solve(captcha_file)

print(captcha.await_result())

Waits until the captcha is either solved or an error occurred (indicated through an exception).

Solve captcha "non-blocking"

captcha = api.solve(captcha_file)
print(captcha.try_get_result())

If already available, prints the captcha text, else None. Please note that while this code doesn't repeatedly ask the API if the captcha was solved, the HTTP request is still sent synchronously, so this method isn't really non-blocking.

Reporting a bad captcha

result = captcha.await_result()
if use_captcha_code(result) == 'failed':
    captcha.report_bad()

Query account balance

print(api.get_balance())

Compatibilty

This library was successfully tested on Python 2.7 and 3.5. Python versions < 2.7 are not officially supported.

License

This code is released under MIT license. Dependencies are under their respective licenses.

This project is not affiliated with, maintained, authorized, endorsed or sponsored by AZCaptcha.com or any of its affiliates.

azcaptchaapi's People

Contributors

azcaptcha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.