Skip to main content

fast_captcha

fast to use captcha

Install

pip install fast-captcha

Text Captcha

from fast_captcha import text_captcha

print(text_captcha())  # BnZU

Image Captcha

from fast_captcha import img_captcha

img, text = img_captcha()

print(img)  # <_io.BytesIO object at 0x000002366AB93DB0>
print(text)  # 2z22

FastAPI

from fastapi import FastAPI
from fastapi.responses import StreamingResponse

from fast_captcha import img_captcha

app = FastAPI()


@app.get('/captcha', summary='captcha', name='captcha')
def get_captcha():
    img, text = img_captcha()
    return StreamingResponse(content=img, media_type='image/jpeg')

Django-Ninja

from ninja import NinjaAPI
from django.http import StreamingHttpResponse

from fast_captcha import img_captcha

app = NinjaAPI()


@app.get('/captcha', summary='captcha', url_name='captcha')
def get_captcha(request):
    img, text = img_captcha()
    return StreamingHttpResponse(streaming_content=img, content_type='image/jpeg')

Metadata

Release files for fast_captcha 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fast_captcha 0.3.2
File Size Uploaded
fast_captcha-0.3.2.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for fast_captcha 0.3.2
File Interpreter ABI Platform
fast_captcha-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.4 MB

Release files / fast_captcha-0.3.2.tar.gz

Download URL fast_captcha-0.3.2.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
b68437b01726e5c698e5b0e4784a7a495d5e98a0b77ddff873925057fd67d517
BLAKE2b-256 checksum
How to use checksums
74864751bffdd88e7ac0633a98668f3d474935996c1477b058025cc9f39aa6d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.15.3 CPython/3.10.11 Windows/10

Release files / fast_captcha-0.3.2-py3-none-any.whl

Download URL fast_captcha-0.3.2-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e3823ca0e53baa5cf57d0eb103e8353d2480c5cffda8d7aedcfb39e22844ac15
BLAKE2b-256 checksum
How to use checksums
26055bfd827745616034e78d99a7547f2398dcb9503eaa9b19e84fb3dc9e87ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.15.3 CPython/3.10.11 Windows/10

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page