Python backend for node editor-like graph-based processing
Project description
An experimental Python library for graph-based processing, designed for flow-based/node-based visual scripting editors. While it is the backbone of the Ryven project, it can very much be used in other contexts as well.
While ryvencore is written purely in Python, with not a single dependency it is very lightweight and highly compatible. It can be compiled with Cython, see the setup_cython.py
file. The performance seems comparable so far, but the code hasn't been optimized for Cython yet, so there might be a lot of potential. Please consider contributing. Pyodide provides a WebAssembly port of ryvencore.
Installation
pip install ryvencore
or from sources:
git clone https://github.com/leon-thomm/ryvencore
cd ryvencore
pip install .
Usage
As an experimental library, the API is not fully stable and small breaking changes over time should be expected. There is no maintained usage guide, but the code is documented and auto-generated docs are available here.
A small example:
import ryvencore as rc
import json
import sys
if __name__ == '__main__':
# project file path
fpath = sys.args[1]
# read project file
with open(fpath, 'r') as f:
project: dict = json.loads(f.read())
# run ryvencore
session = rc.Session()
session.load(project)
# now we can access all components, for example:
# get the first flow
scripts = session.scripts
flow1 = scripts[0].flow
# and the last node that was created
my_node = flow1.nodes[-1]
# and execute it
my_node.update()
Features
The main features include
- load & save from and into JSON
- a simple and powerful nodes system which lets you do anything, simple and unrestricted
- data and exec flow support - unlike lots of other solutions out there, ryvencore supports exec flows
- variables system with subscribe and update mechanism to build nodes that automatically adapt to change of data
- built-in logging based on python's
logging
module - actions system for nodes
Licensing
ryvencore is licensed under the LGPL License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ryvencore-0.4.0a4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ff95cee2bdad8dde7b735ae818045d145f8e1ad9227627030eb040ced21211a |
|
MD5 | a24aca2b831edbff5a6fba0b8b378358 |
|
BLAKE2b-256 | 23ba5fb6f9ffe0d4fb9f7c4793ce55457f6f99efca8fbd551da6a981d21411b4 |