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

Support tabular formats: jsonlines, csv #28

Open
cmungall opened this issue Mar 9, 2024 · 1 comment
Open

Support tabular formats: jsonlines, csv #28

cmungall opened this issue Mar 9, 2024 · 1 comment

Comments

@cmungall
Copy link

cmungall commented Mar 9, 2024

It would be handy to have direct support for jsonl and CSV/TSV formats.

The easy workaround is:

jq -s '{ "items": . }' my.jsonl jinjanate my.j2 --format json

(assuming my jinja2 iterates through a key items)

or

jq -s . my.jsonl jinjanate my.j2 --format json --format-option array-name=items

Similarly, for CSV/TSV input tools like csvjson can easily do the processing up-front

So low priority but would be handy to avoid boilerplate preprocessing

@kpfleming
Copy link
Owner

Definitely an interesting idea, and this sort of thing is the reason why plugin support was created :-)

If the preprocessing can be done by a Python package, then creating a plugin would be fairly easy to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants