Skip to main content

Modern hCaptcha SDK for PyQt applications

Project description

PyQtHCaptcha

PyQtHCaptcha is a Python library that provides a native hCaptcha widget for desktop applications using PyQt6.

PyQtHCaptcha Demo

Features

  • Supports all configuration parameters of the native mobile SDK, including enterprise features like rqdata and custom endpoints
  • Supports passive mode captchas with invisibles challenges
  • Fully typed with modern Python type hints
  • Works with qasync for seamless integration into async applications

Installation

pip install pyqt-hcaptcha

Usage

Injecting a hCaptcha widget into your PyQt application is straightforward. Below is a minimal example demonstrating how to set up the widget and connect to its signals:

from PyQtHCaptcha import HCaptchaConfig, HCaptchaError, HCaptchaWebView

# Define your callbacks
def on_loaded():
    print("hCaptcha widget loaded successfully")

def on_success(token: str):
    print(f"Solution received: {token[:40]}...")

def on_failure(error: HCaptchaError):
    print(f"hCaptcha Error: {error.name}")

def on_expired():
    print("hCaptcha token expired")

# Create a configuration for the hCaptcha widget
config = HCaptchaConfig(
    sitekey="10000000-ffff-ffff-ffff-000000000001",
    url="https://accounts.hcaptcha.com/demo",
    theme="dark",
)

# Initialize the hCaptcha widget with the configuration
view = HCaptchaWebView(config)

# Connect signals to your callbacks
view.onLoaded.connect(on_loaded)
view.onSuccess.connect(on_success)
view.onFailure.connect(on_failure)
view.onExpired.connect(on_expired)

# Show the widget
view.setWindowTitle("hCaptcha Example")
view.resize(400, 600)
view.show()

See the examples/ directory for more complete examples.

Documentation

The documentation is available here.

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

pyqt_hcaptcha-1.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

pyqt_hcaptcha-1.0.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pyqt_hcaptcha-1.0.0.tar.gz.

File metadata

  • Download URL: pyqt_hcaptcha-1.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pyqt_hcaptcha-1.0.0.tar.gz
Algorithm Hash digest
SHA256 86b2be45f55b57a4f85e0ccf0049b9b970f7c193a66d221edfc374f4f957a479
MD5 b8784918cf572496c59fe0526e14c7e3
BLAKE2b-256 89f20fd9e14a315af63db9baa7069e07880f7d24d16f6272e7308ae05ab1abed

See more details on using hashes here.

File details

Details for the file pyqt_hcaptcha-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyqt_hcaptcha-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pyqt_hcaptcha-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8431493e2c0e40b2e187135380255bea4ed163134f0ffe288826d96f1f78f405
MD5 83378832e43c8b952f3745d918fe1335
BLAKE2b-256 2d735305deaa2cc749070e4d8126d14669f014d724738348430bf52e28223bd9

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