skillfed

magicgui

build GUIs from python types

magicgui v0.10.2 241.1K downloads/30d#8,889 on PyPI511
Permissive license MIT Active released

What it is and what it does

Magicgui is a Python library that generates graphical user interfaces from function signatures and type annotations. Instead of writing widget layout code, you decorate a Python function with @magicgui and the library automatically creates form controls for each parameter based on its type. It uses qtpy to support both PyQt5 and PySide2 backends, meaning you choose which Qt implementation to install.

The library handles common types (int, float, str, bool, Enum) and generates appropriate widgets automatically. You can customize behavior with decorator arguments like call_button and result_widget. The generated GUI is interactive—users fill in parameters and click a button to execute the function, with results displayed in the interface. It's designed for scientists, researchers, and developers who want to quickly prototype interactive tools without learning Qt or GUI layout frameworks.

Use it for:

  • Rapidly prototype scientific calculators or data analysis tools with minimal GUI code
  • Build parameter-tuning interfaces for algorithms where inputs map directly to function arguments
  • Create interactive demos of Python functions for presentations or educational materials
  • Generate admin or configuration UIs from existing function signatures without rewriting logic
  • Develop desktop tools for non-programmers by exposing Python functions as clickable forms

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Magicgui builds graphical user interfaces directly from Python function signatures and type annotations, with minimal boilerplate code.

Yes, if you need to build simple to moderate GUIs quickly and already have PyQt5 or PySide2 available. The decorator-based approach eliminates layout boilerplate for type-driven interfaces. Not suitable if you need complex custom layouts, advanced styling, or have no Qt backend installed. Active maintenance and no known vulnerabilities support adoption.

Install

magicgui on PyPI

pip

pip install magicgui

uv

uv add magicgui

poetry

poetry add magicgui

Installing magicgui

Before you install

Low install friction; pure Python wheel with five runtime dependencies. Actively maintained as of 2026-08-03 with recent releases. Requires either PyQt5 or PySide2 as a backend, which must be installed separately via extras or manually.

License in practice

MIT license permits commercial and private use with minimal restrictions; suitable for most projects without licensing concerns.

Quickstart

pip install magicgui[pyqt5]

from magicgui import magicgui

@magicgui(call_button="calculate")
def my_function(x: float = 1.0, y: int = 2) -> float:
    return x * y

my_function.show()

PyQt5 or PySide2 must be installed separately; magicgui provides only the Qt abstraction layer via qtpy.

Verify before relying

  • Whether the package works equally well with both PyQt5 and PySide2 backends or if one is preferred
  • Performance characteristics when building complex multi-widget interfaces
  • Extent of customization possible beyond the decorator's built-in options

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 5 — docstring-parser, psygnal, qtpy, superqt, typing-extensions
Maintenance actively maintained — 126 days since the last release
Last repo commit
First released
Downloads 241,059/month — #8,889 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: magicgui-0.10.2-py3-none-any.whl

Keywords: gui, type annotations, widgets

Development Status :: 4 - BetaEnvironment :: X11 Applications :: QtIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Desktop EnvironmentTopic :: Software DevelopmentTopic :: Software Development :: User InterfacesTopic :: Software Development :: Widget SetsTopic :: UtilitiesTyping :: Typed

Tags

gui from type annotationsautomatic gui generationpython function to guiqt gui decoratortype-driven ui builderpython gui without layout codewidget generation from types
gui-generationtype-annotationsqt-wrapper

More Software Development packages