Skip to main content

proFlow

proFlow is a Python library for running an ordered sequence of processes against an application state. Each process is a function whose inputs are selected from state (and optionally configuration, parameters, or external data) and whose result is mapped back to state.

Processes should be pure functions: they compute and return values rather than modifying the input state directly. This makes process behavior easier to test and reason about.

Features

  • Run an ordered list of reusable process definitions.
  • Map process inputs and outputs using state attributes and dotted paths.
  • Supply configuration, parameters, external state, and additional inputs.
  • Optionally update supported state objects without mutating the original.
  • Inspect process dependencies and visualize data flows with the analysis tools.

Installation

proFlow requires Python 3.14 or newer and is available on PyPI:

python -m pip install proflow

Quick start

Define a state, a function, and a Process that maps the state value into the function and maps its result back to the state. IMMUTABLE_MODE=True makes the runner return an updated dataclass without modifying the original.

from dataclasses import dataclass

from proflow.objects.interface import I
from proflow.objects.process import Process
from proflow.process_runner import ProcessRunner


@dataclass(frozen=True)
class State:
    count: int = 0


def increment(count: int) -> int:
    return count + 1


increment_process = Process(
    func=increment,
    state_inputs=lambda state: [I(state.count, as_="count")],
    state_outputs=lambda result: [(result, "count")],
)

runner = ProcessRunner(IMMUTABLE_MODE=True)
initial_state = State()
result = runner.run_processes([increment_process], initial_state=initial_state)

assert result.count == 1
assert initial_state.count == 0

How it works

ProcessRunner runs processes in order, passing the state returned by one process to the next. A Process describes the function to call and how its inputs and outputs connect to the surrounding data:

  • Inputs are provided with callables such as state_inputs. Each returns I(value, as_="argument_name") entries; the as_ value becomes the corresponding keyword argument to the function.
  • Outputs are provided by state_outputs. The callable receives the function result and returns (value, "target.path") pairs to write into state.
  • Other input sources include config_inputs, parameters_inputs, external_state_inputs, and additional_inputs.
  • Process options include gate to skip a process, comment and group for descriptions, and args for additional positional arguments.

By default, output mapping updates state in place. Set ProcessRunner(IMMUTABLE_MODE=True) to use the non-mutating update path for supported dataclasses, dictionaries, and lists.

API and examples

The main entry points are:

  • Process defines a function and its input and output mappings.
  • I describes an input value and optional function argument name.
  • ProcessRunner configures and runs processes.
  • proflow/analysis contains process and data-flow inspection tools.
  • proflow/tests/demodata.py contains a small example process sequence; the experiments directory has analysis and visualization examples.

Development

Clone the repository, install the project and development dependencies, then run the tests and style checks:

uv sync --all-groups
source .venv/bin/activate
python -m pytest
ruff check .
ruff format . --check

License

proFlow is distributed under the terms of the MIT License.

Metadata

Release files for proflow 0.7.5

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

Source distribution (sdist)

Source distribution for proflow 0.7.5
File Size Uploaded Provenance Actions
proflow-0.7.5.tar.gz 534.4 kB Without provenance Details for proflow-0.7.5.tar.gz

Built distribution (wheel)

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

Total release size: 606.6 kB

Release files / proflow-0.7.5.tar.gz

Download URL proflow-0.7.5.tar.gz
Size 534.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a171aee748dde57dde7bbf055577bdc3ea5785e63dc969470ca246368b09c6ac
BLAKE2b-256 checksum
How to use checksums
231febf867c57610a27ffcd5db77e8a1ab23ac97f5965874d5543c93ca8c2d10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / proflow-0.7.5-py3-none-any.whl

Download URL proflow-0.7.5-py3-none-any.whl
Size 72.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f05f89a6d4d7dbda5d662866993b3395af56188c79217fc7e89e5f304016c389
BLAKE2b-256 checksum
How to use checksums
a14cead58b0da5e3761adf66fd14a47fa89203029c266e11895ed360c8c6ad86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for proflow 0.7.5

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.

Release history Release notifications | RSS feed

This release

0.7.5 This release

2 release files No provenance

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