http-status-codes/tsv-to-json.py
2023-11-08 22:59:30 -06:00

12 lines
No EOL
272 B
Python

import csv
import json
data = {}
with open('status-codes.tsv', 'r') as tsvfile:
reader = csv.reader(tsvfile, delimiter=';')
for row in reader:
data[row[0]] = row[1]
with open('status-codes.json', 'w') as jsonfile:
json.dump(data, jsonfile, indent=4)