Skip to main content

grapes

A simple library for dataflow programming in python. It allows you to organize your computation as a directed acyclic graph.

Quickstart

For a more detailed explanation, refer to the documentation. Here's what you need to know to get started quickly.

Install grapes from PyPI with

pip install grapes

Define a graph by adding steps and binding functions to them:

import grapes as gr
g = gr.Graph()
gr.add_step(g, "b", "compute_b", "a")
gr.add_step(g, "c", "compute_c", "b")
gr.update_internal_context(g,
    {
        "compute_b": lambda a: 2*a,
        "compute_c": lambda b: b+1
    }
)
gr.finalize_definition(g)

Execute the graph to find your target, starting from your input context.

context = {"a": 3}
target = "c"
result = gr.execute_graph_from_context(g, context, target)
print(result["c"])  # 7

Additional remarks

The bulk of grapes development was done by Giulio Foletto in his spare time. See LICENSE.txt and NOTICE.txt for details on how grapes is distributed.

grapes is inspired by pythonflow but with substantial modifications.

It relies internally on networkx for graph management and on pygraphviz for graph visualization.

Most of the development of grapes was done before AI coding tools were available. However, recent edits (September 2025) were assisted by GitHub Copilot, especially for writing docstrings.

Metadata

Release files for grapes 0.10.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grapes 0.10.4
File Size Uploaded Provenance
grapes-0.10.4.tar.gz 23.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for grapes 0.10.4
File Interpreter ABI Platform
grapes-0.10.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 54.2 kB

Release files / grapes-0.10.4.tar.gz

Download URL grapes-0.10.4.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2c71678e7d7eb98e31483202dac838e5567c2f8d77183339caa90b8966a13aff
BLAKE2b-256 checksum
How to use checksums
cce2397ffd82f4e95df7d3e9e1eec237184fdd7a32e7be91e9cdb46fc1b09dae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / grapes-0.10.4-py2.py3-none-any.whl

Download URL grapes-0.10.4-py2.py3-none-any.whl
Size 30.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e317f11d2448fe5ab352aca98dd2a1996c5481ec61da918149b9d1a34e514ca6
BLAKE2b-256 checksum
How to use checksums
8edc1be739301742e741a687ecd88ba75e8216c5ba81f61658653a705032c97d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for grapes 0.10.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page