20 lines
754 B
Markdown
20 lines
754 B
Markdown
JSON to CSV
|
|
=
|
|
|
|
with support for nested structures
|
|
|
|
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) to merge all json to single csv `--single`
|
|
* required `--schema <path to schema.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 --schema /var/tmp/schema.json --name transactions --single --metadata 1000 --join-column origin_id`
|
|
|