Simple captcha
Project description
fiCaptcha
Module for image-captcha generation
Install
Build from source
git clone https://github.com/0x7o/fiCaptcha
cd fiCaptcha
pip install .
Python pip install
pip install ficaptcha
Usage
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 pixelsimage_dir="images"
- Image folder for captchabackground_color="white"
- Background Colornoise_bg=True
- Whether or not to add noise to the backgroundnoise_im=True
- Whether or not to add noise to the imagesrotate_im=True
- Rotate images or notcount_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()
print(result)
{'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)
Built Distribution
ficaptcha-1.0.4-py3-none-any.whl
(10.1 kB
view hashes)
Close
Hashes for ficaptcha-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ce8c78a7f538ccd31e298dc4d31e7fe13a3091a898b6633a9004134e01724ad |
|
MD5 | c8743f4f8759054dcbf4cf9371208757 |
|
BLAKE2b-256 | 229085341d49059b771560a5faeb66135e6bb460b791503c744b70e7bd638d0f |