magicgui


Namemagicgui JSON
Version 0.8.2 PyPI version JSON
download
home_page
Summarybuild GUIs from python types
upload_time2024-03-05 17:43:29
maintainer
docs_urlNone
author
requires_python>=3.8
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": "",
    "name": "magicgui",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "gui,type annotations,widgets",
    "author": "",
    "author_email": "Talley Lambert <talley.lambert@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/aa/a9/153816ddcf7189b07ef19ce92dba1fd7fa0a488f9553361011b0c418dccc/magicgui-0.8.2.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.8.2",
    "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": "be4ac030d90bdbea3bf7887b524f63cb05ac0929daff42e06df560b5d5161890",
                "md5": "daecff95663cfa0314ca2245279ad3c0",
                "sha256": "23ad789a058e6f5b4c9f9c7b804cbb73633c2d44c5141a10b71fabcd4847ae2e"
            },
            "downloads": -1,
            "filename": "magicgui-0.8.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "daecff95663cfa0314ca2245279ad3c0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 124326,
            "upload_time": "2024-03-05T17:43:26",
            "upload_time_iso_8601": "2024-03-05T17:43:26.403197Z",
            "url": "https://files.pythonhosted.org/packages/be/4a/c030d90bdbea3bf7887b524f63cb05ac0929daff42e06df560b5d5161890/magicgui-0.8.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aaa9153816ddcf7189b07ef19ce92dba1fd7fa0a488f9553361011b0c418dccc",
                "md5": "6680da15058274f96c4acebe9a2247b3",
                "sha256": "470176d4864007f42af2f1a64a1224a665b8afec14e5c8efa1e6c644b4100096"
            },
            "downloads": -1,
            "filename": "magicgui-0.8.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6680da15058274f96c4acebe9a2247b3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20937020,
            "upload_time": "2024-03-05T17:43:29",
            "upload_time_iso_8601": "2024-03-05T17:43:29.917585Z",
            "url": "https://files.pythonhosted.org/packages/aa/a9/153816ddcf7189b07ef19ce92dba1fd7fa0a488f9553361011b0c418dccc/magicgui-0.8.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-05 17:43:29",
    "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.22142s