= [{"session_number":19,"session":19,"date":"2024-06-19T05:13:10.723867Z","weight":65.1,"BMI":18.224573780129337,"total":{"value":4.5,"format":"danger"},"eating_concerns":{"value":5.25,"format":"danger"},"weight_&_shape_concerns":{"value":4,"format":"danger"}},{"session_number":18,"session":18,"date":"2024-06-11T05:13:32.277997Z","weight":65.1,"BMI":18.224573780129337,"total":{"value":4,"format":"danger"},"eating_concerns":{"value":5,"format":"danger"},"weight_&_shape_concerns":{"value":3.3333333333333335,"format":"danger"}},{"session_number":17,"session":17,"date":"2024-06-07T02:34:20.418620Z","weight":65.1,"BMI":18.224573780129337,"total":2.7,"eating_concerns":3.5,"weight_&_shape_concerns":2.1666666666666665},{"session_number":16,"session":16,"date":"2024-05-28T03:54:35.945999Z","weight":65.1,"BMI":18.224573780129337,"total":3.4,"eating_concerns":3.75,"weight_&_shape_concerns":3.1666666666666665},{"session_number":15,"session":15,"date":"2024-05-24T07:39:00.059868Z","weight":65.1,"BMI":18.224573780129337,"total":{"value":4,"format":"danger"},"eating_concerns":4.5,"weight_&_shape_concerns":{"value":3.6666666666666665,"format":"danger"}},{"session_number":14,"session":14,"date":"2024-05-12T01:49:31.347429Z","weight":65.1,"BMI":18.224573780129337,"total":3.5,"eating_concerns":4.5,"weight_&_shape_concerns":2.8333333333333335},{"session_number":13,"session":13,"date":"2024-04-15T07:18:55.556233Z","weight":65.1,"BMI":18.224573780129337,"total":4.4,"eating_concerns":4.5,"weight_&_shape_concerns":{"value":4.333333333333333,"format":"danger"}},{"session_number":12,"session":12,"date":"2024-04-11T00:25:35.546964Z","weight":65.1,"BMI":18.224573780129337,"total":{"value":4.7,"format":"danger"},"eating_concerns":5.5,"weight_&_shape_concerns":{"value":4.166666666666667,"format":"danger"}},{"session_number":11,"session":11,"date":"2024-04-04T21:01:25.720628Z","weight":{"value":65.1,"format":"danger"},"BMI":{"value":18.224573780129337,"format":"danger"},"total":{"value":4.2,"format":"danger"},"eating_concerns":{"value":5.5,"format":"danger"},"weight_&_shape_concerns":3.3333333333333335},{"session_number":10,"session":10,"date":"2024-03-29T16:27:19.297533Z","weight":69.73,"BMI":19.72894975101856,"total":3.8,"eating_concerns":3.5,"weight_&_shape_concerns":{"value":4,"format":"danger"}},{"session_number":9,"session":9,"date":"2024-03-17T14:34:11.461787Z","weight":69.73,"BMI":19.72894975101856,"total":4,"eating_concerns":{"value":4.5,"format":"danger"},"weight_&_shape_concerns":3.6666666666666665},{"session_number":8,"session":8,"date":"2024-03-16T07:21:01.821754Z","weight":69.73,"BMI":19.72894975101856,"total":4.6,"eating_concerns":2,"weight_&_shape_concerns":{"value":6.333333333333333,"format":"danger"}},{"session_number":7,"session":7,"date":"2024-01-30T16:31:24.894254Z","weight":62.4,"BMI":18.036767256330208,"total":4.9,"eating_concerns":{"value":5.25,"format":"danger"},"weight_&_shape_concerns":4.666666666666667},{"session_number":5,"session":5,"date":"2024-01-28T16:26:41.325693Z","weight":62.4,"BMI":{"value":18.036767256330208,"format":"danger"},"total":{"value":4.9,"format":"danger"},"eating_concerns":{"value":4.25,"format":"danger"},"weight_&_shape_concerns":{"value":5.333333333333333,"format":"danger"}},{"session_number":4,"session":4,"date":"2024-01-27T08:00:33.086914Z","weight":62.27,"BMI":21.54671280276817,"total":3.9,"eating_concerns":3,"weight_&_shape_concerns":4.5},{"session_number":3,"session":3,"date":"2024-01-26T22:13:38.872258Z","weight":62.27,"BMI":21.54671280276817,"total":{"value":4.8,"format":"danger"},"eating_concerns":{"value":5,"format":"danger"},"weight_&_shape_concerns":{"value":4.666666666666667,"format":"danger"}},{"session_number":2,"session":2,"date":"2024-01-24T20:06:02.879241Z","weight":62.27,"BMI":21.54671280276817,"total":4.3,"eating_concerns":4.25,"weight_&_shape_concerns":4.333333333333333}] data
Test
Test
= data[0] fields
fields.items()
<function dict.items>
for key, value in fields.items():
if isinstance(value, dict) and value.get("format") == "danger":
print(f"{value}")
{'value': 4.5, 'format': 'danger'}
{'value': 5.25, 'format': 'danger'}
{'value': 4, 'format': 'danger'}