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 details)
Built Distribution
ficaptcha-1.0.4-py3-none-any.whl
(10.1 kB
view details)
File details
Details for the file ficaptcha-1.0.4.tar.gz
.
File metadata
- Download URL: ficaptcha-1.0.4.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b0246b29f1cd7363f3e9ac0d0117c920fd1152939e3ff2f777882db829326d5 |
|
MD5 | 68b5107b5cc64c1795d41ae7a10df174 |
|
BLAKE2b-256 | bdbc9b0154e58f6c519f2d425aaf2604b0849cfcd1c71131db4f25e29aa56d72 |
File details
Details for the file ficaptcha-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: ficaptcha-1.0.4-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ce8c78a7f538ccd31e298dc4d31e7fe13a3091a898b6633a9004134e01724ad |
|
MD5 | c8743f4f8759054dcbf4cf9371208757 |
|
BLAKE2b-256 | 229085341d49059b771560a5faeb66135e6bb460b791503c744b70e7bd638d0f |