Skip to content
@flow-php

Flow PHP

img

Flow is a PHP-based, strongly typed ETL (Extract, Transform, Load) and asynchronous data processing framework with low memory consumption thanks to its generator-based architecture.

Latest Stable Version Latest Unstable Version License Test Suite

Tip

In case of any questions, feel free to join our Discord Discrod Server

Supported PHP versions: PHP 8.1 PHP 8.2 PHP 8.3


Usage Example

Thanks to its rich collection of adapters, Flow can read and write data between sources and destinations while applying defined transformations on the fly.

<?php

declare(strict_types=1);

use function Flow\ETL\Adapter\Parquet\{from_parquet, to_parquet};
use function Flow\ETL\DSL\{data_frame, lit, ref, sum, to_output, overwrite};
use Flow\ETL\Filesystem\SaveMode;

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

data_frame()
    ->read(from_parquet(__DIR__ . '/orders_flow.parquet'))
    ->select('created_at', 'total_price', 'discount')
    ->withEntry('created_at', ref('created_at')->cast('date')->dateFormat('Y/m'))
    ->withEntry('revenue', ref('total_price')->minus(ref('discount')))
    ->select('created_at', 'revenue')
    ->groupBy('created_at')
    ->aggregate(sum(ref('revenue')))
    ->sortBy(ref('created_at')->desc())
    ->withEntry('daily_revenue', ref('revenue_sum')->round(lit(2))->numberFormat(lit(2)))
    ->drop('revenue_sum')
    ->write(to_output(truncate: false))
    ->withEntry('created_at', ref('created_at')->toDate('Y/m'))
    ->saveMode(overwrite())
    ->write(to_parquet(__DIR__ . '/daily_revenue.parquet'))
    ->run();
$ php daily_revenue.php
+------------+---------------+
| created_at | daily_revenue |
+------------+---------------+
|    2023/10 |    206,669.74 |
|    2023/09 |    227,647.47 |
|    2023/08 |    237,027.31 |
|    2023/07 |    240,111.05 |
|    2023/06 |    225,536.35 |
|    2023/05 |    234,624.74 |
|    2023/04 |    231,472.05 |
|    2023/03 |    231,697.36 |
|    2023/02 |    211,048.97 |
|    2023/01 |    225,539.81 |
+------------+---------------+
10 rows

Sponsors

Flow PHP is sponsored by:

  • Blackfire - the best PHP profiling and monitoring tool!

Pinned Loading

  1. flow flow Public

    Flow PHP - data processing framework

    PHP 491 28

  2. etl etl Public

    PHP - ETL (Extract Transform Load) data processing library

    PHP 350 21

  3. etl-adapter-doctrine etl-adapter-doctrine Public

    PHP ETL Adapter: Doctrine

    PHP 3 2

  4. etl-adapter-json etl-adapter-json Public

    PHP ETL Adapter: JSON

    PHP 6 3

  5. etl-adapter-xml etl-adapter-xml Public

    PHP ETL Adapter: XML

    PHP 4 2

Repositories

Showing 10 of 36 repositories
  • flow Public

    Flow PHP - data processing framework

    flow-php/flow’s past year of commit activity
    PHP 491 MIT 28 16 2 Updated Nov 29, 2024
  • github-insights Public

    GitHub Insights - demo app that uses FlowPHP to consume and visualize GitHub data.

    flow-php/github-insights’s past year of commit activity
    PHP 3 2 0 12 Updated Nov 28, 2024
  • flow-php.com Public

    🐘 Flow PHP website

    flow-php/flow-php.com’s past year of commit activity
    HTML 0 1 0 0 Updated Nov 22, 2024
  • snappy Public

    Pure PHP implementation of Google Snappy compression algorithm

    flow-php/snappy’s past year of commit activity
    PHP 7 MIT 0 0 0 Updated Nov 22, 2024
  • dremel Public

    PHP ETL - implementation of algorithms described in Google Dremel paper

    flow-php/dremel’s past year of commit activity
    PHP 2 MIT 0 0 0 Updated Nov 22, 2024
  • flow-php/azure-sdk’s past year of commit activity
    PHP 0 MIT 0 0 0 Updated Nov 22, 2024
  • parquet Public

    PHP ETL - parquet library

    flow-php/parquet’s past year of commit activity
    PHP 19 MIT 0 0 0 Updated Nov 22, 2024
  • array-dot Public

    Helper functions to access arrays in custom array dot notation

    flow-php/array-dot’s past year of commit activity
    PHP 13 MIT 3 0 0 Updated Nov 22, 2024
  • doctrine-dbal-bulk Public

    Doctrine DBAL Bulk Operations for selected database engines

    flow-php/doctrine-dbal-bulk’s past year of commit activity
    PHP 9 MIT 5 0 0 Updated Nov 22, 2024
  • flow-php/filesystem’s past year of commit activity
    PHP 5 MIT 1 0 0 Updated Nov 22, 2024

Top languages

PHP Ruby HTML

Most used topics

Loading…