CSV2JSON
🚀 A CLI tool to export CSV files to JSON format.
Requirements
⬇️ Installation
pip install tojson
⌨️ Usage
➜ csv2json --help # You can also use the alias `tojson` or `csvtojson`
usage: csv2json [-h] [-o {dict,list,series,split,records,index}] [-i INDENT]
[-c]
path [path ...]
positional arguments:
path Path to a single file/directory or multiple
files/directories
options:
-h, --help show this help message and exit
-o {dict,list,series,split,records,index}, --orient {dict,list,series,split,records,index}
The type of the values of the dictionary
-i INDENT, --indent INDENT
JSON output indentation
-c, --compress Compress the output
📕 Examples
csv2json foo.csv
csv2json foo.csv -o list
csv2json foo.csv -c -i 0