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
QtBindingsenum value orNoneif 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:
- Checking already imported modules
- Attempting to import each known Qt binding
Returns:
- A
QtBindingsenum member if a binding is found Noneif no Qt binding is available
QtBindings Enum
Available values:
PyQt6PySide6PyQt5PySide2PyQt4PySide
License
MIT License - Based on code from pyqtgraph (also MIT licensed)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2538bd30011a476579c6fd5a6cf5cb3719980e7ea68c79faf21e936f942fe078
|
|
| MD5 |
db162b3ee09a22082e3c3ac0887f2f23
|
|
| BLAKE2b-256 |
a17277498f91046aab18ada996963107ca5cefa4653e91ecee31d67a7db82df6
|
File details
Details for the file detect_qt_binding-0.1.0a0-py2.py3-none-any.whl.
File metadata
- Download URL: detect_qt_binding-0.1.0a0-py2.py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8b806e98edc9d1821040ca7df7c2739feffd0f809c67920df4cd4576b3423b5
|
|
| MD5 |
821c1ca397d6b61ab0f9bb05b11c5b43
|
|
| BLAKE2b-256 |
cc0d61a4ae237cb825dbc97470c5416e8591666e60f8eadab7033228dffb7e9a
|