Skip to main content

Python backend for node editor-like graph-based processing

Project description

drawing

An experimental Python library for graph-based processing, designed for flow-based/node-based visual scripting editors. It is the backbone of the Ryven project, but it can very much be used in other contexts as well.

While ryvencore is written purely in Python, 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. ryvencore also seems compatible with most Python ports to WebAssembly, even the Cython compiled 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. Generally, the API is defined by what is included in the docs.

Examples

loading a project e.g. exported from Ryven

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)

    # access the first flow
    f = session.flows[0]
    
    # and the last node that was created
    my_node = f.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 (WIP)

Licensing

ryvencore is licensed under the LGPL License.

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.5.0.tar.gz (116.7 kB view details)

Uploaded Source

Built Distribution

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

ryvencore-0.5.0-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

Details for the file ryvencore-0.5.0.tar.gz.

File metadata

  • Download URL: ryvencore-0.5.0.tar.gz
  • Upload date:
  • Size: 116.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for ryvencore-0.5.0.tar.gz
Algorithm Hash digest
SHA256 fdc09fcbedc42e62743e3a4255f0325ede47e44ab4ffe17168956ff03bc28e42
MD5 cfc65259089d63ea034871427b7d52a8
BLAKE2b-256 f82720364c87ec329a23f5929d1c2ca31121e226e780f43746bf4fa2759364c0

See more details on using hashes here.

File details

Details for the file ryvencore-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: ryvencore-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 50.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for ryvencore-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbae42c24f3465585afbd59ba5b7ead6e2a1c975bee939da62a531da2190c836
MD5 c12bda8286e7f746cb016271a62fa704
BLAKE2b-256 bd54714904cb3c67198735bd4c878c1b4cbe7d884b80331147ba13297156ef37

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