PHPackages                             theovauvilliers/data-flow-bundle - 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. theovauvilliers/data-flow-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

theovauvilliers/data-flow-bundle
================================

A Symfony bundle to build reliable, composable data pipelines with minimal boilerplate.

v1.0.0(6mo ago)06PHPPHP &gt;=8.2

Since Nov 9Pushed 6mo agoCompare

[ Source](https://github.com/TheoVauvilliers/data-flow-bundle)[ Packagist](https://packagist.org/packages/theovauvilliers/data-flow-bundle)[ RSS](/packages/theovauvilliers-data-flow-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (27)Versions (2)Used By (0)

DataFlowBundle
==============

[](#dataflowbundle)

A Symfony bundle to build reliable, composable data pipelines (Read → Process → Write) with minimal boilerplate.

Features
--------

[](#features)

- 📥 **CSV/API/Custom Readers**: pull data from files, HTTP APIs, DB, or any source
- 🔧 **Processor Orchestration**: rename indexes + validate rows before writing
- 📤 **Writers out of the box**: Doctrine ORM writer; easy to add file/API writers
- 🔁 **Transformers**: regular and postponed steps for clean normalization/hydration
- 🧩 **Small, testable building blocks**: plug only what you need

Installation
------------

[](#installation)

### 1. Require the bundle

[](#1-require-the-bundle)

```
composer require theovauvilliers/data-flow-bundle
```

### 2. Enable the bundle

[](#2-enable-the-bundle)

Add the bundle to config/bundles.php:

```
return [
    // ... other bundles
    TheoVauvilliers\DataFlow\TheoVauvilliersDataFlowBundle::class => ['all' => true],
];
```

### 3. Configure Doctrine ORM

[](#3-configure-doctrine-orm)

Create or update `config/packages/doctrine.yaml`:

```
doctrine:
   orm:
      entity_managers:
         default:
            mappings:
               # ... your existing mappings
               TheoVauvilliersDataFlowBundle:
                  type: attribute
                  is_bundle: false
                  dir: '%kernel.project_dir%/vendor/theovauvilliers/data-flow-bundle/src/Entity'
                  prefix: 'TheoVauvilliers\DataFlow\Entity'
                  alias: TVDataFlow
```

### 4. Configure Doctrine Migrations

[](#4-configure-doctrine-migrations)

```
doctrine_migrations:
    migrations_paths:
        # ... your existing paths
        'TheoVauvilliers\DataFlowBundle\Migrations': '%kernel.project_dir%/vendor/theovauvilliers/data-flow-bundle/migrations'
```

### 5. Configure routes

[](#5-configure-routes)

Create a file `config/routes/theovauvilliers_data_flow.yaml` and add the following content:

```
theovauvilliers_data_flow:
    resource: '@TheoVauvilliersDataFlowBundle/src/Controller/'
    type: attribute
    prefix: /{_locale}/data-flow
```

You can replace prefix by any other path you want. You can also remove the locale prefix if you don't use it.

### 6. Run database migration

[](#6-run-database-migration)

Execute the bundle's migration to create the tracking table:

```
php bin/console doctrine:migrations:migrate
```

Usage
-----

[](#usage)

Create a Reader and a Writer, then run the Processor:

```
use TheoVauvilliers\DataFlow\Processor\Processor;
use App\DataFlow\Reader\PoiReader;
use App\DataFlow\Writer\PoiWriter;

$processor->process($reader, $writer, 'name of the import');
```

Typical flow: upload a CSV to a temp path your Reader expects, then call `process()`.

How It Works
------------

[](#how-it-works)

1. 📥 Reader returns an array of rows (CSV/API/DB/etc.).
2. 🧰 Processor loops rows, applies `renameIndexes()` and `validate()` from the Reader.
3. 📤 Writer persists/emits each row (Doctrine ORM, files, APIs…).
4. ✅ Processor calls Writer `end()` for finalization.
5. 🔄 Optional Transformers run pre/post hydration for clean domain data.

Architecture
------------

[](#architecture)

- ReaderInterface + AbstractReader
    - `AbstractCSVReader`: BOM handling, optional header, delimiter auto-detection, empty-line skipping, normalization
    - `AbstractApiReader`: based on Symfony HTTP Client Contracts
- WriterInterface + AbstractWriter
    - `AbstractDatabaseWriter`: load-or-create, batch flushing, simple upsert via `getFindOneParams()`
- Processor: orchestrates Reader → (rename + validate) → Writer and calls `end()`
- Transformers: regular and postponed transformers for staged normalization

Best Practices
--------------

[](#best-practices)

1. Keep Readers/Writers focused on a single dataset/entity
2. Use `getIndexesToRenameOrUnset()` to map input headers quickly
3. Add Symfony Validator constraints in Reader to skip invalid rows early
4. Compose small Transformers instead of big all-in-one mappers
5. For large imports, tune batch size (`MAX_FLUSH`) in `AbstractDatabaseWriter`

Run tools
---------

[](#run-tools)

### PHPUnit

[](#phpunit)

```
docker compose run --rm php vendor/bin/phpunit -c phpunit.xml.dist --colors=always
```

### PHPStan

[](#phpstan)

```
docker compose run --rm php vendor/bin/phpstan analyse -c phpstan.neon --no-progress --ansi --memory-limit=1G
```

### php-cs-fixer

[](#php-cs-fixer)

```
# check (no changes)
docker compose run --rm php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --diff --ansi
# fix in place
docker compose run --rm php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --ansi
```

### Composer

[](#composer)

```
docker compose run --rm composer update
```

### Tips

[](#tips)

- Cache: add `-v $(pwd)/.cache:/tmp/cache` to persist tool caches between runs.
- If your service names differ, replace `php`/`composer` accordingly.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance69

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

181d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f492dde137d772a33669e7b5e22562b115323618e57394dfb8979dec010581c6?d=identicon)[Zoko](/maintainers/Zoko)

---

Top Contributors

[![TheoVauvilliers](https://avatars.githubusercontent.com/u/46577218?v=4)](https://github.com/TheoVauvilliers "TheoVauvilliers (1 commits)")

---

Tags

symfonybundledataexportimport

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M648](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)

PHPackages © 2026

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