build GUIs from type annotations, using magic.
📖 Docs
https://pyapp-kit.github.io/magicgui/
Installation
magicgui uses qtpy to support both pyside2 and pyqt5 backends. However, you
must have one of those installed for magicgui to work.
install with pip
pip install magicgui[pyqt5]
# or
pip install magicgui[pyside2]
or with conda:
conda install -c conda-forge magicgui pyqt # or pyside2 instead of pyqt
:information_source: If you'd like to help us extend support to a different backend, please open an issue.
Basic usage
from magicgui import magicgui
from enum import Enum
class Medium(Enum):
Glass = 1.520
Oil = 1.515
Water = 1.333
Air = 1.0003
# decorate your function with the @magicgui decorator
@magicgui(call_button="calculate", result_widget=True)
def snells_law(aoi=30.0, n1=Medium.Glass, n2=Medium.Water, degrees=True):
import math
aoi = math.radians(aoi) if degrees else aoi
try:
result = math.asin(n1.value * math.sin(aoi) / n2.value)
return math.degrees(result) if degrees else result
except ValueError:
return "Total internal reflection!"
# your function is now capable of showing a GUI
snells_law.show(run=True)
But that's just the beginning! Please see Documentation for many more details and usage examples.
Contributing
Contributions are welcome!
See contributing guide here.
Release files for magicgui 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| magicgui-0.10.0.tar.gz | 20.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| magicgui-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.1 MB
Release files / magicgui-0.10.0.tar.gz
| Download URL | magicgui-0.10.0.tar.gz |
|---|---|
| Size | 20.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56dbe28afc526809e09932cd6caad8fc1a8305fe66c8feca16f797a04b5aee7c
|
|
BLAKE2b-256 checksum How to use checksums |
ce44405f7028b00d94e29ddbaff00f2674e548d3bff8d343fbf7500bd77aa071
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 16, 2024.
Transparency logRelease files / magicgui-0.10.0-py3-none-any.whl
| Download URL | magicgui-0.10.0-py3-none-any.whl |
|---|---|
| Size | 126.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
836276d61b0d9752eb8a215ff9f140c9c07ed5659b6e2a3c78df1cc96399aecd
|
|
BLAKE2b-256 checksum How to use checksums |
b6427e4f03201dfc10b4a8d4d94d183c878d7d0d4f2eee173e95294c71828014
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 16, 2024.
Transparency log