Skip to main content

A simple and powerful captcha generation library.

Project description

A simple and powerful captcha generation library.

Features

  1. Easy to use.

  2. Parameterization.

  3. Powerful.

  4. Continuous updating.

Installation

Install x-captcha with pip:

$ pip install x-captcha

Usage

Image captcha:

from xcaptcha.image import Captcha

# default
generator = Captcha()
captcha, image = generator.generate()

# parameter
size = (200, 100)
characters = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
number = 6
font = 'data/msyhbd.ttf'
generator = Captcha(size, characters, number, font)
captcha, image = generator.generate()

# config
generator = Captcha()
size = (200, 100)
characters = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
number = 6
font = 'data/msyhbd.ttf'
generator.config(size, characters, number, font)
captcha, image = generator.generate()

# save
generator = Captcha()
generator.save()
generator.save('captcha/captcha.png')

This is the APIs for your daily works.

Contribution

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

x-captcha-0.4.200808.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distributions

x_captcha-0.4.200808-py3.7.egg (5.8 kB view hashes)

Uploaded Source

x_captcha-0.4.200808-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page