build GUIs from python types
Project Links
Meta
Author: Talley Lambert
Requires Python: >=3.9
Classifiers
Development Status
- 4 - Beta
Environment
- X11 Applications :: Qt
Intended Audience
- Developers
- Science/Research
License
- OSI Approved :: MIT License
Operating System
- OS Independent
Programming Language
- Python
- Python :: 3 :: Only
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
Topic
- Desktop Environment
- Software Development
- Software Development :: User Interfaces
- Software Development :: Widget Sets
- Utilities
Typing
- Typed
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.
Jun 03, 2025
0.10.1
Dec 16, 2024
0.10.0
Nov 22, 2024
0.10.0rc1
Aug 06, 2024
0.9.1
Aug 05, 2024
0.9.0
Jun 04, 2024
0.8.3
Mar 05, 2024
0.8.2
Dec 06, 2023
0.8.1
Oct 20, 2023
0.8.0
Aug 12, 2023
0.7.3
Mar 05, 2023
0.7.2
Mar 05, 2023
0.7.1
Feb 27, 2023
0.7.0
Feb 24, 2023
0.7.0rc1
Nov 26, 2022
0.7.0rc0
Nov 18, 2022
0.6.1
Oct 26, 2022
0.6.0
Oct 22, 2022
0.6.0rc1
Oct 21, 2022
0.6.0rc0
Jun 14, 2022
0.5.1
Jun 13, 2022
0.5.0
Mar 25, 2022
0.4.0
Mar 18, 2022
0.4.0rc1
Feb 12, 2022
0.3.7
Feb 11, 2022
0.3.6
Feb 07, 2022
0.3.5
Jan 01, 2022
0.3.4
Nov 08, 2021
0.3.3
Oct 22, 2021
0.3.2
Oct 21, 2021
0.3.1
Oct 10, 2021
0.3.0
Oct 10, 2021
0.3.0rc2
Oct 04, 2021
0.3.0rc1
Sep 11, 2021
0.2.11
Jul 11, 2021
0.2.10
Apr 05, 2021
0.2.9
Mar 24, 2021
0.2.8
Mar 24, 2021
0.2.8rc0
Feb 28, 2021
0.2.7
Jan 25, 2021
0.2.6
Jan 25, 2021
0.2.6rc0
Jan 13, 2021
0.2.5
Jan 12, 2021
0.2.4
Jan 08, 2021
0.2.3
Jan 02, 2021
0.2.2
Dec 29, 2020
0.2.1
Dec 29, 2020
0.2.1rc2
Dec 29, 2020
0.2.1rc1
Dec 26, 2020
0.2.0
Jul 23, 2020
0.1.6
May 25, 2020
0.1.5
May 19, 2020
0.1.4
May 04, 2020
0.1.3
Mar 06, 2020
0.1.2
Feb 19, 2020
0.1.1
Feb 18, 2020
0.1.0
Feb 11, 2020
0.0.8
Feb 09, 2020
0.0.7
Feb 11, 2020
0.0.6