mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: add csv2json and json2csv scripts
This commit is contained in:
14
.bin/csv2json
Executable file
14
.bin/csv2json
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import csv
|
||||
import json
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--delimiter", "-d", default=",", help="CSV field separator")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if __name__ == "__main__":
|
||||
json.dump(list(csv.DictReader(sys.stdin, delimiter=args.delimiter)), sys.stdout)
|
||||
Reference in New Issue
Block a user