Extracts
Read from various data sources.
Transforms
Shape and optimize for your needs.
Loads
Store and secure in one of many available data sinks.
<?php
declare(strict_types=1);
use function Flow\ETL\Adapter\JSON\from_json;
use function Flow\ETL\DSL\{data_frame, to_stream};
require __DIR__ . '/../../../autoload.php';
data_frame()
->read(from_json(
__DIR__ . '/input/dataset.json',
))
->collect()
->write(to_stream(__DIR__ . '/output.txt', truncate: false))
->run();
Output
+----+--------+------------------+--------+
| id | name | email | active |
+----+--------+------------------+--------+
| 1 | John | john@email.com | true |
| 2 | Paul | paul@email.com | true |
| 3 | George | george@email.com | false |
| 4 | Ringo | rino@email.com | true |
+----+--------+------------------+--------+
4 rows