https://github.com/0x7o/ficaptcha
Module for image-captcha generation
https://github.com/0x7o/ficaptcha
captcha captcha-generator web
Last synced: 3 months ago
JSON representation
Module for image-captcha generation
- Host: GitHub
- URL: https://github.com/0x7o/ficaptcha
- Owner: 0x7o
- License: apache-2.0
- Created: 2022-04-12T10:28:50.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-20T11:14:39.000Z (about 3 years ago)
- Last Synced: 2025-02-19T06:19:49.094Z (4 months ago)
- Topics: captcha, captcha-generator, web
- Language: Python
- Homepage:
- Size: 218 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fiCaptcha
Module for image-captcha generation## Install
Build from source
```bash
git clone https://github.com/0x7o/fiCaptcha
cd fiCaptcha
pip install .
```Python pip install
```bash
pip install ficaptcha
```
## Usage
# Image Captcha
Create a folder with images for captcha:
```bash
├── 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
```python
from ficaptcha.image import Captchac = Captcha(size=(256, 256), image_dir="images", rotate_im=False)
```
Let's generate our captcha
```python
result = c.generate()
print(result)
```
```bash
{'class': 'toy', 'file': 'images/toy/toy5.png', 'position': (17, 139)}
```