Recursion error while simplifying nested json to flat in python

Advertisements I am trying flatten the json object so that I can create plain csv file out of it. But it is throwing RecursionError: maximum recursion depth exceeded while calling a Python object Code which I have written in python, calling simplify_multy_nested_json_recur() : def simplify_multy_nested_json_recur(obj): kv = convert_list_to_kv(obj) simplified_json = simplify_nested_json(kv) if any(isinstance(value, list) for… Read More Recursion error while simplifying nested json to flat in python

I am not getting the correct info while extracting some particular key value from nested json. please help in correcting the code

Advertisements I want to extract the task name and config corresponding to each task into new variable. The code that I have shared is not giving me the desired output. Although it is extracting some info but it is not able to extract all the required details. Here is the json: old = { "tasks":… Read More I am not getting the correct info while extracting some particular key value from nested json. please help in correcting the code

How to access nested JSON data | REACT

Advertisements I have a problem when trying to fetch one nested JSON object from local API endpoint /user/{id} that looks like this : {"userId":122,"name":"kissa","email":"kissa@kissa.com","phone":"04819283921","profile":{"profileId":1,"profileName":"student"}} Everything else works like a charm but when trying to implement "user.profile.profileName" it gives me an error when reloading the page: Uncaught TypeError: Cannot read properties of undefined (reading ‘profileName’) User.jsx… Read More How to access nested JSON data | REACT

Is it possible to rename a json key name using its value in Python?

Advertisements I have this nested json dictionary and I want to rename the key name ‘Keys’ with its equivalent value using Python. I wonder if this is possible? Current – ‘Keys’: [‘AWS Backup’] I want it to be – ‘AWS Backup’: [‘AWS Backup’] Sample json dictionary {‘TimePeriod’: {‘Start’: ‘2022-11-28’, ‘End’: ‘2022-11-29’}, ‘Total’: {}, ‘Groups’: [{‘Keys’:… Read More Is it possible to rename a json key name using its value in Python?

Send nested JSON data with image/file from postman: Django REST framework

Advertisements I want to POST the following data: { "user": { "name": "user name", "email": "user@example.com", "phone_number": "01XXXXXXXXX", "user_type": "MGR" }, "img": "image_data", "manager_brands": [ 2, 1 ] } How can I pass this JSON data through postman? Challenges I am facing: This is a nested JSON data I am passing an image with it.… Read More Send nested JSON data with image/file from postman: Django REST framework

Writing a program to take user input and prints output from the Nested json file

Advertisements I have a nested json file with the below data and I need some help in writing an interactive program where it should take a topping as input and prints out the names of all the donuts that have this topping. [ { "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter":… Read More Writing a program to take user input and prints output from the Nested json file