library extractors
An abstraction layer to extract data from various sources
arrounded/extractors
An abstraction layer to extract data from various sources
- Sunday, June 21, 2015
- by Anahkiasen
- Repository
- 3 Watchers
- 0 Stars
- 1 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 1 Open issues
- 1 Versions
- 0 % Grown
, (*1)
Install
Via Composer, (*2)
``` bash
$ composer require arrounded/extractors, (*3)
## 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`)
```php
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
bash
$ composer test
, (*4)
License
The MIT License (MIT). Please see License File for more information., (*5)
dev-master
9999999-dev
An abstraction layer to extract data from various sources
Sources
Download
MIT
The Requires
The Development Requires
by
Madewithlove
csv
extraction