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.2.0.tar.gz (10.9 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.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqt_hcaptcha-1.2.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyqt_hcaptcha-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8cb7d37a1edeab302256693aff19dcafffbbfcb27c89b01bc11cbb8c9c0e6a8e
MD5 231e8ff35e212848533bea60afd24b64
BLAKE2b-256 df86de6f0e315c235c1e863883dc889bfd112380f1fdf2cba73da823825f6302

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqt_hcaptcha-1.2.0.tar.gz:

Publisher: publish.yml on dolfies/pyqt-hcaptcha

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pyqt_hcaptcha-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyqt_hcaptcha-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5573ba47417f44d95cff622702bd3ce95535bc48e57655bebf4c235a84b405d4
MD5 8aa4d62f18de99b8543040ba66bdabfa
BLAKE2b-256 a1598387a2e82ce29385d74f727a2457dedcf6f3214a7281ce0f61e4849cd4f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqt_hcaptcha-1.2.0-py3-none-any.whl:

Publisher: publish.yml on dolfies/pyqt-hcaptcha

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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