Giter Site home page Giter Site logo

php-etl's Introduction

Wizaplace PHP ETL (WP-ETL)

License CircleCI Version Maintenance Ask Me Anything ! PHP Version

Extract, Transform and Load data using PHP. This library provides classes and a workflow to allow you to extract data from various sources (CSV, DB...), one or many, then transform them before saving them in another format.

You can also easily add your custom classes (Extractors, Transformers and Loaders).

ETL

Changelog

See the changelog here

Installation

In your application's folder, run:

composer require wizaplace/php-etl

Example ๐Ÿšˆ

In the example below, we will extract data from a csv file, trim white spaces from the name and email columns and then insert the values into the users table:

use Wizaplace\Etl\Etl;
use Wizaplace\Etl\Extractors\Csv;
use Wizaplace\Etl\Transformers\Trim;
use Wizaplace\Etl\Loaders\Insert;
use Wizaplace\Etl\Database\Manager;
use Wizaplace\Etl\Database\ConnectionFactory;

$connexionFactory = new ConnectionFactory();
$manager = new Manager($connexionFactory);
$etl = new Etl();
$extractor = new Csv();
$transformer = new Trim();
$loader = new Insert($manager);

$etl->extract($extractor, '/path/to/users.csv')
    ->transform(
        $transformer,
        [Step::COLUMNS => ['name', 'email']]
    )
    ->load($loader, 'users')
    ->run();

The library is fully compatible with any PHP project. For instance, with Symfony, you can fully benefit from the autowiring. On the following example, you enable it on the main ETL object, with the shared parameter to false in order to have the possibility to get different instance of the ETL (optionnal).

services.yaml

    Wizaplace\Etl\Etl:
        shared: false

Documentation ๐Ÿ““

The documentation is available in a subfolder of the repo, here.

License

WP-ETL is licensed under the MIT license.

Origin of the project

This project is a fork and an improvement of the marquine/php-etl project by Leonardo Marquine.

php-etl's People

Contributors

arthurhoaro avatar aurelienrasselet avatar devfrey avatar ecourtial avatar gilmojoa avatar hersoncruz avatar kdebisschop avatar leneko avatar leomarquine avatar nicolas-masson-wizaplace avatar tristanhall avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.