magicgui


Namemagicgui JSON
Version 0.10.0 PyPI version JSON
download
home_pageNone
Summarybuild GUIs from python types
upload_time2024-12-16 12:48:23
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords gui type annotations widgets
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">
    <img src="https://raw.githubusercontent.com/pyapp-kit/magicgui/main/resources/logo_long.png" alt="magicgui" />
</h1>

<p align="center">
  <a href="https://github.com/pyapp-kit/magicgui/blob/main/LICENSE">
    <img src="https://img.shields.io/github/license/pyapp-kit/magicgui" alt="magicgui is released under the MIT license." />
  </a>
  <a href="https://pypi.python.org/pypi/magicgui">
    <img src="https://img.shields.io/pypi/v/magicgui.svg" alt="magicgui on PyPI" />
  </a>
  <a href="https://anaconda.org/conda-forge/magicgui">
    <img src="https://img.shields.io/conda/vn/conda-forge/magicgui" alt="magicgui on conda-forge" />
  </a>
  <a href="https://python.org">
    <img src="https://img.shields.io/pypi/pyversions/magicgui.svg?color=green" alt="magicgui python version support" />
  </a>
  </p>
  <p align="center">
  <a href="https://github.com/pyapp-kit/magicgui/actions/workflows/test_and_deploy.yml">
    <img src="https://github.com/pyapp-kit/magicgui/actions/workflows/test_and_deploy.yml/badge.svg" alt="magicgui build status" />
  </a>
  <a href="https://codecov.io/gh/pyapp-kit/magicgui">
    <img src="https://codecov.io/gh/pyapp-kit/magicgui/branch/main/graph/badge.svg" alt="magicgui code coverage" />
  </a>
  <a href="https://zenodo.org/badge/latestdoi/238805437">
    <img src="https://zenodo.org/badge/238805437.svg" alt="cite magicgui" />
  </a>
</p>

<p align="center">
 <em>build GUIs from type annotations, using magic.</em>
</p>


## 📖 Docs

