Skip to main content

Simple Captcha

Project description

NCaptcha-python

파이썬용 NCaptcha 입니다.

NCaptcha는 간단한 캡챠를 구현한 라이브러리 입니다.
몇줄 안되는 코드로 간단하게 구현할 수 있습니다.
간단한 라이브러리이기 때문에 보안이 중요한 곳에서는 사용하지 마세요.


사용할 수 있는 캡챠는

  • 영어(소) [ENGLISH_LOWER]
  • 영어(대) [ENGLISH_UPPER]
  • 영어(소, 대) [ENGLISH_ALL]
  • 숫자 [DIGITS]
  • 숫자+영어(소) [DIGITS_ENGLISH_LOWER]
  • 숫자+영어(대) [DIGITS_ENGLISH_UPPER]
  • 숫자+영어(소, 대) [DIGITS_ENGLISH_ALL]
  • 특수문자 [SYMBOLS]
  • 특수문자+영어(소) [SYMBOLS_ENGLISH_LOWER]
  • 특수문자+영어(대) [SYMBOLS_ENGLISH_UPPER]
  • 특수문자+영어(소, 대) [SYMBOLS_ENGLISH_ALL]
  • 특수문자+숫자 [SYMBOLS_DIGITS]
  • 특수문자+영어(소)+숫자 [SYMBOLS_ENGLISH_LOWER_DIGITS]
  • 특수문자+영어(대)+숫자 [SYMBOLS_ENGLISH_UPPER_DIGITS]
  • 특수문자+영어(소, 대)+숫자 [SYMBOLS_ENGLISH_ALL_DIGITS]

설치

pip install NCaptcha-python

사용방법

import NCaptcha

captcha = NCaptcha.TextCaptcha(length=6, characters=NCaptcha.CaptchaOptions.ENGLISH_ALL, expires_in_seconds=30)

# 캡챠 생성
captcha_text = captcha.generate()

print(f"\n생성된 캡챠: {captcha_text}")
print(f"만료 시간: {captcha.expiration_time.strftime('%Y-%m-%d %H:%M:%S')}")

# 사용자 입력 받기
user_input = input("캡챠를 입력하세요: ")

result = captcha.validate(user_input)

# 입력 검증
if result == NCaptcha.CaptchaResult.SUCCESS:
        ("\n성공! 캡챠 입력이 일치합니다.")
elif result == NCaptcha.CaptchaResult.EXPIRED:
    print("\n실패! 유효시간이 만료되었습니다.")
elif result == NCaptcha.CaptchaResult.MISMATCH:
    print("\n실패! 캡챠 입력이 일치하지 않습니다.")

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

ncaptcha_python-0.0.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ncaptcha_python-0.0.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file ncaptcha_python-0.0.2.tar.gz.

File metadata

  • Download URL: ncaptcha_python-0.0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for ncaptcha_python-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5d087b263e4392af9e0c2f6ee6512bc1b44beb8f2ea3130145b73d0cf9593689
MD5 8507cf9efc7bddbfa2bfdb0f44ee20b5
BLAKE2b-256 c4c450196f91b9f0c831dc89dd6cfd85af2962c9f05f79f5b756e248b988f8c7

See more details on using hashes here.

File details

Details for the file ncaptcha_python-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ncaptcha_python-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 06a481f3b8efc5171ad3cc0f1e0b35dacc08fc57aaf79c01063e8c428c22fb91
MD5 759dc3492bbb149d586c6002d70cea90
BLAKE2b-256 4ddec961c25974c9c717a52843d0bbc02aab8635e5a51de080e3ac065dc45c4e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page