Skip to main content

Simple captcha

Project description


Module for image-captcha generation


Build from source

git clone
cd fiCaptcha
pip install .

Python pip install

pip install ficaptcha


Image Captcha

Create a folder with images for captcha:

├── images
│   ├── toy
│       ├── toy1.png
│       ├── toy2.png
│       └── ...
│   └── fox
│       ├── fox1.png
│       ├── fox2.png
│       └── ...

Import the library and create a class

  • size=(256, 256) - Captcha size in pixels
  • image_dir="images" - Image folder for captcha
  • background_color="white" - Background Color
  • noise_bg=True - Whether or not to add noise to the background
  • noise_im=True - Whether or not to add noise to the images
  • rotate_im=True - Rotate images or not
  • count_images=5 - Number of images on the captcha
from ficaptcha.image import Captcha

c = Captcha(size=(256, 256), image_dir="images", rotate_im=False)

Let's generate our captcha

result = c.generate()
{'class': 'toy', 'file': 'images/toy/toy5.png', 'position': (17, 139)}

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

ficaptcha-1.0.4.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

ficaptcha-1.0.4-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

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