PHPackages                             simsoft/data-flow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. simsoft/data-flow

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

simsoft/data-flow
=================

A simple ETL pipeline data flow.

1.0.11(1y ago)0106MITPHPPHP &gt;=8.2

Since Nov 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/sim-soft/data-flow)[ Packagist](https://packagist.org/packages/simsoft/data-flow)[ RSS](/packages/simsoft-data-flow/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (15)Used By (0)

Introduction
============

[](#introduction)

Simple ETL Pipeline data flow.

Install
-------

[](#install)

```
composer require simsoft/data-flow
```

Basic Usage
-----------

[](#basic-usage)

Example using extract, transform and load.

```
require "vendor/autoload.php";

use Simsoft\DataFlow\DataFlow;

(new DataFlow())
    ->from([1, 2, 3])
    ->transform(function($num) {
        return $num * 2;
    })
    ->load(function($num) {
        echo $num . PHP_EOL;
    })
    ->run();

// Output:
// 2
// 4
// 6
```

Limit
-----

[](#limit)

Limit data output.

```
require "vendor/autoload.php";

use Simsoft\DataFlow\DataFlow;

(new DataFlow())
    ->from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    ->transform(function($num) {
        return $num * 2;
    })
    ->limit(5)  // output only 5 data.
    ->load(function($num) {
        echo $num . PHP_EOL;
    })
    ->run();

// Output:
// 2
// 4
// 6
// 8
// 10
```

Filter
------

[](#filter)

Filter method help you to filter the data.

```
require "vendor/autoload.php";

use Simsoft\DataFlow\DataFlow;

(new DataFlow())
    ->from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    ->filter(function($num) {
        // The call back should return bool.
        // In this case, return even number only.
        return $num % 2 === 0;
    })
    ->load(function($num) {
        echo $num . PHP_EOL;
    })
    ->run();

// Output:
// 2
// 4
// 6
// 8
// 10
```

Chunk
-----

[](#chunk)

Splitting data into smaller, manageable parts of a fixed size

```
(new DataFlow())
    ->from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
    ->chunk(3) // set chunk size
    ->load(function(array $chunk, $key) {
        echo $key . '=' . json_encode($chunk, JSON_THROW_ON_ERROR) . PHP_EOL;
    })
    ->run();

// Output:
// 0=[1,2,3]
// 1=[4,5,6]
// 2=[7,8,9]
// 3=[10]
```

Mapping
-------

[](#mapping)

Mapping method allow you to convey the data to another format.

```
(new DataFlow())
    ->from([
        ['First Name' => 'John', 'Last Name' => 'Doe', 'age' => 20],
        ['First Name' => 'Jane', 'Last Name' => 'Doe', 'age' => 30],
        ['First Name' => 'John', 'Last Name' => 'Smith', 'age' => 50],
        ['First Name' => 'Jane', 'Last Name' => 'Smith', 'age' => 60],
    ])
    ->map([
        // rename the key
        'first_name' => 'First Name',
        'last_name' => 'Last Name',

        // customise data via callback method.
        'full_name' => fn($data) => $data['first_name'] . ' ' . $data['last_name'],
        'senior' => fn($data) => $data['age'] > 30 ? 'Yes' : 'No',
    ])
    ->load(function($data) {
        echo $data['full_name'] . ' is ' . $data['age'] . ' years old. ' . $data['senior'] . PHP_EOL;
    })
    ->run();

// Output:
// John Doe is 20 years old. No
// Jane Doe is 30 years old. Yes
// John Smith is 50 years old. Yes
// Jane Smith is 60 years old. Yes
```

Flow Continuation
-----------------

[](#flow-continuation)

Connecting flows into a chain.

```
$flow1 = (new DataFlow())
    ->from([1, 2, 3])
    ->transform(function($num) {
        return $num * 2;
    });

(new DataFlow())
    ->from($flow1) // connect flow1 to flow2.
    ->transform(function($num) {
        return $num * 3;
    })
    ->load(function($num) {
        echo $num . PHP_EOL;
    })
    ->run();

// Output:
// 6
// 12
// 18
```

Advanced Usage
--------------

[](#advanced-usage)

1. [Using Closure](docs/01-USING_CLOSURE.md)
2. [Useful Processors](docs/02-USEFUL_PROCESSORS.md)
3. [Customized ETL Processor](docs/03-CUSTOMIZED_PROCESSOR.md)
4. [Create Reusable Data Flow](docs/04-CONTROLLABLE_DATAFLOW.md)
5. [Using Payload](docs/05-USING_PAYLOAD.md)
6. [Macro &amp; Mixin](docs/06-MACRO_AND_MIXIN.md)

License
-------

[](#license)

The Simsoft DataFlow is licensed under the MIT License. See the [LICENSE](LICENSE) file for details

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance49

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Recently: every ~21 days

Total

12

Last Release

378d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c3e6315469b56ed1797318e31e05bcddb12dba268488a2fb0cd2b43971c9ac3?d=identicon)[vzangloo](/maintainers/vzangloo)

---

Top Contributors

[![sim-soft](https://avatars.githubusercontent.com/u/118705222?v=4)](https://github.com/sim-soft "sim-soft (24 commits)")[![vzangloo](https://avatars.githubusercontent.com/u/1908200?v=4)](https://github.com/vzangloo "vzangloo (24 commits)")

---

Tags

phpetldata flowsimsoft

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/simsoft-data-flow/health.svg)

```
[![Health](https://phpackages.com/badges/simsoft-data-flow/health.svg)](https://phpackages.com/packages/simsoft-data-flow)
```

###  Alternatives

[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.4M28](/packages/rubix-ml)[godbout/dash-docset-builder

Dash (LOVE) Docset Builder in PHP (LOVE).

1253.5k](/packages/godbout-dash-docset-builder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
