Skip to main content

captcha-solver

OCR-based Python library to solve two common image CAPTCHA styles. Ready for PyPI.

Requires Tesseract OCR installed on your system (not only the pytesseract pip package).


CAPTCHA types this library solves

1. Image CAPTCHA — solveImageCaptcha

Clear character row (e.g. 6 characters).

Noisy CAPTCHA example

2. Noisy CAPTCHA — solveImageNoiseCaptcha

Heavy background noise, diagonal lines, and speckles. Use when the text is obscured but still readable. Uses segmentation + per-character OCR. Returns one result or 25 candidate results to try until the form accepts one.

Grid CAPTCHA example


Install

pip install captcha-solver

System dependency: Install Tesseract OCR.

Platform Command
Ubuntu/Debian sudo apt-get install tesseract-ocr
macOS brew install tesseract
Windows Tesseract at UB Mannheim — then set TESSERACT_CMD to the executable path if needed.

Usage

Class-based API

from captcha_solver import CaptchaSolver

solver = CaptchaSolver()

# Image CAPTCHA → one result
text = solver.solveImageCaptcha("path/to/Image.png")

# Noise CAPTCHA → one result (optional: num_chars, uppercase)
text = solver.solveImageNoiseCaptcha("path/to/noisy_captcha.png")

# Grid CAPTCHA → 25 candidate results (try each until form accepts)
results = solver.solve_grid_five_results("path/to/grid_captcha.png")
for i, r in enumerate(results, 1):
    print(f"{i}: {r}")

Optional: Tesseract path (e.g. Windows)

import os
os.environ["TESSERACT_CMD"] = r"C:\Program Files\Tesseract-OCR\tesseract.exe"

from captcha_solver import CaptchaSolver
solver = CaptchaSolver()
# ... use as above

Grid solver options

Parameter Type Default Description
num_chars int | None 5 Expected number of characters; result is trimmed/padded to this length.
uppercase bool True If True, return uppercase; if False, return lowercase.


Development

git clone https://github.com/Rahulkatoch99/CaptchaSolver
cd captcha-solver
pip install -e ".[dev]"

License

MIT.

Metadata

Release files for captcha-vision-engine 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for captcha-vision-engine 0.1.2
File Size Uploaded Provenance Actions
captcha_vision_engine-0.1.2.tar.gz 13.7 kB Without provenance Details for captcha_vision_engine-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for captcha-vision-engine 0.1.2
File Interpreter ABI Platform Actions
captcha_vision_engine-0.1.2-py3-none-any.whl Python 3 none any Details for captcha_vision_engine-0.1.2-py3-none-any.whl

Total release size: 27.8 kB

Release files / captcha_vision_engine-0.1.2.tar.gz

Download URL captcha_vision_engine-0.1.2.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
11bf539d353ea77018a1266da261af4830e4cf5396c31add964f313d93dc63a6
BLAKE2b-256 checksum
How to use checksums
33c4b1495448625c5bf695cbc7ef0c10b5ef16d43608e8d3e6faeed41b5ae00f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / captcha_vision_engine-0.1.2-py3-none-any.whl

Download URL captcha_vision_engine-0.1.2-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54ccc84143eba3da8efa2a93353966526cf06a33c2ad24a2a2ff868047b23d29
BLAKE2b-256 checksum
How to use checksums
521817746b6c255e0dbe7c5ff2ba0f586a95e0a99cba7a5ad61ee37d42d18f5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for captcha-vision-engine 0.1.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page