20 lines
819 B
Markdown
20 lines
819 B
Markdown
JSON to CSV
|
|
=
|
|
|
|
with support for nested structures (with auto schema)
|
|
|
|
Steps
|
|
|
|
* install required packages `pip install -r requirements.txt`
|
|
* run `python3 main.py`
|
|
* required `--input <dir of input json>`
|
|
* required `--output <dir of output csvs>`
|
|
* (optional) `--delimiter "|"`, change seperator/delimiter , default is |
|
|
* (optional) to merge all json to single csv `--single`, default is one set of csv files for one json
|
|
* (optional) # of records to check records for all headers `--metadata <number or records>` defaults to 1000
|
|
* required `--join-column <column name from first level to use as merge column>`
|
|
* required `--name <base-name of data>`
|
|
* example
|
|
* `python3 main.py --input /var/tmp/input --output /var/tmp/outputs --name transactions --single --metadata 1000 --join-column origin_id`
|
|
|