Code Monkey home page Code Monkey logo

pipes's Introduction

Banner

Tests

Packagist PHP Version

Laravel

Packagist Version

Total Downloads

Pipes

Pipes is a PHP Extract Transform Load [ETL] package for Laravel 8+

Installation

composer require jwhulette/pipes

Usage

  1. Create a new EtlPipe object.

  2. Add an extractor to the object to read the input file

    • You can create your own extractor by implementing the ExtractorInterface.php
  3. Add transformers to transform the data

    • You can add as many transformers as you want.

    • You can create your own transformers by implementing the TransformerInterface.php

    • Data is passed to the transformers in the order they are defined

  4. Add a loader to write out the transformed data.

    • You can create your own loader by implementing the LoaderInterface.php
(new EtlPipe())
->extract(new CsvExtractor($this->csvFile));
->transforms([
    new CaseTransformer([], 'lower'),
    new TrimTransformer(),
])
->load(new CsvLoader('saved-file.csv'));
Notes:

Built-in extractors:

  • CsvExtractor
  • XlsxExtractor
  • SqlExtractor

Built-in loaders:

  • CsvLoader
  • SqlLoader

Built-in transformers:

  • CaseTransformer - Change the case of a string
  • DateTimeTransformer - Change the format of a date string
  • PhoneTransformer - Transform a US phone, removing all non numeric characters, and limiting the length to the first 10 digits
  • TrimTransformer - Trim a string
  • ZipcodeTransformer - Transform a US zip code, removing all non numeric characters, and left pad zeros for zip codes less than 5 digits
  • ConditionalTransformer - Transform a column, based on the values of another column

Data is passed to the transformers in the order they are defined

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

pipes's People

Contributors

dependabot[bot] avatar jwhulette avatar ryanmortier avatar tgeorgel avatar wivaku avatar xswirelab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pipes's Issues

composer require fails: Class "jwhulette\Pipes\PipesServiceProvider" not found

Using fresh Laravel 10 project.

composer require jwhulette/pipes
./composer.json has been updated
Running composer update jwhulette/pipes
Loading composer repositories with package information
Updating dependencies
Lock file operations: 4 installs, 0 updates, 0 removals
  - Locking box/spout (v3.3.0)
  - Locking jwhulette/pipes (v1.0.0)
  - Locking league/pipeline (1.0.0)
  - Locking spatie/laravel-package-tools (1.14.2)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
  - Downloading spatie/laravel-package-tools (1.14.2)
  - Downloading league/pipeline (1.0.0)
  - Downloading box/spout (v3.3.0)
  - Downloading jwhulette/pipes (v1.0.0)
  - Installing spatie/laravel-package-tools (1.14.2): Extracting archive
  - Installing league/pipeline (1.0.0): Extracting archive
  - Installing box/spout (v3.3.0): Extracting archive
  - Installing jwhulette/pipes (v1.0.0): Extracting archive
Package box/spout is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In ProviderRepository.php line 206:

  Class "jwhulette\Pipes\PipesServiceProvider" not found

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
find . -name PipesServiceProvider\*
./vendor/jwhulette/pipes/src/PipesServiceProvider.php

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.