steff
steff

Reputation: 906

need to parse JSON in Python3

am new to Python and need to parse the date and '4. close' from the following JSON. Would be very grateful for pointers how to do this the pythonic way.

{'2017-01-24': {'1. open': '207.8600',
                 '2. high': '209.4000',
                 '3. low': '207.7479',
                 '4. close': '208.9700',
                 '5. adjusted close': '208.0046',
                 '6. volume': '1940125',
                 '7. dividend amount': '0.00',
                 '8. split coefficient': '1.0000'},...

Upvotes: 0

Views: 987

Answers (1)

Moshe
Moshe

Reputation: 2684

You can parse JSON like this:

import json
from pprint import pprint

with open('path_of_file.json') as data_file:    
    data = json.load(data_file)

pprint(data)

Upvotes: 1

Related Questions