API parsing data into table from dictionnary to actual data

Hi, I acheived to parse data from the web using the web client DAT. But I got a long string wich seems to be a Python dictionnary. I use this code to put my data in a Table like i wanted to but my data are still between curly braces.

    jsonDict = json.loads(data)
    	op('clear_table').run()

    	for i in jsonDict['data']['stations']:
    		op('data').appendRow(i)

The content of each row look like this :
{'station_id': '1', 'num_bikes_available': 12, 'num_ebikes_available': 5, 'num_bikes_disabled': 0, 'num_docks_available': 19, 'num_docks_disabled': 0, 'is_installed': 1, 'is_renting': 1, 'is_returning': 1, 'last_reported': 1601478805, 'eightd_has_available_keys': False, 'is_charging': False}

I want to acces the value of every key in the dictionnary, but since the dictionnary is not declared as a variable I cannot acces his content. When I tried to print the content of the cell I got a None value.

What is the best way to acces that data?

Thank you
LP

try the following line
op(‘data’).appendRow( [ i[key] for key in i ] )
This will append each value of the dictionary i in a new column.
Similiar, you can feed the keys as a header after clearing the table via
op(‘data’).appendRow( [ key for key in jsonDict[‘data’][‘stations’][0] ] )

You can then easily acces the values via op(‘data’)[ index, key ]

Thank you!

It is working now. I see that I have to process the data before putting it in the table.