Skip to main content

feedforward

This library makes it easy to run a linear DAG while extracting magical parallelism if some steps don't make changes to some values.

Comparison to dataflow

Sure, this is a dataflow-esque library that allows you to do transforms on items in one direction towards a goal. Where it differs from other dataflow models is that there is only map and the items can never never change type (for a given key).

Additionally all steps and inputs need to be known up front, but that isn't a restriction of the core algorithm, just in the name of readability.

In exchange for those restrictions, you get a lot of API simplicity, as well as the ability to run future steps eagerly given sufficient slots and automatic bundling into "batches" of items like xargs does to amortize child set-up times.

Restrictions

  • The steps need to be decided up front (although it's cheap to have steps that maybe don't do anything). This includes the order that they will apply in.
  • Steps ought to be deterministic and idempotent within a run (if they aren't, you should mark individual steps eager=False or enable deliberate=True on the Run, which only uses intra-step parallelism).
  • Steps ought to have static relationships between the inputs and output keys such as %.py input changes potentially affecting %.java outputs, using the wildcard % you might know from Make. If you don't (say, files can include other arbitrary files), then you might need to model this as any input change invalidating all output keys which will tend to be inefficient.
  • Steps ought to not change the type of a key's value (although they can create new keys, or delete existing keys, so you can work around this by including the type in the key and still get correctness). If you wanted to support str <=> int transformations on the same key, this will only work if all subsequent steps work with either.
  • Your input values, as well as all intermediate output values, need to fit in memory. Nothing keeps you from using filenames, urls, or CAS keys as the value though.

Version Compat

Usage of this library should work back to 3.8, but development (and mypy compatibility) only on 3.10-3.12. Linting requires 3.12 for full fidelity.

Versioning

This library follows meanver which basically means semver along with a promise to rename when the major version changes.

License

feedforward is copyright Tim Hatch, and licensed under the MIT license. See the LICENSE file for details.

Metadata

Release files for feedforward 0.8.0

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

Source distribution (sdist)

Source distribution for feedforward 0.8.0
File Size Uploaded
feedforward-0.8.0.tar.gz 133.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for feedforward 0.8.0
File Interpreter ABI Platform
feedforward-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 144.7 kB

Release files / feedforward-0.8.0.tar.gz

Download URL feedforward-0.8.0.tar.gz
Size 133.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e9b8482b86d74de62af415718d5e16dbaf88afd1cf770dc2326ea498f5ac1399
BLAKE2b-256 checksum
How to use checksums
e161028a56f9e28e63506e9243dc7461554ceda1b74d2adb8910ad1e21623f79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2025.

Transparency log

Release files / feedforward-0.8.0-py3-none-any.whl

Download URL feedforward-0.8.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec1adcfa81b340024bf9d85eeb8f39c551fa437491b9e795e1ab34068a87a3c8
BLAKE2b-256 checksum
How to use checksums
178c90062e2c3197cf79e743488fe21fb05465afaa9b440eae53dd724694b13a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2025.

Transparency log
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