node-etl
v1.0.3
Published
Extract, Transform and Load (ETL) Data from between homogeneous or heterogeneous data sources.
Downloads
25
Maintainers
Readme
node-etl :
Extract, Transform and Load (ETL) Data from between homogeneous or heterogeneous data sources.
Install :
npm install node-etl --save;
Extract Process :
Assume , we have data.txt file with the following content :
1 Metouia Gabes TN
2 Laban Riyadh SA
3 Annaba Annaba ALG
9 Mina Mecca SA
1. Simple Extract :
var ETL = require('node-etl');
var extracted=ETL.extract("./data.txt",
{delimitor:" ",headers:["id","town","city","country"]});
Returns an array of objects like below :
[
{id:"1",town:"Metouia",city:"Gabes",country:"TN"},
{id:"2",town:"Laban",city:"Riyadh",country:"SA"},
...
]
2. Custom Extract :
In the previous example , we have the row like {id:1,town:"A",city:"B",country:C}
.
What about if we want an output that:
- joins 2nd and 3rd attributes .
- delete
id
The solution is to use the following options :
- cols :
[[1,2],3]
- cols_headers:
["town_city","country"]
- cols_join
"|"
ETL.extract("./data.txt",{
delimitor:" ",
headers:["id","town","city","country"],
cols:[[1,2],3],
cols_headers:["town_city","country"],
cols_join:"|"
});
Now, output will be :
[
{town_city:"Metouia|Gabes",country:"TN"},
{town_city:"Laban|Riyadh",country:"SA"},
...
]
Load Process :
TODO : implemtation & documentation.
Transfer Process :
TODO : implemtation & documentation.
License :
Copyright (c) 2016 Abdennour TOUMI <http://abdennoor.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.