QNodeEditor


NameQNodeEditor JSON
Version 1.0.5 PyPI version JSON
download
home_pageNone
SummaryNode editor for PyQt5
upload_time2024-03-20 23:06:36
maintainerNone
docs_urlNone
authorJasper Jeuken
requires_python>=3.9
licenseCopyright (c) 2023, Jasper Jeuken All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords node editor pyqt5 pyqt pyside2 pyside socket edge graph connection nodes qnode qnodeeditor
VCS
bugtrack_url
requirements PyQt5 networkx
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # QNodeEditor

![pylint](https://img.shields.io/badge/pylint-9.82-yellow?logo=python&logoColor=white)
[<img src="https://img.shields.io/badge/github--blue?logo=github" alt="Github badge">](https://github.com/JasperJeuken/QNodeEditor)
[<img src="https://img.shields.io/badge/PyPi--blue?logo=pypi" alt="PyPi badge">](https://pypi.org/project/QNodeEditor/)
[<img src="https://img.shields.io/badge/Documentation--blue?logo=readthedocs" alt="readthedocs badge">](https://qnodeeditor.readthedocs.io/en/latest/)
[<img src="https://readthedocs.org/projects/qnodeeditor/badge/" alt="readthedocs badge 2">](https://qnodeeditor.readthedocs.io/en/latest/)

QNodeEditor is a collection of widgets that enables you to easily create 
and use a node editing environment in PyQt5.

| <img src="https://raw.githubusercontent.com/JasperJeuken/QNodeEditor/main/images/demo.gif" alt="Example node scene being edited" width="100%"/> |
|:-----------------------------------------------------------------------------------------------------------------------------------------------:|
|                                            <div width="100%">*Example node scene being edited*</div>                                            |

|  <img src="https://raw.githubusercontent.com/JasperJeuken/QNodeEditor/main/images/themes.jpg" alt="drawing" width="100%"/>   |
|:----------------------------------------------------------------------------------------------------------------------------:|
|                                <div width="100%">*QNodeEditor supports flexible themes*</div>                                |

## Installing
Install the package using the following command:

```
pip install QNodeEditor
```

## Requirements
The QNodeEditor package requires the following packages:
- [PyQt5](https://pypi.org/project/PyQt5/)
- [networkx](https://pypi.org/project/networkx/)

## Usage
For a full guide on how to use QNodeEditor, check out the [Documentation](https://qnodeeditor.readthedocs.io/en/latest/).
Here you can find tips on how to get started, as well as the API documentation for QNodeEditor.

### Example
Below is some sample code for creating a node that performs an addition of two values.
```python
from QNodeEditor import Node

class AddNode(Node):
    code = 0  # Unique code for each node type
    
    def create(self):
        self.title = 'Addition'  # Set the node title
        
        self.add_label_output('Output')  # Add output socket
        self.add_value_input('Value 1')  # Add input socket for first value
        self.add_value_input('Value 2')  # Add input socket for second value
        
    def evaluate(self, values: dict):
        result = values['Value 1'] + values['Value 2']  # Add 'Value 1' and 'Value 2'
        self.set_output_value('Output', result)         # Set as value for 'Output'
```
<img src="https://raw.githubusercontent.com/JasperJeuken/QNodeEditor/main/images/addition_node.jpg" alt="Example node" width="300">

This node can now be used in a scene. When it is evaluated, it will take `Value 1` and `Value 2`, add them, and set it as the value of `Output`.

This is a simple node, but the package is flexible. You can place any widgets inside the node, and define the logic as you wish. You can also attach
to signals emitted by the scene, such as when two nodes are connected together.

A node scene evaluates the scene asynchronously, meaning the interface will not freeze while a calculation is performed. If an error occurs, it is signalled,
and you can handle it as you want.

## License
This package uses the MIT License (see the [LICENSE](./LICENSE) file).

The package is inspired by the [pyqt-node-editor](https://gitlab.com/pavel.krupala/pyqt-node-editor)
(MIT license) package by Pavel Křupala.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "QNodeEditor",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "node, editor, pyqt5, pyqt, pyside2, pyside, socket, edge, graph, connection, nodes, qnode, qnodeeditor",
    "author": "Jasper Jeuken",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/84/dd/23f47c5f4d23e69e8b464362c2f2575f111d3fc2fed57824da1dcba98f6f/QNodeEditor-1.0.5.tar.gz",
    "platform": null,
    "description": "# QNodeEditor\r\n\r\n![pylint](https://img.shields.io/badge/pylint-9.82-yellow?logo=python&logoColor=white)\r\n[<img src=\"https://img.shields.io/badge/github--blue?logo=github\" alt=\"Github badge\">](https://github.com/JasperJeuken/QNodeEditor)\r\n[<img src=\"https://img.shields.io/badge/PyPi--blue?logo=pypi\" alt=\"PyPi badge\">](https://pypi.org/project/QNodeEditor/)\r\n[<img src=\"https://img.shields.io/badge/Documentation--blue?logo=readthedocs\" alt=\"readthedocs badge\">](https://qnodeeditor.readthedocs.io/en/latest/)\r\n[<img src=\"https://readthedocs.org/projects/qnodeeditor/badge/\" alt=\"readthedocs badge 2\">](https://qnodeeditor.readthedocs.io/en/latest/)\r\n\r\nQNodeEditor is a collection of widgets that enables you to easily create \r\nand use a node editing environment in PyQt5.\r\n\r\n| <img src=\"https://raw.githubusercontent.com/JasperJeuken/QNodeEditor/main/images/demo.gif\" alt=\"Example node scene being edited\" width=\"100%\"/> |\r\n|:-----------------------------------------------------------------------------------------------------------------------------------------------:|\r\n|                                            <div width=\"100%\">*Example node scene being edited*</div>                                            |\r\n\r\n|  <img src=\"https://raw.githubusercontent.com/JasperJeuken/QNodeEditor/main/images/themes.jpg\" alt=\"drawing\" width=\"100%\"/>   |\r\n|:----------------------------------------------------------------------------------------------------------------------------:|\r\n|                                <div width=\"100%\">*QNodeEditor supports flexible themes*</div>                                |\r\n\r\n## Installing\r\nInstall the package using the following command:\r\n\r\n```\r\npip install QNodeEditor\r\n```\r\n\r\n## Requirements\r\nThe QNodeEditor package requires the following packages:\r\n- [PyQt5](https://pypi.org/project/PyQt5/)\r\n- [networkx](https://pypi.org/project/networkx/)\r\n\r\n## Usage\r\nFor a full guide on how to use QNodeEditor, check out the [Documentation](https://qnodeeditor.readthedocs.io/en/latest/).\r\nHere you can find tips on how to get started, as well as the API documentation for QNodeEditor.\r\n\r\n### Example\r\nBelow is some sample code for creating a node that performs an addition of two values.\r\n```python\r\nfrom QNodeEditor import Node\r\n\r\nclass AddNode(Node):\r\n    code = 0  # Unique code for each node type\r\n    \r\n    def create(self):\r\n        self.title = 'Addition'  # Set the node title\r\n        \r\n        self.add_label_output('Output')  # Add output socket\r\n        self.add_value_input('Value 1')  # Add input socket for first value\r\n        self.add_value_input('Value 2')  # Add input socket for second value\r\n        \r\n    def evaluate(self, values: dict):\r\n        result = values['Value 1'] + values['Value 2']  # Add 'Value 1' and 'Value 2'\r\n        self.set_output_value('Output', result)         # Set as value for 'Output'\r\n```\r\n<img src=\"https://raw.githubusercontent.com/JasperJeuken/QNodeEditor/main/images/addition_node.jpg\" alt=\"Example node\" width=\"300\">\r\n\r\nThis node can now be used in a scene. When it is evaluated, it will take `Value 1` and `Value 2`, add them, and set it as the value of `Output`.\r\n\r\nThis is a simple node, but the package is flexible. You can place any widgets inside the node, and define the logic as you wish. You can also attach\r\nto signals emitted by the scene, such as when two nodes are connected together.\r\n\r\nA node scene evaluates the scene asynchronously, meaning the interface will not freeze while a calculation is performed. If an error occurs, it is signalled,\r\nand you can handle it as you want.\r\n\r\n## License\r\nThis package uses the MIT License (see the [LICENSE](./LICENSE) file).\r\n\r\nThe package is inspired by the [pyqt-node-editor](https://gitlab.com/pavel.krupala/pyqt-node-editor)\r\n(MIT license) package by Pavel K\u0159upala.\r\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2023, Jasper Jeuken All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
    "summary": "Node editor for PyQt5",
    "version": "1.0.5",
    "project_urls": {
        "Documentation": "https://qnodeeditor.readthedocs.io/en/latest/",
        "Github": "https://github.com/JasperJeuken/QNodeEditor",
        "Homepage": "https://github.com/JasperJeuken/QNodeEditor"
    },
    "split_keywords": [
        "node",
        " editor",
        " pyqt5",
        " pyqt",
        " pyside2",
        " pyside",
        " socket",
        " edge",
        " graph",
        " connection",
        " nodes",
        " qnode",
        " qnodeeditor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "792f8de0181fea9a47a4ca6bd69f23d0928db8219cddcbae48fd7002b4898425",
                "md5": "568d56cac78fcdb5785e7cebbd7126d5",
                "sha256": "8db7088069e833daf3d3ebcbed8d7e787cebf9f3884fe7c63b90baa064df142e"
            },
            "downloads": -1,
            "filename": "QNodeEditor-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "568d56cac78fcdb5785e7cebbd7126d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 2930877,
            "upload_time": "2024-03-20T23:06:31",
            "upload_time_iso_8601": "2024-03-20T23:06:31.218383Z",
            "url": "https://files.pythonhosted.org/packages/79/2f/8de0181fea9a47a4ca6bd69f23d0928db8219cddcbae48fd7002b4898425/QNodeEditor-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84dd23f47c5f4d23e69e8b464362c2f2575f111d3fc2fed57824da1dcba98f6f",
                "md5": "3424cdf5c88a190df131b6a483d47d07",
                "sha256": "686960547db02f8454ebe484832b603c4b97d517eec274faa4bb3a0aed4d5318"
            },
            "downloads": -1,
            "filename": "QNodeEditor-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "3424cdf5c88a190df131b6a483d47d07",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 2917831,
            "upload_time": "2024-03-20T23:06:36",
            "upload_time_iso_8601": "2024-03-20T23:06:36.241891Z",
            "url": "https://files.pythonhosted.org/packages/84/dd/23f47c5f4d23e69e8b464362c2f2575f111d3fc2fed57824da1dcba98f6f/QNodeEditor-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-20 23:06:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JasperJeuken",
    "github_project": "QNodeEditor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "PyQt5",
            "specs": [
                [
                    "~=",
                    "5.15.10"
                ]
            ]
        },
        {
            "name": "networkx",
            "specs": [
                [
                    "~=",
                    "3.2.1"
                ]
            ]
        }
    ],
    "lcname": "qnodeeditor"
}
        
Elapsed time: 2.88476s