Highly customizable captcha generator, written in python
Project description
FireCaptcha
Python random captcha package, which is very customizable
Instalation
- FireCaptcha uses Pillow to generate images, on linux distros you have to install Pillow dependencies alone
sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
- then / 1st step on windows
pip install FireCaptcha
Usage
from FireCaptcha import Captcha
#initialize captcha instance, specify captcha parameters
p = Captcha(width=600,
height=200,
char_number=5,
char_color='#13cdc7',
char_type=3,
bg_color='#000',
gradient_color='#13c',
misleading_lines=3,
misleading_dots=20,
misleading_color='#444444')
#generate captcha, no parameters needed
captcha = p.Generate()
#assign image and answer to separate variable
image = captcha.image
answer = captcha.answer
#saves image to file
image.save('images/test.png')
#prints answer to the captcha
print(answer)
Parameters
width: int - width of captcha in px
height: int - height of captcha in px
char_number: int - how many characters should be on captcha
char_color: str - color of characters in hex (with #) e.g: #ff0000
char_type: int<1,4> - type of characters:
1 - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
2 - 'ABCDEFGHIJKLMNOPQRSTUVWXY'
3 - 'abcdefghijklmnopqrstuvwxyz'
4 - '0123456789'
bg_color: str - color of background in hex (with #) e.g: #ff0000
gradient: str - color of gradient in hex (with #) e.g: #ff0000 (this color on top, bg_color on botton)
(if not specified no gradient)
misleading_lines: int - amount of misleading lines
misleading_dots: int - amount of misleading dots/circles
misleading_color: str - color of misleading components in hex (with #) e.g: #ff0000
Examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
FireCaptcha-0.0.2.1.tar.gz
(32.1 kB
view details)
Built Distribution
File details
Details for the file FireCaptcha-0.0.2.1.tar.gz
.
File metadata
- Download URL: FireCaptcha-0.0.2.1.tar.gz
- Upload date:
- Size: 32.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e48a0c5f3555cddcb44ea2d4503ee98a16398a66a592428fc0fbea17d4583535 |
|
MD5 | a6300591d15ee8cf676d507b029d5ec0 |
|
BLAKE2b-256 | 767c0200b660d864947303c1e7409ee0dddd3d2b84055672f42bd557dc561412 |
File details
Details for the file FireCaptcha-0.0.2.1-py3-none-any.whl
.
File metadata
- Download URL: FireCaptcha-0.0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c9ccd44560432394c5e3ee37ba1bd579c16dce0811336d4d6492969010fb3e4 |
|
MD5 | 1c0e1e0cdcc9c4184bfd8d19ba430b73 |
|
BLAKE2b-256 | d3f7ad2487acbf8d4041ae7f9988538c7e9680dbc273e94b9a3e6348185a8c6a |