# maclin-oss/dfflow architecture

> Architecture diagram of the GitHub repository maclin-oss/dfflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maclin-oss/dfflow
- Repository: https://github.com/maclin-oss/dfflow

## Overview

dfflow is an observability-first engine for transforming pandas DataFrames. A user supplies a DataFrame and configures a FlowPipeline with steps and conditional branches; running it applies transformations, optionally caches unchanged inputs, logs progress, and reports per-step data changes before returning the result. Separate capabilities include built-in cleaning steps, profiling, and ASCII pipeline visualization. The execution, diff, formatter, logger, hashing, decorator, and visualization relationships are supported by the sampled source; the profiler is documented and indexed but its implementation was not sampled.

Main entry points: [`dfflow/core/pipeline.py`](https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/pipeline.py) (FlowPipeline), [`dfflow/steps/cleaning.py`](https://github.com/maclin-oss/dfflow/blob/main/dfflow/steps/cleaning.py) (Cleaning steps), [`dfflow/diff/observability_formatter.py`](https://github.com/maclin-oss/dfflow/blob/main/dfflow/diff/observability_formatter.py) (Report formatter), [`dfflow/decorators/step_decorator.py`](https://github.com/maclin-oss/dfflow/blob/main/dfflow/decorators/step_decorator.py) (Step decorator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_execution["Pipeline execution"]
  node_pipeline["FlowPipeline<br/>[pipeline.py]"]
  node_step["Step<br/>[step.py]"]
  node_branch["Branch<br/>[branch.py]"]
  node_exceptions["Step errors<br/>[exceptions.py]"]
end

subgraph group_transforms["Transformation tools"]
  node_decorator["Step decorator<br/>[step_decorator.py]"]
  node_cleaning["Cleaning steps<br/>[cleaning.py]"]
  node_hashing["Content hashing<br/>[hashing.py]"]
end

subgraph group_observability["Observability"]
  node_diff["DataFrame diffs<br/>[dataframe_diff.py]"]
  node_formatter["Report formatter"]
  node_logger["DFLogger<br/>[logger.py]"]
  node_profiler["DataProfiler<br/>[profiler.py]"]
end

subgraph group_interfaces["Pipeline interfaces"]
  node_visualizer["Pipeline visualizer<br/>[pipeline_viz.py]"]
end

node_engineer(("Pipeline user"))
node_input["Input DataFrame"]
node_output["Result DataFrame"]

node_engineer -->|"provides"| node_input
node_engineer -->|"configures"| node_pipeline
node_input -->|"runs"| node_pipeline
node_pipeline -->|"executes"| node_step
node_pipeline -->|"evaluates"| node_branch
node_pipeline -->|"hashes inputs"| node_hashing
node_pipeline -->|"formats reports"| node_formatter
node_pipeline -->|"writes progress"| node_logger
node_pipeline -->|"raises"| node_exceptions
node_formatter -->|"computes metrics"| node_diff
node_cleaning -->|"uses"| node_decorator
node_pipeline -->|"reads metadata"| node_decorator
node_pipeline -->|"renders structure"| node_visualizer
node_pipeline -->|"returns"| node_output
node_engineer -->|"adds steps"| node_cleaning
node_engineer -.->|"profiles data"| node_profiler
node_engineer -->|"requests diagram"| node_visualizer

click node_pipeline "https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/pipeline.py"
click node_step "https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/step.py"
click node_branch "https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/branch.py"
click node_exceptions "https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/exceptions.py"
click node_decorator "https://github.com/maclin-oss/dfflow/blob/main/dfflow/decorators/step_decorator.py"
click node_cleaning "https://github.com/maclin-oss/dfflow/blob/main/dfflow/steps/cleaning.py"
click node_hashing "https://github.com/maclin-oss/dfflow/blob/main/dfflow/utils/hashing.py"
click node_diff "https://github.com/maclin-oss/dfflow/blob/main/dfflow/diff/dataframe_diff.py"
click node_formatter "https://github.com/maclin-oss/dfflow/blob/main/dfflow/diff/observability_formatter.py"
click node_logger "https://github.com/maclin-oss/dfflow/blob/main/dfflow/logging/logger.py"
click node_profiler "https://github.com/maclin-oss/dfflow/blob/main/dfflow/profiling/profiler.py"
click node_visualizer "https://github.com/maclin-oss/dfflow/blob/main/dfflow/viz/pipeline_viz.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pipeline,node_step,node_branch,node_exceptions,node_engineer toneBlue
class node_decorator,node_cleaning,node_hashing toneAmber
class node_diff,node_formatter,node_logger,node_profiler toneMint
class node_visualizer toneRose
class node_input,node_output toneIndigo
```

## Components

### Pipeline execution

- [FlowPipeline](https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/pipeline.py): `dfflow/core/pipeline.py`
- [Step](https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/step.py): `dfflow/core/step.py`
- [Branch](https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/branch.py): `dfflow/core/branch.py`
- [Step errors](https://github.com/maclin-oss/dfflow/blob/main/dfflow/core/exceptions.py): `dfflow/core/exceptions.py`

### Transformation tools

- [Step decorator](https://github.com/maclin-oss/dfflow/blob/main/dfflow/decorators/step_decorator.py): `dfflow/decorators/step_decorator.py`
- [Cleaning steps](https://github.com/maclin-oss/dfflow/blob/main/dfflow/steps/cleaning.py): `dfflow/steps/cleaning.py`
- [Content hashing](https://github.com/maclin-oss/dfflow/blob/main/dfflow/utils/hashing.py): `dfflow/utils/hashing.py`

### Observability

- [DataFrame diffs](https://github.com/maclin-oss/dfflow/blob/main/dfflow/diff/dataframe_diff.py): `dfflow/diff/dataframe_diff.py`
- [Report formatter](https://github.com/maclin-oss/dfflow/blob/main/dfflow/diff/observability_formatter.py): `dfflow/diff/observability_formatter.py`
- [DFLogger](https://github.com/maclin-oss/dfflow/blob/main/dfflow/logging/logger.py): `dfflow/logging/logger.py`
- [DataProfiler](https://github.com/maclin-oss/dfflow/blob/main/dfflow/profiling/profiler.py): `dfflow/profiling/profiler.py`

### Pipeline interfaces

- [Pipeline visualizer](https://github.com/maclin-oss/dfflow/blob/main/dfflow/viz/pipeline_viz.py): `dfflow/viz/pipeline_viz.py`

### Other components

- **Pipeline user**
- **Input DataFrame**
- **Result DataFrame**

## Connections

- Pipeline user → Input DataFrame: provides (evidence: `README.md`)
- Pipeline user → FlowPipeline: configures (evidence: `README.md`)
- Input DataFrame → FlowPipeline: runs (evidence: `README.md`)
- FlowPipeline → Step: executes (evidence: `dfflow/core/pipeline.py`)
- FlowPipeline → Branch: evaluates (evidence: `dfflow/core/pipeline.py`)
- FlowPipeline → Content hashing: hashes inputs (evidence: `dfflow/core/pipeline.py`)
- FlowPipeline → Report formatter: formats reports (evidence: `dfflow/core/pipeline.py`)
- FlowPipeline → DFLogger: writes progress (evidence: `dfflow/core/pipeline.py`)
- FlowPipeline → Step errors: raises (evidence: `dfflow/core/pipeline.py`)
- Report formatter → DataFrame diffs: computes metrics (evidence: `dfflow/diff/observability_formatter.py`)
- Cleaning steps → Step decorator: uses (evidence: `dfflow/steps/cleaning.py`)
- FlowPipeline → Step decorator: reads metadata (evidence: `dfflow/core/pipeline.py`)
- FlowPipeline → Pipeline visualizer: renders structure (evidence: `dfflow/core/pipeline.py`)
- FlowPipeline → Result DataFrame: returns (evidence: `README.md`)
- Pipeline user → Cleaning steps: adds steps (evidence: `README.md`)
- Pipeline user → DataProfiler: profiles data (evidence: `README.md`)
- Pipeline user → Pipeline visualizer: requests diagram (evidence: `README.md`)
