Skip to main content

A captcha library that generates audio and image CAPTCHAs.

Project description

A captcha library that generates audio and image CAPTCHAs.

Donate lepture Become a Patreon https://travis-ci.org/lepture/captcha.svg?branch=master https://ci.appveyor.com/api/projects/status/amm21f13lx4wuura?svg=true https://coveralls.io/repos/lepture/captcha/badge.svg?branch=master

Features

  1. Audio CAPTCHAs DEMO

  2. Image CAPTCHAs

https://cloud.githubusercontent.com/assets/290496/5213632/95e68768-764b-11e4-862f-d95a8f776cdd.png

Installation

Install captcha with pip:

$ pip install captcha

Usage

Audio and Image CAPTCHAs are in seprated modules:

from captcha.audio import AudioCaptcha
from captcha.image import ImageCaptcha

audio = AudioCaptcha(voicedir='/path/to/voices')
image = ImageCaptcha(fonts=['/path/A.ttf', '/path/B.ttf'])

data = audio.generate('1234')
audio.write('1234', 'out.wav')

data = image.generate('1234')
image.write('1234', 'out.png')

This is the APIs for your daily works. We do have built-in voice data and font data. But it is suggested that you use your own voice and font data.

Contribution

We need voice wav files. The voice wav file should be in 8-bit, please keep it as small as possible. Name your voice file as:

{{language}}-{{character}}-{{username}}.wav
# exmaple: zh-1-lepture.wav

TODO: we need a place to upload voice files.

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

captcha-0.3.tar.gz (101.3 kB view details)

Uploaded Source

Built Distribution

captcha-0.3-py3-none-any.whl (101.3 kB view details)

Uploaded Python 3

File details

Details for the file captcha-0.3.tar.gz.

File metadata

  • Download URL: captcha-0.3.tar.gz
  • Upload date:
  • Size: 101.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3

File hashes

Hashes for captcha-0.3.tar.gz
Algorithm Hash digest
SHA256 a6b28a120de0a37c44415e70225978e36b2645940133f2474c7a109b2d4683e2
MD5 31543642970510d92c34ecf2c74f3ee9
BLAKE2b-256 83c6c808f4970010b16a8656ead0b4b80268ef2765e3fc25509cf162447c3e2e

See more details on using hashes here.

File details

Details for the file captcha-0.3-py3-none-any.whl.

File metadata

  • Download URL: captcha-0.3-py3-none-any.whl
  • Upload date:
  • Size: 101.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3

File hashes

Hashes for captcha-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1671f194da3b535fc12f6b0eb349195c7b28a6641381b2c07e31d04aa92fb6fc
MD5 fa86b74b15181e4c9ac92c0c2ab87df3
BLAKE2b-256 90fed4ddf1e6576073b5eaea76e9b2afa022c626212a30c871968480be3ccb7b

See more details on using hashes here.

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