TextCaptcha
A Python library for using text-based CAPTCHAs from http://textcaptcha.com/.
This is a simple wrapper around the TextCaptcha API which is a service which provides text-based CAPTCHA questions which helps to prevent spam from robots.
This is designed to be implemented into a server-side application such as a Discord Bot, IRC, SMS, etc...
Note: The TextCaptcha API is only suitable for low traffic websites. For more than 5 requests per second, your usage will be rate limited.
Installation
Use pip to install on all systems:
pip install textcaptcha
Usage Example
This example will ask a CAPTCHA question and ask for an answer which is then checked against the actual answer.
import textcaptcha
# Create a captcha fetcher to fetch captcha questions from the API
fetcher = textcaptcha.CaptchaFetcher()
# Fetch a new captcha from the API
captcha = fetcher.fetch()
# Print the captcha question to the console
print(captcha.question)
# Get a response from the user
answer = input("Answer: ")
# Check that the answer is correct
if captcha.check_answer(answer):
print("You're not a robot!")
else:
print("You are a robot, sorry!")
Development Setup
This project uses Poetry to manage dependencies and packaging. Here are the installation instructions for Poetry.
Contributing
- Fork it (https://github.com/jake-walker/pytextcaptcha/fork)
- Create your feature branch (
git checkout -b feature/foobar) - Commit your changes (
git commit -am "Add some foobar") - Push to the branch (
git push origin feature/foobar) - Create a new pull request
Metadata
Release files for textcaptcha 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| textcaptcha-0.2.0.tar.gz | 15.6 kB | Without provenance | Details for textcaptcha-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| textcaptcha-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for textcaptcha-0.2.0-py3-none-any.whl |
Total release size: 31.9 kB
Release files / textcaptcha-0.2.0.tar.gz
| Download URL | textcaptcha-0.2.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d15b0c25c30764fbe7db6cafa5954a221061bec84ddefca5d3fe56e16bdf1b4
|
|
BLAKE2b-256 checksum How to use checksums |
656bfe18c6c4f6c007d0b29fd9ef2c53aa1ccf048cc95fa37f8998f7b42ec4d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.5 Linux/4.15.0-88-generic
|
Release files / textcaptcha-0.2.0-py3-none-any.whl
| Download URL | textcaptcha-0.2.0-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56f4fa78f172310926fe86f0b3929b572d3a6b4dc2ffaf9c53690809784709eb
|
|
BLAKE2b-256 checksum How to use checksums |
75a4d6ae39aefb0e2edc91b405da5c29d5498edb889e9c6aaa45af26e0838733
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.5 Linux/4.15.0-88-generic
|
Security for textcaptcha 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.