A captcha library that generates audio and image CAPTCHAs.
Project description
A captcha library that generates audio and image CAPTCHAs.
Features
Audio CAPTCHAs DEMO
Image CAPTCHAs
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
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6b28a120de0a37c44415e70225978e36b2645940133f2474c7a109b2d4683e2 |
|
MD5 | 31543642970510d92c34ecf2c74f3ee9 |
|
BLAKE2b-256 | 83c6c808f4970010b16a8656ead0b4b80268ef2765e3fc25509cf162447c3e2e |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1671f194da3b535fc12f6b0eb349195c7b28a6641381b2c07e31d04aa92fb6fc |
|
MD5 | fa86b74b15181e4c9ac92c0c2ab87df3 |
|
BLAKE2b-256 | 90fed4ddf1e6576073b5eaea76e9b2afa022c626212a30c871968480be3ccb7b |