Skip to main content

multicolorcaptcha

Python random image-captcha generator library.

Installation

To generate the images of the Captchas, the library uses Pillow module.

  • For Linux systems, it is necessary to install Pillow prerequisites (also, Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL):
sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
  • Install the module
pip3 install multicolorcaptcha

API Usage

from multicolorcaptcha import CaptchaGenerator

# Captcha image size number (2 -> 640x360)
CAPCTHA_SIZE_NUM = 2

# Create Captcha Generator object of specified size
generator = CaptchaGenerator(CAPCTHA_SIZE_NUM)

# Generate a captcha image
captcha = generator.gen_captcha_image(difficult_level=3)
math_captcha = generator.gen_math_captcha_image(difficult_level=2)

# Get information of standard captcha
image = captcha.image
characters = captcha.characters

# Get information of math captcha
math_image = math_captcha.image
math_equation_string = math_captcha.equation_str
math_equation_result = math_captcha.equation_result

# Save the images to files
image.save("captcha.png", "png")
math_image.save("captcha.png", "png")

Generated Captchas Examples

Monocolor Background Captchas

Monocolor Captcha

Multicolor Background Captchas

Multicolor Captcha

ASCII Captchas

Multicolor Captcha

Modificable Difficult Level Captchas

Multicolor Captcha

Math Equation Captchas

Math Captcha

Metadata

Release files for multicolorcaptcha 1.2.0

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

Source distribution (sdist)

Source distribution for multicolorcaptcha 1.2.0
File Size Uploaded Provenance Actions
multicolorcaptcha-1.2.0.tar.gz 10.4 MB Without provenance Details for multicolorcaptcha-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for multicolorcaptcha 1.2.0
File Interpreter ABI Platform Actions
multicolorcaptcha-1.2.0-py3-none-any.whl Python 3 none any Details for multicolorcaptcha-1.2.0-py3-none-any.whl

Total release size: 20.8 MB

Release files / multicolorcaptcha-1.2.0.tar.gz

Download URL multicolorcaptcha-1.2.0.tar.gz
Size 10.4 MB
Tags Source
SHA-256 checksum
How to use checksums
85e8408944c57d5084e10f1760dab72118fe9786614007d4204101d5091a12d9
BLAKE2b-256 checksum
How to use checksums
2e977b47adde8e6074b6020454dea3f44b9ad21e4d2a3272de7fb4e431089257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release files / multicolorcaptcha-1.2.0-py3-none-any.whl

Download URL multicolorcaptcha-1.2.0-py3-none-any.whl
Size 10.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
aa6cc16078de4caadfd7eea8bdf705c0cd7635aa8ca2329c6490b9461679bc7a
BLAKE2b-256 checksum
How to use checksums
4851d9ad5bb55773002eb073f1267c3af23d6a874ebb7c7c9bf29720829224a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Security for multicolorcaptcha 1.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.

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