GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lepture/captcha: A captcha library that generates audio and image CAPTCHAs.

BranchesTags
Open more actions menu

Latest commit

 

History

121 Commits
121 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
src/captcha
src/captcha
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
README.rst
README.rst
 
 
pyproject.toml
pyproject.toml
 
 
requirements-dev.lock
requirements-dev.lock
 
 
setup.py
setup.py
 
 

Repository files navigation

Captcha

A captcha library that generates audio and image CAPTCHAs.

GitHub Sponsor Build Status codecov

Install

Install captcha with pip:

pip install captcha

Features

  1. Audio CAPTCHAs
  2. Image CAPTCHAs

Usage

Audio and Image CAPTCHAs are in separated 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.

Use Custom Colors

In order to change colors you have to specify your desired color as a tuple of Red, Green and Blue value. Example:- (255, 255, 0) for yellow color, (255, 0, 0)` for red color.

from captcha.image import ImageCaptcha

image = ImageCaptcha(fonts=['/path/A.ttf', '/path/B.ttf'])

data = image.generate('1234')
image.write('1234', 'out.png', bg_color=(255, 255, 0), fg_color=(255, 0, 0)) # red text in yellow background

Useful Links

  1. GitHub: https://github.com/lepture/captcha
  2. Docs: https://captcha.lepture.com/

Demo

Here are some demo results:

Image Captcha

Audio Captcha

About

A captcha library that generates audio and image CAPTCHAs.

captcha.lepture.com/

Topics

captcha

Resources

Readme
BSD-3-Clause license
Activity

Stars

1.1k stars

Watchers

23 watching

Forks

189 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.