# napari-script-editor
[![License](https://img.shields.io/pypi/l/napari-script-editor.svg?color=green)](https://github.com/haesleinhuepf/napari-script-editor/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-script-editor.svg?color=green)](https://pypi.org/project/napari-script-editor)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-script-editor.svg?color=green)](https://python.org)
[![tests](https://github.com/haesleinhuepf/napari-script-editor/workflows/tests/badge.svg)](https://github.com/haesleinhuepf/napari-script-editor/actions)
[![codecov](https://codecov.io/gh/haesleinhuepf/napari-script-editor/branch/main/graph/badge.svg)](https://codecov.io/gh/haesleinhuepf/napari-script-editor)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-script-editor)](https://napari-hub.org/plugins/napari-script-editor)
A python script editor for napari based on [haesleinhuepf's fork of PyQode](https://github.com/haesleinhuepf/pyqode.core).
----------------------------------
This [napari] plugin was generated with [Cookiecutter] using with [@napari]'s [cookiecutter-napari-plugin] template.
![](https://github.com/haesleinhuepf/napari-script-editor/raw/main/docs/screenshot2.png)
## Usage
Start the script editor from the menu `Tools > Scripts > Script Editor`. Use the auto-completion while typing,
check out the [napari tutorials](https://napari.org/tutorials/) and the
[example scripts](https://github.com/haesleinhuepf/napari-script-editor/tree/main/example_scripts).
Use the `Run` button to execute a script.
![](https://github.com/haesleinhuepf/napari-script-editor/raw/main/docs/type_and_run_screencast.gif)
If you save the script to the folder ".napari-scripts" in your home directory, you will find the script in the
`Tools > Scripts` menu in napari. You can then also start it from there.
![](https://github.com/haesleinhuepf/napari-script-editor/raw/main/docs/run_from_menu_screencast.gif)
Note: If you have scripts, that might be useful to others, please send them as
[pull-request](https://github.com/haesleinhuepf/napari-script-editor/pulls) to the examples in
repository or share them in any other way that suits you.
### chatGPT support
In case [openAI API](https://openai.com/blog/openai-api) is installed, you find another button in the script editor to `Ask chatGPT`.
Enter a prompt in the script editor and click the button. The script editor will send the prompt to
chatGPT and replace it with the answer. For example try entering:
```python
Write Python code for segmenting an image using these steps:
* Apply a Gaussian blur
* Threshold the image using Otsu's method
* Apply connected component labeling
```
and it will replace it with code accordingly. If it doesn't work in the first attempt, try again. ChatGPT's answers are not always the same.
![](https://github.com/haesleinhuepf/napari-script-editor/raw/main/docs/ask_chatgpt.gif)
## Installation
* Get a python environment, e.g. via [mini-conda](https://docs.conda.io/en/latest/miniconda.html).
If you never used python/conda environments before, please follow the instructions
[here](https://mpicbg-scicomp.github.io/ipf_howtoguides/guides/Python_Conda_Environments) first.
* Install [napari](https://github.com/napari/napari) using conda.
```
conda install -c conda-forge napari
```
Afterwards, install `napari-script-editor` using pip:
```
pip install napari-script-editor
```
## Contributing
Contributions are very welcome. Tests can be run with [tox], please ensure
the coverage at least stays the same before you submit a pull request.
## License
Distributed under the terms of the [BSD-3] license,
"napari-script-editor" is free and open source software
## Known issues
* Sometimes, the script editor thinks, the file has been changed on disk and asks to reload it.
## Issues
If you encounter any problems, please [file an issue] along with a detailed description.
[napari]: https://github.com/napari/napari
[Cookiecutter]: https://github.com/audreyr/cookiecutter
[@napari]: https://github.com/napari
[MIT]: http://opensource.org/licenses/MIT
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
[file an issue]: https://github.com/haesleinhuepf/napari-script-editor/issues
[napari]: https://github.com/napari/napari
[tox]: https://tox.readthedocs.io/en/latest/
[pip]: https://pypi.org/project/pip/
[PyPI]: https://pypi.org/
Raw data
{
"_id": null,
"home_page": "https://github.com/haesleinhuepf/napari-script-editor",
"name": "napari-script-editor",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Robert Haase",
"author_email": "robert.haase@tu-dresden.de",
"download_url": "https://files.pythonhosted.org/packages/3f/ae/733372ec381fd0652edfba2af8dec903320b755f1058ebb1ec4ce97767c7/napari-script-editor-0.2.10.tar.gz",
"platform": null,
"description": "# napari-script-editor\r\n\r\n[![License](https://img.shields.io/pypi/l/napari-script-editor.svg?color=green)](https://github.com/haesleinhuepf/napari-script-editor/raw/main/LICENSE)\r\n[![PyPI](https://img.shields.io/pypi/v/napari-script-editor.svg?color=green)](https://pypi.org/project/napari-script-editor)\r\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-script-editor.svg?color=green)](https://python.org)\r\n[![tests](https://github.com/haesleinhuepf/napari-script-editor/workflows/tests/badge.svg)](https://github.com/haesleinhuepf/napari-script-editor/actions)\r\n[![codecov](https://codecov.io/gh/haesleinhuepf/napari-script-editor/branch/main/graph/badge.svg)](https://codecov.io/gh/haesleinhuepf/napari-script-editor)\r\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-script-editor)](https://napari-hub.org/plugins/napari-script-editor)\r\n\r\nA python script editor for napari based on [haesleinhuepf's fork of PyQode](https://github.com/haesleinhuepf/pyqode.core).\r\n\r\n----------------------------------\r\n\r\nThis [napari] plugin was generated with [Cookiecutter] using with [@napari]'s [cookiecutter-napari-plugin] template.\r\n\r\n![](https://github.com/haesleinhuepf/napari-script-editor/raw/main/docs/screenshot2.png)\r\n\r\n## Usage\r\n\r\nStart the script editor from the menu `Tools > Scripts > Script Editor`. Use the auto-completion while typing, \r\ncheck out the [napari tutorials](https://napari.org/tutorials/) and the\r\n[example scripts](https://github.com/haesleinhuepf/napari-script-editor/tree/main/example_scripts). \r\nUse the `Run` button to execute a script.\r\n\r\n![](https://github.com/haesleinhuepf/napari-script-editor/raw/main/docs/type_and_run_screencast.gif)\r\n\r\nIf you save the script to the folder \".napari-scripts\" in your home directory, you will find the script in the \r\n`Tools > Scripts` menu in napari. You can then also start it from there.\r\n\r\n![](https://github.com/haesleinhuepf/napari-script-editor/raw/main/docs/run_from_menu_screencast.gif)\r\n\r\nNote: If you have scripts, that might be useful to others, please send them as \r\n[pull-request](https://github.com/haesleinhuepf/napari-script-editor/pulls) to the examples in \r\nrepository or share them in any other way that suits you.\r\n\r\n### chatGPT support\r\n\r\nIn case [openAI API](https://openai.com/blog/openai-api) is installed, you find another button in the script editor to `Ask chatGPT`. \r\nEnter a prompt in the script editor and click the button. The script editor will send the prompt to\r\nchatGPT and replace it with the answer. For example try entering:\r\n```python\r\nWrite Python code for segmenting an image using these steps:\r\n * Apply a Gaussian blur\r\n * Threshold the image using Otsu's method\r\n * Apply connected component labeling\r\n```\r\nand it will replace it with code accordingly. If it doesn't work in the first attempt, try again. ChatGPT's answers are not always the same.\r\n\r\n![](https://github.com/haesleinhuepf/napari-script-editor/raw/main/docs/ask_chatgpt.gif)\r\n\r\n\r\n## Installation\r\n* Get a python environment, e.g. via [mini-conda](https://docs.conda.io/en/latest/miniconda.html). \r\n If you never used python/conda environments before, please follow the instructions \r\n [here](https://mpicbg-scicomp.github.io/ipf_howtoguides/guides/Python_Conda_Environments) first.\r\n* Install [napari](https://github.com/napari/napari) using conda. \r\n\r\n```\r\nconda install -c conda-forge napari\r\n```\r\n\r\nAfterwards, install `napari-script-editor` using pip:\r\n\r\n```\r\npip install napari-script-editor\r\n```\r\n\r\n## Contributing\r\n\r\nContributions are very welcome. Tests can be run with [tox], please ensure\r\nthe coverage at least stays the same before you submit a pull request.\r\n\r\n## License\r\n\r\nDistributed under the terms of the [BSD-3] license,\r\n\"napari-script-editor\" is free and open source software\r\n\r\n## Known issues\r\n\r\n* Sometimes, the script editor thinks, the file has been changed on disk and asks to reload it.\r\n\r\n## Issues\r\n\r\nIf you encounter any problems, please [file an issue] along with a detailed description.\r\n\r\n[napari]: https://github.com/napari/napari\r\n[Cookiecutter]: https://github.com/audreyr/cookiecutter\r\n[@napari]: https://github.com/napari\r\n[MIT]: http://opensource.org/licenses/MIT\r\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\r\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\r\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\r\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\r\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\r\n[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin\r\n\r\n[file an issue]: https://github.com/haesleinhuepf/napari-script-editor/issues\r\n\r\n[napari]: https://github.com/napari/napari\r\n[tox]: https://tox.readthedocs.io/en/latest/\r\n[pip]: https://pypi.org/project/pip/\r\n[PyPI]: https://pypi.org/\r\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A python script editor for napari",
"version": "0.2.10",
"project_urls": {
"Bug Tracker": "https://github.com/haesleinhuepf/napari-script-editor/issues",
"Documentation": "https://github.com/haesleinhuepf/napari-script-editor#README.md",
"Homepage": "https://github.com/haesleinhuepf/napari-script-editor",
"Source Code": "https://github.com/haesleinhuepf/napari-script-editor",
"User Support": "https://github.com/haesleinhuepf/napari-script-editor/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "18cf069b67fee7febb79c1692ed54e0b9da7264708e43f0154c5d4b6e7b9cfea",
"md5": "882be199b6e66b38cb20faf3d12ba3c8",
"sha256": "f6a200e0a11d5a7c97377af399d871fdba6bbd8973c08e40bc3335e002b8e6aa"
},
"downloads": -1,
"filename": "napari_script_editor-0.2.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "882be199b6e66b38cb20faf3d12ba3c8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9346,
"upload_time": "2023-07-08T17:13:50",
"upload_time_iso_8601": "2023-07-08T17:13:50.831040Z",
"url": "https://files.pythonhosted.org/packages/18/cf/069b67fee7febb79c1692ed54e0b9da7264708e43f0154c5d4b6e7b9cfea/napari_script_editor-0.2.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3fae733372ec381fd0652edfba2af8dec903320b755f1058ebb1ec4ce97767c7",
"md5": "64bcaa6da5d64532a5afe1fd375911df",
"sha256": "c89dd6032f7571b549f23fc98ff3b393085c096a966fffebcaade0931de28398"
},
"downloads": -1,
"filename": "napari-script-editor-0.2.10.tar.gz",
"has_sig": false,
"md5_digest": "64bcaa6da5d64532a5afe1fd375911df",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10028,
"upload_time": "2023-07-08T17:13:52",
"upload_time_iso_8601": "2023-07-08T17:13:52.540062Z",
"url": "https://files.pythonhosted.org/packages/3f/ae/733372ec381fd0652edfba2af8dec903320b755f1058ebb1ec4ce97767c7/napari-script-editor-0.2.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-08 17:13:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "haesleinhuepf",
"github_project": "napari-script-editor",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "napari-script-editor"
}