Metadata-Version: 2.1
Name: aiohcaptcha
Version: 0.1.0
Summary: AsyncIO client for the hCaptcha service.
Home-page: https://gitlab.com/mastizada/aiohcaptcha
License: MIT
Keywords: hcaptcha,captcha
Author: Emin Mastizada
Author-email: emin@linux.com
Requires-Python: >=3.6,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
Classifier: Framework :: AsyncIO
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Dist: aiohttp (>=3.7.3,<4.0.0)
Project-URL: Repository, https://gitlab.com/mastizada/aiohcaptcha
Description-Content-Type: text/markdown

# aiohcaptcha

AsyncIO client for the hCaptcha service

Secure your forms using a captcha.

---

## Install
    pip install aiohcaptcha
## Usage
### Configuration
You can define the secret key `HCAPTCHA_SECRET_KEY` in the environment or directly pass it to the `HCaptchaClient` model as a parameter.

Get the secret and public keys from the [hcaptcha.com](https://hcaptcha.com).
### Template
    <div class="h-captcha" data-sitekey="your_site_key"></div>
    <script src="https://hcaptcha.com/1/api.js" async defer></script>

Check [hCaptcha docs](https://docs.hcaptcha.com/) for more details on the HTML widget.
### View
    response_token = request.POST["h-captcha-response"]
    client = HCaptchaClient(secret_key)
    verified = await client.verify(response_token)  # a boolean

### Response details

Response details are stored in `client.response`,
details of the `HCaptchaResponse` model is same as the JSON response provided in the hCaptcha documentation.

### Extra arguments

You can also add `remote_ip` and `sitekey` (expected key) to the `client.verify` function.
These parameters are explain the the [hCaptcha docs](https://docs.hcaptcha.com/).

---

&copy; 2020 Emin Mastizada. MIT Licenced.

