Skip to main content

A useful verification code generation tool.

Project description

安装

pip install gvcode

例子

from gvcode import VFCode



if __name__ == '__main__':
    vc = VFCode()
    # 验证码类型
    # 自定义验证码
    # vc.generate('abcd')

    # 数字验证码(默认5位)
    # vc.generate_digit()
    # vc.generate_digit(4)

    # 字母验证码(默认5位)
    # vc.generate_alpha()
    # vc.generate_alpha(5)

    # 数字字母混合验证码(默认5位)
    # vc.generate_mix()
    # vc.generate_mix(6)

    # 数字加减验证码(默认加法)
    vc.generate_op()
    # 数字加减验证码(加法)
    # vc.generate_op('+')
    # 数字加减验证码(减法)
    # vc.generate_op('-')

    # 图片字节码
    # print(vc.get_img_bytes())
    # 图片base64编码
    print(vc.get_img_base64())
    # 保存图片
    vc.save()

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

gvcode-0.0.4.tar.gz (557.7 kB view hashes)

Uploaded Source

Built Distribution

gvcode-0.0.4-py3-none-any.whl (16.2 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