Skip to main content

Node editor for PyQt5

Project description

QNodeEditor

pylint Github badge PyPi badge readthedocs badge readthedocs badge 2

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

Example node scene being edited
Example node scene being edited
drawing
QNodeEditor supports flexible themes

Installing

Install the package using the following command:

pip install QNodeEditor

Requirements

The QNodeEditor package requires the following packages:

Usage

For a full guide on how to use QNodeEditor, check out the Documentation. 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.

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'
Example node

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 file).

The package is inspired by the pyqt-node-editor (MIT license) package by Pavel Křupala.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qnodeeditor-1.0.7.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qnodeeditor-1.0.7-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file qnodeeditor-1.0.7.tar.gz.

File metadata

  • Download URL: qnodeeditor-1.0.7.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for qnodeeditor-1.0.7.tar.gz
Algorithm Hash digest
SHA256 7157fb1e5f89a30f07e109ddf9d1ee4465c448a8b76dacaa79968339a032dfb2
MD5 b08443304f113e957b4c4540113cfb2f
BLAKE2b-256 d9ddf87159fc5459332a983359ce82f5f8b2c495d39be1c1e0eec46b13f17589

See more details on using hashes here.

File details

Details for the file qnodeeditor-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: qnodeeditor-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for qnodeeditor-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 90a1f84c11beca70d96fda16de9d698e92614544097a08a966eeeb296ca6c02b
MD5 5aeac85c7570edf7ccf34a2a9c75648c
BLAKE2b-256 532185b42369a949bd3616cd24526a0a7a68be9b52c461553b952d8a3b5791fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page