[https://pyapp-kit.github.io/magicgui/](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

```bash
pip install magicgui[pyqt5]
# or
pip install magicgui[pyside2]
```

or with conda:

```bash
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](https://github.com/pyapp-kit/magicgui/issues).

## Basic usage

```python
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](https://raw.githubusercontent.com/pyapp-kit/magicgui/main/resources/snells.png)

But that's just the beginning!  Please see [Documentation](https://pyapp-kit.github.io/magicgui/) for many more details
and usage examples.

## Contributing

Contributions are welcome!

See contributing guide [here](https://github.com/pyapp-kit/magicgui/blob/main/docs/CONTRIBUTING.md).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "magicgui",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "gui, type annotations, widgets",
    "author": null,
    "author_email": "Talley Lambert <talley.lambert@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ce/44/405f7028b00d94e29ddbaff00f2674e548d3bff8d343fbf7500bd77aa071/magicgui-0.10.0.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">\n    <img src=\"https://raw.githubusercontent.com/pyapp-kit/magicgui/main/resources/logo_long.png\" alt=\"magicgui\" />\n</h1>\n\n<p align=\"center\">\n  <a href=\"https://github.com/pyapp-kit/magicgui/blob/main/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/pyapp-kit/magicgui\" alt=\"magicgui is released under the MIT license.\" />\n  </a>\n  <a href=\"https://pypi.python.org/pypi/magicgui\">\n    <img src=\"https://img.shields.io/pypi/v/magicgui.svg\" alt=\"magicgui on PyPI\" />\n  </a>\n  <a href=\"https://anaconda.org/conda-forge/magicgui\">\n    <img src=\"https://img.shields.io/conda/vn/conda-forge/magicgui\" alt=\"magicgui on conda-forge\" />\n  </a>\n  <a href=\"https://python.org\">\n    <img src=\"https://img.shields.io/pypi/pyversions/magicgui.svg?color=green\" alt=\"magicgui python version support\" />\n  </a>\n  </p>\n  <p align=\"center\">\n  <a href=\"https://github.com/pyapp-kit/magicgui/actions/workflows/test_and_deploy.yml\">\n    <img src=\"https://github.com/pyapp-kit/magicgui/actions/workflows/test_and_deploy.yml/badge.svg\" alt=\"magicgui build status\" />\n  </a>\n  <a href=\"https://codecov.io/gh/pyapp-kit/magicgui\">\n    <img src=\"https://codecov.io/gh/pyapp-kit/magicgui/branch/main/graph/badge.svg\" alt=\"magicgui code coverage\" />\n  </a>\n  <a href=\"https://zenodo.org/badge/latestdoi/238805437\">\n    <img src=\"https://zenodo.org/badge/238805437.svg\" alt=\"cite magicgui\" />\n  </a>\n</p>\n\n<p align=\"center\">\n <em>build GUIs from type annotations, using magic.</em>\n</p>\n\n\n## \ud83d\udcd6 Docs\n\n[https://pyapp-kit.github.io/magicgui/](https://pyapp-kit.github.io/magicgui/)\n\n## Installation\n\n`magicgui` uses `qtpy` to support both `pyside2` and `pyqt5` backends.  However, you\nmust have one of those installed for magicgui to work.\n\ninstall with pip\n\n```bash\npip install magicgui[pyqt5]\n# or\npip install magicgui[pyside2]\n```\n\nor with conda:\n\n```bash\nconda install -c conda-forge magicgui pyqt  # or pyside2 instead of pyqt\n```\n\n> :information_source: If you'd like to help us extend support to a different backend,\n> please open an [issue](https://github.com/pyapp-kit/magicgui/issues).\n\n## Basic usage\n\n```python\nfrom magicgui import magicgui\nfrom enum import Enum\n\nclass Medium(Enum):\n    Glass = 1.520\n    Oil = 1.515\n    Water = 1.333\n    Air = 1.0003\n\n# decorate your function with the @magicgui decorator\n@magicgui(call_button=\"calculate\", result_widget=True)\ndef snells_law(aoi=30.0, n1=Medium.Glass, n2=Medium.Water, degrees=True):\n    import math\n\n    aoi = math.radians(aoi) if degrees else aoi\n    try:\n        result = math.asin(n1.value * math.sin(aoi) / n2.value)\n        return math.degrees(result) if degrees else result\n    except ValueError:\n        return \"Total internal reflection!\"\n\n# your function is now capable of showing a GUI\nsnells_law.show(run=True)\n```\n\n![snells](https://raw.githubusercontent.com/pyapp-kit/magicgui/main/resources/snells.png)\n\nBut that's just the beginning!  Please see [Documentation](https://pyapp-kit.github.io/magicgui/) for many more details\nand usage examples.\n\n## Contributing\n\nContributions are welcome!\n\nSee contributing guide [here](https://github.com/pyapp-kit/magicgui/blob/main/docs/CONTRIBUTING.md).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "build GUIs from python types",
    "version": "0.10.0",
    "project_urls": {
        "changelog": "https://github.com/pyapp-kit/magicgui/blob/main/CHANGELOG.md",
        "documentation": "https://pyapp-kit.github.io/magicgui/",
        "homepage": "https://github.com/pyapp-kit/magicgui",
        "issues": "https://github.com/pyapp-kit/magicgui/issues",
        "repository": "https://github.com/pyapp-kit/magicgui"
    },
    "split_keywords": [
        "gui",
        " type annotations",
        " widgets"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b6427e4f03201dfc10b4a8d4d94d183c878d7d0d4f2eee173e95294c71828014",
                "md5": "27d71ade9ad059e337bfabb6b731e6f3",
                "sha256": "836276d61b0d9752eb8a215ff9f140c9c07ed5659b6e2a3c78df1cc96399aecd"
            },
            "downloads": -1,
            "filename": "magicgui-0.10.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "27d71ade9ad059e337bfabb6b731e6f3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 126758,
            "upload_time": "2024-12-16T12:48:19",
            "upload_time_iso_8601": "2024-12-16T12:48:19.122033Z",
            "url": "https://files.pythonhosted.org/packages/b6/42/7e4f03201dfc10b4a8d4d94d183c878d7d0d4f2eee173e95294c71828014/magicgui-0.10.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ce44405f7028b00d94e29ddbaff00f2674e548d3bff8d343fbf7500bd77aa071",
                "md5": "d066e50763cff9c31eaa556545241986",
                "sha256": "56dbe28afc526809e09932cd6caad8fc1a8305fe66c8feca16f797a04b5aee7c"
            },
            "downloads": -1,
            "filename": "magicgui-0.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d066e50763cff9c31eaa556545241986",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 20942460,
            "upload_time": "2024-12-16T12:48:23",
            "upload_time_iso_8601": "2024-12-16T12:48:23.639267Z",
            "url": "https://files.pythonhosted.org/packages/ce/44/405f7028b00d94e29ddbaff00f2674e548d3bff8d343fbf7500bd77aa071/magicgui-0.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 12:48:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pyapp-kit",
    "github_project": "magicgui",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "magicgui"
}
        
Elapsed time: 0.58393s