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 details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Egg

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

Uploaded Python 3

File details

Details for the file x-captcha-0.4.200808.tar.gz.

File metadata

  • Download URL: x-captcha-0.4.200808.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for x-captcha-0.4.200808.tar.gz
Algorithm Hash digest
SHA256 ce807f3506f9347aeda539c1b36401c121ddb4e42511b5bf071e1893184d9552
MD5 8aac626ccbf89f2bf14a188d0a4d4fe7
BLAKE2b-256 6ff08170052d76e412c8d29bd08fe44946bef128b391b1e9604283d3e7223c28

See more details on using hashes here.

File details

Details for the file x_captcha-0.4.200808-py3.7.egg.

File metadata

  • Download URL: x_captcha-0.4.200808-py3.7.egg
  • Upload date:
  • Size: 5.8 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for x_captcha-0.4.200808-py3.7.egg
Algorithm Hash digest
SHA256 208f720fca6ea6d2335a6cf85ce35cd69429bea0df909b5118bfdb4140bf7713
MD5 c8f113703998f50fab39bbcdac212798
BLAKE2b-256 3ac8c5bc721098b2aef39c3f494bf79ac70a87217f096fa7ae76c2408a4b1d81

See more details on using hashes here.

File details

Details for the file x_captcha-0.4.200808-py3-none-any.whl.

File metadata

  • Download URL: x_captcha-0.4.200808-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for x_captcha-0.4.200808-py3-none-any.whl
Algorithm Hash digest
SHA256 8175b9330a8c3c1b7bf51ac19f46906041102d803c291aab863c47e85e75e3ce
MD5 32117351763d98642f0dd6e6c387ec36
BLAKE2b-256 54a33e1b69d28e636b255fadf4533586ba7a99222c9ea1b766ad0be51bff86e6

See more details on using hashes here.

Supported by

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