Skip to main content

A lightweight utility to automatically detect which Qt Python binding is available in your environment.

Project description

detect-qt-binding

A lightweight utility to automatically detect which Qt Python binding is available in your environment.

Features

  • Detects installed Qt bindings (PyQt6, PySide6, PyQt5, PySide2, PyQt4, PySide)
  • Checks both already imported modules and attempts to import available bindings
  • Returns a typed QtBindings enum value or None if no binding is found

Installation

pip install detect-qt-binding

Usage

from detect_qt_binding import detect_qt_binding, QtBindings

binding = detect_qt_binding()

if binding is None:
    print("No Qt binding found")
elif binding == QtBindings.PyQt6:
    print("PyQt6 detected")
# ... handle other cases

API Reference

detect_qt_binding() -> Optional[QtBindings]

Attempts to detect which Qt binding is available by:

  1. Checking already imported modules
  2. Attempting to import each known Qt binding

Returns:

  • A QtBindings enum member if a binding is found
  • None if no Qt binding is available

QtBindings Enum

Available values:

  • PyQt6
  • PySide6
  • PyQt5
  • PySide2
  • PyQt4
  • PySide

License

MIT License - Based on code from pyqtgraph (also MIT licensed)

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

detect_qt_binding-0.1.0a0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

detect_qt_binding-0.1.0a0-py2.py3-none-any.whl (3.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file detect_qt_binding-0.1.0a0.tar.gz.

File metadata

  • Download URL: detect_qt_binding-0.1.0a0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for detect_qt_binding-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 2538bd30011a476579c6fd5a6cf5cb3719980e7ea68c79faf21e936f942fe078
MD5 db162b3ee09a22082e3c3ac0887f2f23
BLAKE2b-256 a17277498f91046aab18ada996963107ca5cefa4653e91ecee31d67a7db82df6

See more details on using hashes here.

File details

Details for the file detect_qt_binding-0.1.0a0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for detect_qt_binding-0.1.0a0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a8b806e98edc9d1821040ca7df7c2739feffd0f809c67920df4cd4576b3423b5
MD5 821c1ca397d6b61ab0f9bb05b11c5b43
BLAKE2b-256 cc0d61a4ae237cb825dbc97470c5416e8591666e60f8eadab7033228dffb7e9a

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