Antigate

Wrapper for online service which provides real-time captcha-to-text decodings.

Contents

Installation

Recommended way to install is via pip:

pip install antigate

Compatibility

  • Python: 2.6, 2.7, 3.3, 3.4

Usage

High-level API usage

High-level API allows to parse captcha by one line of code:

from antigate import AntiGate
print AntiGate('API-KEY', 'captcha.jpg')

Send abuse

If captcha is not valid, you can send abuse:

from antigate import AntiGate

gate = AntiGate('API-KEY', 'captcha.jpg')
if str(gate) != 'qwerty':
  gate.abuse()

Get balance

Get account balance:

from antigate import AntiGate

gate = AntiGate('API-KEY')
print gate.balance()

Get statistics

Get statistics data for current account:

from antigate import AntiGate

gate = AntiGate('API-KEY')
print gate.stats()

Get system load

Before request send, you can check system loads:

from antigate import AntiGate

gate = AntiGate('API-KEY')
print gate.load()

Low-level API usage

Disable auto run and use methods manually:

from antigate import AntiGate

config = {'min_len': '3', 'max_len': '5', 'phrase': '2'}

gate = AntiGate('API-KEY', auto_run=False, send_config=config)

captcha_id1 = gate.send('captcha1.jpg')
captcha_id2 = gate.send('captcha2.jpg')

print gate.get(captcha_id1)
print gate.get(captcha_id2)

Multiple requests

Get results for multiple ids:

from antigate import AntiGate

gate = AntiGate('API-KEY', auto_run=False)

captcha_id1 = gate.send('captcha1.jpg')
captcha_id2 = gate.send('captcha2.jpg')

print gate.get_multi([captcha_id1, captcha_id2])

Contributing

If you wish to contribute, please add corresponding tests.

https://api.travis-ci.org/gotlium/antigate.png?branch=master https://coveralls.io/repos/gotlium/antigate/badge.png?branch=master

Running tests:

make test

Checking coverage (requires coverage package):

make coverage

Run tests for all python-antigate combinations

tox

Authors

Development Lead

Contributors

Contributing

You can grab latest code on development branch at Github.

Feel free to submit issues, pull requests are also welcome.

Good contributions follow simple guidelines