Answer the question
In order to leave comments, you need to log in
How to parse a Json file and add it to the database?
I have a json file, how to parse it and add it to the database?
Locally parse like this:
# -*- coding: utf-8 -*-
import sys
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
import json
s = open('C:\\Users\\...\\...\\2CuNPefD.json').read()
data = json.loads(s)
print json.dumps(data, ensure_ascii=False, indent=3)
{
"data": [
{
"Значение": "288.00",
"Область": "Область какая то",
"Город": "Город какой то"
},
...
],
"structure": [
"Область",
"Город",
"Значение"
]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question