Plum

Plum is a data processing pipeline that helps you to write structured, reusable and well tested data processing code.

Build Status Scrutinizer Code Quality Code Coverage

Developed by Florian Eckerstorfer in Vienna, Europe.

Features

Plum is a data processing pipeline, that means it reads data, filters and converts it and then writes the data.

  • Filters, converters and even writers are pipeline elements that can be attached to a workflow in arbitrary order
  • Readers are iterators that can return values of arbitrary type: arrays, objects or scalars, it doesn't matter to Plum
  • Conditional converters that are only applied to an item if it passes a filter
  • Ability to concatenate workflow to create smaller and better reusable workflows

Plum has been greatly inspired by ddeboer/data-import.

Installation

You can install Plum using Composer.

$ composer require cocur/plum:dev-master

Usage

You configure and compose your data processing pipeline with a Workflow object; attach filters, converters and writers to the workflow and process it using the process() method.

Working examples can be found in the examples/ directory.

use Cocur\Plum\Workflow;

$workflow = new Workflow();
$workflow->addFilter($filter)
         ->addConverter($converter)
         ->addWriter($writer);
$workflow->process($reader);

Further documentation: