Skip to content

Commit

Permalink
Add json extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
leomarquine committed Sep 12, 2018
1 parent de07d46 commit d56153f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/Extractors/Json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# JSON Extractor

Extracts data from a JavaScript Object Notation file.

## Options

| Name | Type | Default | Description |
| ---- |----- | ------- | ----------- |
| columns | array | null | Columns that will be extracted. |


## Usage

Default options:
```php
$etl->extract('json', 'path/to/file.json');
```

Custom options:
```php
$options = [
'columns' => [
'id' => '$..bindings[*].id.value',
'name' => '$..bindings[*].name.value'
]
];

$etl->extract('json', 'path/to/file.json', $options);
```
1 change: 1 addition & 0 deletions docs/Extractors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
* [Collection](Collection.md)
* [CSV](Csv.md)
* [Fixed Width](FixedWidth.md)
* [JSON](Json.md)
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
* [Collection](Extractors/Collection.md)
* [CSV](Extractors/Csv.md)
* [Fixed Width](Extractors/FixedWidth.md)
* [JSON](Extractors/Json.md)

0 comments on commit d56153f

Please sign in to comment.