my question is how to extract data on two conditions,
- todays date,
- Minimum age limit should be 45 and above
can someone help me to sort this: how to filter the data from given JSON text?
I got the output from the code now I want to find out the center where the availability is there for above 45 age limit and above for today's date. I need to show the whole data of that center
url = 'myurl'
response = urllib.request.urlopen(url)
data = json.loads(response.read())
json_formatted_str = json.dumps(data, indent=2, )
output:
{
"centers": [
{
"center_id": 55,
"name": "abc Hospital GH",
"sessions": [
{
"session_id": "1a",
"date": "06-05-2021",
"available_capacity": 0,
"min_age_limit": 45,
"slots": [
"09:00AM-11:00AM",
"11:00AM-01:00PM",
"01:00PM-03:00PM",
"03:00PM-06:00PM"
]
},
{
"session_id": "2a",
"date": "07-05-2021",
"available_capacity": 0,
"min_age_limit": 45,
}
]
},
{
"center_id": 638690,
"name": "xyz Hospital",
"sessions": [
{
"session_id": "2a",
"date": "06-05-2021",
"available_capacity": 0,
"min_age_limit": 45,
}
]
},
]
}