wheezy.captcha

Introduction

wheezy.captcha is a python package written in pure Python code. It is a lightweight captcha library that provides integration with (one of below must be installed):

  • PIL - Python Imaging Library 1.1.7.
  • Pillow - Python Imaging Library (fork).

It is optimized for performance, well tested and documented.

Resources:

Contents

Getting Started

Install

wheezy.captcha requires python version 3.6+. It is operating system independent. You can install it from the pypi site (you need to specify an extra requirements per the imaging library of your choice):

$ pip install wheezy.captcha
$ pip install wheezy.captcha[PIL]
$ pip install wheezy.captcha[Pillow]

Examples

Before we proceed let’s setup a virtualenv environment, activate it and install:

$ pip install wheezy.captcha

User Guide

wheezy.captcha

Modules

wheezy.captcha

wheezy.captcha.bezier

wheezy.captcha.bezier.make_bezier(n)[source]

Bezier curves: http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Generalization

wheezy.captcha.bezier.pascal_row(n)[source]

Returns n-th row of Pascal’s triangle

wheezy.captcha.http

wheezy.captcha.image

wheezy.captcha.image.background(color='#EEEECC')[source]
wheezy.captcha.image.captcha(drawings, width=200, height=75)[source]
wheezy.captcha.image.curve(color='#5C87B2', width=4, number=6)[source]
wheezy.captcha.image.noise(number=50, color='#EEEECC', level=2)[source]
wheezy.captcha.image.offset(dx_factor=0.1, dy_factor=0.2)[source]
wheezy.captcha.image.rotate(angle=25)[source]
wheezy.captcha.image.smooth()[source]
wheezy.captcha.image.text(fonts, font_sizes=None, drawings=None, color='#5C87B2', squeeze_factor=0.8)[source]
wheezy.captcha.image.warp(dx_factor=0.27, dy_factor=0.21)[source]

wheezy.captcha.mixin