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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqt_hcaptcha-1.1.0.tar.gz
  • Upload date:
  • Size: 10.8 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.1.0.tar.gz
Algorithm Hash digest
SHA256 b73888e0d3ba74e190c8732e34050584beeb27ae9b58cbdcfa0729f783eaa41e
MD5 0dc0d95d0becb9b45c21d6a2fbc65e2d
BLAKE2b-256 e7b264dd389f3209800b38f47a4681e5672b0aa2fad8dcf43614a3638a631088

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqt_hcaptcha-1.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyqt_hcaptcha-1.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd39ee45bc308703464ba73e8d316492b4870f1a5e288eb2e840e356e67dc37a
MD5 0af3eb79e52ec33ee47843af0b696da5
BLAKE2b-256 37d86ef15029f335fc238ccb7822d6c75cabb60cf9ed6738bcc7675c16d05e95

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqt_hcaptcha-1.1.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