GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pyapp-kit/magicgui: build GUIs from type annotations

BranchesTags
Open more actions menu

Latest commit

 

History

655 Commits
655 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
resources
resources
 
 
src/magicgui
src/magicgui
 
 
tests
tests
 
 
.github_changelog_generator
.github_changelog_generator
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
codecov.yml
codecov.yml
 
 
mkdocs.yml
mkdocs.yml
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

magicgui

magicgui is released under the MIT license. magicgui on PyPI magicgui on conda-forge magicgui python version support

magicgui build status magicgui code coverage cite magicgui

build GUIs from type annotations, using magic.

📖 Docs

https://pyapp-kit.github.io/magicgui/

Installation

magicgui uses qtpy to support both pyqt and pyside backends. However, you must have one of those installed for magicgui to work.

install with pip

pip install magicgui[pyqt6]
# or
pip install magicgui[pyside6]

or with conda:

conda install -c conda-forge magicgui pyqt  # or pyside6 instead of pyqt

â„šī¸ 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)

snells

But that's just the beginning! Please see Documentation for many more details and usage examples.

Contributing

Contributions are welcome!

See contributing guide here.

About

build GUIs from type annotations

pyapp-kit.github.io/magicgui/

Topics

autogenerationgraphical-user-interfaceguipythontype-annotationswidgets

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

511 stars

Watchers

10 watching

Forks

65 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.