Extract data from JSON files. Supports reading entire files or targeting specific subtrees using JSON pointers.
UNIFIED DATA PROCESSING FRAMEWORK
composer require flow-php/etl ~0.33.0 Extracts
Read from various data sources.
Transforms
Shape and optimize for your needs.
Loads
Store and secure in one of many available data sinks.
Examples:
Description
Documentation
Code
<?php
declare(strict_types=1);
use function Flow\ETL\Adapter\JSON\from_json;
use function Flow\ETL\DSL\{bool_schema, data_frame, int_schema, schema, str_schema, to_output};
require __DIR__ . '/vendor/autoload.php';
$schema = schema(
int_schema('id'),
str_schema('name'),
str_schema('email'),
bool_schema('active'),
);
data_frame()
->read(
from_json(__DIR__ . '/input/dataset.json')
->withSchema($schema)
)
->collect()
->write(to_output(truncate: false))
->run();