Validate and display captcha from Arcaptcha easily in Python. (PyPI)
The package can be installed easily by pip install arcaptcha
command.
# Import the package to the project
from arcaptcha import Arcaptcha
# Create a new instance of Captcha object
captcha = Arcaptcha.Captcha(site_key = "my_site_key", secret_key = "my_secret_key")
# Verify challenge
>>> captcha.verify(challenge_id = "example_challenge_id")
True
# Display API script tag
>>> captcha.display_tag()
"<script src='https://widget.arcaptcha.ir/1/api.js' async defer></script>"
# Display captcha HTML tag
>>> captcha.display()
"<div class='arcaptcha' data-site-key='my_site_key'></div>"