Skip to main content

Python backend for node editor-like graph-based processing

Project description

drawing

Python backend for graph-based processing, designed for flow-based/node-based visual scripting editors. It is the backbone of the Ryven project, but it can be used for other applications as well.

If you are not already familiar with flow-based visual scripting and are looking for a specification, see here (I will move this somewhere here soon).

Installation

pip install ryvencore

or from sources:

git clone https://github.com/leon-thomm/ryvencore
cd ryvencore
pip install .

Dependencies

None! ryvencore runs completely on standard python modules, no additional libraries required, which makes it very compatible.

Usage

Using ryvencore directly to run projects made with ryvencore-based editors, the following code example gives some intuition about the process:

import ryvencore as rc
import json
import sys

if __name__ == '__main__':
    # get a working project file path
    if len(sys.argv) < 2:
        sys.exit('please provide a project file path')
    fpath = sys.argv[1]
    try:
        f = open(fpath)
        f.close()
    except FileNotFoundError:
        sys.exit(f'could not open file {fpath}')
    
    # read project file
    with open(fpath, 'r') as f:
        project: dict = json.loads(f.read())
    
    # run ryvencore
    session = rc.Session()
    session.load(project)

    # and now we can manually access all components, for example:
    scripts = session.scripts
    flow1 = scripts[0].flow
    my_node = flow1.nodes[-1]
    my_node.update()

You can also use it for other purposes. A mostly auto-generated documentation is available here.

Main Features

  • load & save into and from JSON-compatible dictionaries
  • variables system with update mechanism to build nodes that automatically adapt to change of data
  • built in logging based on python's logging module
  • powerful nodes system which lets you do anything, simple and unrestricted
  • dynamic nodes registration mechanism to register and unregister nodes at runtime
  • actions system for nodes
  • data and exec flow support - unlike lots of other solutions out there, ryvencore supports exec flows

For a more detailed overview, see the docs.

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

ryvencore-0.1.3.tar.gz (105.2 kB view hashes)

Uploaded Source

Built Distribution

ryvencore-0.1.3-py3-none-any.whl (35.0 kB view hashes)

Uploaded Python 3

Supported by

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