I'm calling up a lot of data through an API, and it's nested within many layers. I want to be able to reference pieces easily, with bracket notation ideally.
Right now, I'm pulling the data and it comes out like this:
{
'status': 'success',
'data':
{
'available_balance': '0.1515',
'pending_withdrawals': '0.0000',
'withdrawable_balance': '0.1515',
'couponable_balance': '0.0000'
}
}
I can do balance["data"] which then outputs:
{
'available_balance': '0.1515',
'pending_withdrawals': '0.0000',
'withdrawable_balance': '0.1515',
'couponable_balance': '0.0000'
}
But what I want is to do something like balance["data"["available_balance"]] and get:
0.1515
balance["data"]["available_balance"]?