I would take thought Pandas first with use json_normalize(),then use
There is also Foundation import that you don't see so then the table look better.
Html output of zz.json Features
df.to_csv(index=False)
.import pandas as pd from pprint import pprint import json with open('zz.json') as f: data = json.loads(f.read()) #df = pd.read_json('attachment.json', orient='index') df = pd.json_normalize(data, record_path=['features']) pprint(df) html_out = df.to_html(index=False)
type ... geometry.coordinates 0 Feature ... [-168.93819999971066, 53.75961000002098] 1 Feature ... [-156.47280000002033, 20.898610000380238] 2 Feature ... [-146.34639999974192, 61.124730000130796] 3 Feature ... [-164.53890000013152, 67.71917999998502] 4 Feature ... [-117.17840000026474, 32.708209999763774] 5 Feature ... [-122.21401199961349, 37.50536000026958] .... ectSo it want dispaly all,could fix this but i also save to Html.
There is also Foundation import that you don't see so then the table look better.
Html output of zz.json Features
print(df.to_csv(index=False))
Output:type,properties.OBJECTID_1,properties.OBJECTID,properties.ID,properties.PORT,properties.PORT_NAME,properties.GRAND_TOTA,properties.FOREIGN_TO,properties.IMPORTS,properties.EXPORTS,properties.DOMESTIC,geometry.type,geometry.coordinates
Feature,1,1,124,C4947,"Unalaska Island, AK",1652281,1236829,426251,810578,415452,Point,"[-168.93819999971066, 53.75961000002098]"
Feature,2,2,85,C4410,"Kahului, Maui, HI",3615449,20391,20391,0,3595058,Point,"[-156.47280000002033, 20.898610000380238]"
Feature,10,10,27,C4816,"Valdez, AK",25807750,249648,0,249648,25558102,Point,"[-146.34639999974192, 61.124730000130796]"
Feature,11,11,130,C4978,"Kivilina, AK",1359589,3367,3367,0,1356222,Point,"[-164.53890000013152, 67.71917999998502]"
.... ect