flow php

UNIFIED DATA PROCESSING FRAMEWORK

composer require flow-php/etl ~0.33.0

ChangelogRelease Cycle

play Try Playground

elephant
extract

Extracts

Read from various data sources.

arrow
transform

Transforms

Shape and optimize for your needs.

arrow
load

Loads

Store and secure in one of many available data sinks.

Examples:

Description

Remove rows from your dataset based on conditions. Only rows matching the filter criteria are kept in the result. This is one of the most common operations for selecting a subset of data.

Documentation

Code

play
<?php

declare(strict_types=1);

use function Flow\ETL\DSL\{data_frame, from_array, ref, to_output};

require __DIR__ . '/vendor/autoload.php';

data_frame()
    ->read(from_array([
        ['id' => 1, 'name' => 'Alice', 'age' => 25, 'active' => true],
        ['id' => 2, 'name' => 'Bob', 'age' => 32, 'active' => false],
        ['id' => 3, 'name' => 'Charlie', 'age' => 28, 'active' => true],
        ['id' => 4, 'name' => 'Diana', 'age' => 35, 'active' => true],
        ['id' => 5, 'name' => 'Eve', 'age' => 22, 'active' => false],
    ]))
    ->collect()
    ->filter(ref('active')->isTrue())
    ->write(to_output(truncate: false))
    ->run();

Contributors

Join us on GitHub external resource
scroll back to top