This Python code helps convert several individual JSON files, locally, into one CSV. Additionally, this code allows the user to cherry-pick the field names from the JSON dataset.
To run the code and get the expected output, use the following steps:
- Compile all JSON files into one folder, locally.
- Note: there shouldn't be any other file types or sub-folders
- Open the Python script in your IDE.
- Set up the following variables based on your preferences:
file_path
: Enter the path to the JSON and the filename without appending.json
key_list
: Extract data from the defined key nameskey_ignore
: Key names to ignore separated by a vertical bar (|
)