You will find your output JSON files in the Output JSONs - Filename folder with each JSON named after the corresponding filename column in each row of the input csv file.You will find the output csv file in the Ouput CSV - Filename folder with the name Input file.You will be prompted to enter the name of your CSV file in the terminal, please enter it correctly e.g NFT Naming csv - All Teams.csv.Copy your CSV file into the Input CSV file folder.Which will add empty keys to the JSON generated with this script. Note Before: Please clear all empty columns in the spreadsheet before generating the CSV file to avoid trailing commas Generates a JSON(javascript object notation) file for each row in the CSV file, generates a sha256 hash for each file,Īppends the hash to each JSON and creates a new copy of the CSV file with a new column included for the hash of the JSON generated for each row.ĭependencies: No external library needed. This script accepts a CSV(Comma seperated value) file as input, You can use either the csv.reader function for reading CSV data as lists or the csv.DictReader class for reading CSV data as dictionaries. CSV_JSON-Converter-and-SHA256-Generator About Script Simple python CSV to JSON converter USAGE Install Python (installed by default on OSX) Download csvtojson.py From Terminal run python csvtojson.py input.csv output.json Notes There is no need to specify an output filename (default is output. Reading CSV files in Python using the CSV module is straightforward.
0 Comments
Leave a Reply. |