Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in data.csv plugin #32

Closed
traut opened this issue Jan 13, 2024 · 1 comment
Closed

Built-in data.csv plugin #32

traut opened this issue Jan 13, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@traut
Copy link
Member

traut commented Jan 13, 2024

Background

There should be a way to import existing CSV files.

Design

data.csv plugin should be a part of the fabric binary.

Specification

  • Configuration options:
    • delimiter -- a one-character string used to separate fields. It defaults to ,
  • API interface:
    • required path string attribute that accepts a path to a file on a local filesystem.

Behavior

Using the provided path value, the plugin reads the CSV file and returns a JSON object with the data.

The plugin expects the CSV file to have a header, so the first row is always treated as a header. The CSV file is parsed using the configured delimiter.

The plugin produces a list of dictionaries -- one dictionary per row, with fields corresponding to the column names.

For example, for the CSV file

column_a,column-b,column C
1,2,3
4,5,foo

the plugin will return

[
  {
    "column_a": 1,
    "column-b": 2,
    "column C": 3
  },
  {
    "column_a": 4,
    "column-b": 5,
    "column C": "foo"
  }
]

Deliverables

  • new built-in data.csv plugin
  • the unit tests for the plugin
@traut traut added enhancement New feature or request plugins labels Jan 13, 2024
@traut traut added this to the v0.2 milestone Jan 13, 2024
@dobarx dobarx self-assigned this Jan 16, 2024
@dobarx dobarx mentioned this issue Jan 17, 2024
@traut
Copy link
Member Author

traut commented Jan 17, 2024

implemented in #45

@traut traut closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants