Skip to content

Commit

Permalink
Cleaned up the pipeline local_csv_file_to_json
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthaI committed Dec 12, 2023
1 parent a96dcbb commit aebebcc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
17 changes: 15 additions & 2 deletions csv_to_json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@

The CSV to JSON mod provides a convenient and efficient way to convert CSV data from a local CSV file into a JSON format.

## Getting Started

### Credentials

No credentials are required.


## Usage

- Run the pipeline with the appropriate arguments.
Run the pipeline with the appropriate arguments.

```sh
flowpipe pipeline run local_csv_file_to_json --arg local_csv_file_path="/Users/bob/Desktop/students.csv"
```

### Configuration

- For a local csv file run, `flowpipe pipeline run local_csv_file_to_json --arg local_csv_file_path="/Users/bob/Desktop/students.csv"`
No additional configuration is required.
11 changes: 5 additions & 6 deletions csv_to_json/local_csv_file_to_json.fp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ pipeline "local_csv_file_to_json" {
title = "Convert Local CSV File To JSON"
description = "Read a CSV file and transform it into JSON format."

tags = {
type = "featured"
}

# Input: Path to the CSV file
param "local_csv_file_path" {
type = string
Expand All @@ -20,14 +24,9 @@ pipeline "local_csv_file_to_json" {
value = file("${param.local_csv_file_path}")
}

output "csv_decoded" {
description = "Decoded data from the CSV file."
value = csvdecode(file("${param.local_csv_file_path}"))
}

output "csv_to_json" {
description = "CSV file converted to JSON."
value = step.transform.local_csv_file_to_json.value
value = jsondecode(step.transform.local_csv_file_to_json.value)
}

}
7 changes: 4 additions & 3 deletions csv_to_json/mod.fp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod "csv_to_json" {
title = "CSV to JSON"
description = "Convert the CSV contents to JSON."
categories = ["productivity"]
title = "CSV to JSON"
description = "Convert the CSV contents to JSON."
documentation = file("./README.md")
categories = ["productivity"]
}

0 comments on commit aebebcc

Please sign in to comment.