A simple and powerful captcha generation library.
Project description
A simple and powerful captcha generation library.
Features
Easy to use.
Parameterization.
Powerful.
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
Release history Release notifications | RSS feed
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)
Built Distributions
Close
Hashes for x_captcha-0.4.200808-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8175b9330a8c3c1b7bf51ac19f46906041102d803c291aab863c47e85e75e3ce |
|
MD5 | 32117351763d98642f0dd6e6c387ec36 |
|
BLAKE2b-256 | 54a33e1b69d28e636b255fadf4533586ba7a99222c9ea1b766ad0be51bff86e6 |