Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/defra/ffc-pay-etl-framework


https://github.com/defra/ffc-pay-etl-framework

Last synced: 6 days ago
JSON representation

Awesome Lists containing this project

README

        

## 🚀 Features

[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)

- 💾 CSV Source and Destination
- 👮 Validators
- 🤖 Transformers
- 🚨 Error Checking
- 🐘 Write directly to Postgres
- 👨‍⚕️ Intellisense

## 📦 Install

```bash
npm install --save-dev ffc-pay-etl-framework
```

## 🪄 Usage

```js
// ESM
import {
Etl,
Loaders,
Validators,
Transformers,
Destinations,
} from "ffc-pay-etl-framework";

// CJS
const {
Etl,
Loaders,
Validators,
Transformers,
Destinations,
} = require("ffc-pay-etl-framework");

let csvFile = `${process.cwd()}/test/fixtures/SoilType.csv`;
const spinner = new pkg.Spinner().start("Running ETL Pipeline");

const etl = new Etl.Etl();

etl
.loader(Loaders.CSVLoader({ path: csvFile, columns: columns }))
.transform(
Transformers.FakerTransformer({
columns: [
{
name: "Dist Name",
faker: "location.city",
},
],
})
)
.destination(
Destinations.CSVFileDestination({
fileName: "SoilType_Output.csv",
headers: true,
includeErrors: false,
quotationMarks: true,
})
)
.pump()
.on("finish", () => {
//Update spinner
spinner.succeed("ETL Pipeline - succeeded");
})
.on("result", (data) => {
console.log(data); // emits the last row with error information
});
```

## 📢 Shout outs

[Faker JS](https://fakerjs.dev/guide/)

[Validator](https://github.com/validatorjs/validator.js)

[Kaggle](https://www.kaggle.com/datasets/anushkahedaoo/farming-factors)

## ✨ Contributing

Please make sure to read the [Contributing Guide](https://github.com/DEFRA/ffc-pay-etl-framework/blob/next/CONTRIBUTING.md) before making a pull request.

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Charlie Benger-Stevenson
Charlie Benger-Stevenson

💻
Leigh Godson
Leigh Godson

💻
Sam Plackett
Sam Plackett

💻





Add your contributions



This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!