arrounded / extractors
An abstraction layer to extract data from various sources
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 1
pkg:composer/arrounded/extractors
Requires
- php: >=5.5.9
- league/csv: ^7.1
Requires (Dev)
- fabpot/php-cs-fixer: 2.0.*@dev
- mockery/mockery: ^0.9.4
- phpspec/phpspec: ^2.2
- phpunit/phpunit: ^4.7
- symfony/var-dumper: ^2.7
This package is auto-updated.
Last update: 2019-11-15 14:46:48 UTC
README
Install
Via Composer
$ composer require arrounded/extractors
Usage
The idea is that you extend the existing extractors, which provide the minimal functionality, and tweak it for your use case.
For example (using the CsvExtractor)
class MyExtractor extends CsvExtractor { public function getData(array $data = []) { // $data contains the entire content of a row in the CSV // You can return whatever you need from the row. return $data; } } // Using the extractor $extractor = new MyExtractor(); $extractor->setFixture('path/to/data.csv'); $extractor->run(function ($data) { // $data contains whatever is the output of `MyExtractor::getData()`. // Persist in database });
Testing
$ composer test
License
The MIT License (MIT). Please see License File for more information.