I want the output to be easily readable by all people in Json format. Right now the output is a big long string of data. The goal is to be able to see the data at a glance. So in the original format of JSON.
Wanted output (example)
[
{
"Employee ID": 1,
"Name": "Abhishek",
"Designation": "Software Engineer"
},
{
"Employee ID": 2,
"Name": "Garima",
"Designation": "Email Marketing Specialist"
}
]
[
{
"Employee ID": 1,
"Name": "Abhishek",
"Designation": "Software Engineer"
},
{
"Employee ID": 2,
"Name": "Garima",
"Designation": "Email Marketing Specialist"
}
]
Python main code:
if __name__ == "__main__":
print("Start-up")
api = APIClient(AMV_TOKEN, AMV_IP2)
print(api.batch.get())
print("Done")
Output:
Start-up
{'count': 8, 'next': None, 'previous': None, 'results': [{'url': 'http://192.168.0.18/api/batch/bmw_problem/', 'created': '2021-05-11T16:56:04.944370+02:00', 'modified': '2021-05-11T16:56:04.944384+02:00', 'id': 'bmw_problem', 'title': 'bmw_problem', 'archived': False, 'view': None, 'query': 'tray=bmw_problem', 'summary':
{'prints': 11, 'assigned': 11, 'rejected': 0, 'conflicted': 0, 'needs_processing': False, 'processing_ratio': 1.0, 'processing_status': 'READY', 'currently_scanning': None}, 'has_bin_assignments': True, 'active_scan_session': '677d2328-6276-4206-9a69-2f6b10fd67ea', 'auto_delete': False}, {'url': 'http://192.168.0.18/api/batch/demo_set_3/', 'created': '2021-03-22T12:37:51.240377+01:00', 'modified': '2021-04-12T12:27:07.124319+02:00', 'id': 'demo_set_3', 'title': 'demo_set_3', 'archived': False, 'view': 'by_tray', 'query': 'tray=demo_set_3', 'summary': {'prints': 318, 'assigned': 0, 'rejected': 0, 'conflicted': 0, 'needs_processing': False, 'processing_ratio': 1.0, 'processing_status': 'READY', 'currently_scanning': False}, 'has_bin_assignments': False, 'active_scan_session': None, 'auto_delete': False}, {'url': 'http://192.168.0.18/api/batch/demo_all/', 'created': '2021-03-04T11:52:05.236265+01:00', 'modified': '2021-05-12T12:05:58.546004+02:00', 'id': 'demo_all', 'title': 'All demo parts', 'archived': False, 'view': 'by_tray', 'query': 'tray__istartswith=demo_set_', 'summary': {'prints': 1252, 'assigned': 218, 'rejected': 0, 'conflicted': 0, 'needs_processing': False, 'processing_ratio': 1.0, 'processing_status': 'READY', 'currently_scanning': None}, 'has_bin_assignments': True, 'active_scan_session': '50d5119e-57ef-4577-b0b4-090839f27f0d', 'auto_delete': False}, {'url': 'http://192.168.0.18/api/batch/priority/', 'created': '2021-03-04T11:50:06.446579+01:00', 'modified': '2021-03-22T13:09:14.910389+01:00', 'id': 'priority', 'title': 'Priority Prints', 'archived': False, 'view': None, 'query':
'flags__contains=PRIORITY', 'summary': {'prints': 434, 'assigned': 0, 'rejected': 0, 'conflicted': 0, 'needs_processing': False, 'processing_ratio': 1.0, 'processing_status': 'READY', 'currently_scanning': None}, 'has_bin_assignments': True, 'active_scan_session': '15403217-a468-498e-b150-b900a16cd5cc', 'auto_delete': False}, {'url': 'http://192.168.0.18/api/batch/MJF/', 'created': '2021-03-04T11:50:06.446557+01:00', 'modified': '2021-05-12T12:05:58.546004+02:00', 'id': 'MJF', 'title': 'MJF Prints', 'archived': False, 'view': 'by_tech', 'query': 'technology=MJF', 'summary': {'prints': 138, 'assigned': 0, 'rejected': 0, 'conflicted': 0, 'needs_processing': False, 'processing_ratio': 1.0, 'processing_status': 'READY', 'currently_scanning': None}, 'has_bin_assignments': False, 'active_scan_session': '81f0ffdd-1e82-4e42-b8fb-89a661b03924', 'auto_delete': False}, {'url': 'http://192.168.0.18/api/batch/SLS/', 'created': '2021-03-04T11:50:06.446534+01:00', 'modified': '2021-05-12T12:05:58.546004+02:00', 'id': 'SLS', 'title': 'SLS Prints', 'archived': False, 'view': 'by_tech', 'query': 'technology=SLS', 'summary': {'prints': 1114, 'assigned': 1, 'rejected': 0, 'conflicted': 0, 'needs_processing': False, 'processing_ratio': 1.0, 'processing_status': 'READY', 'currently_scanning': None}, 'has_bin_assignments': True, 'active_scan_session': '99b3a0a3-05f6-4225-bbe6-9814a31dca80', 'auto_delete': False}, {'url': 'http://192.168.0.18/api/batch/demo_set_2/', 'created': '2021-03-04T11:50:06.446508+01:00', 'modified': '2021-05-12T12:05:58.546004+02:00', 'id': 'demo_set_2', 'title': 'demo_set_2', 'archived': False, 'view': 'by_tray', 'query': 'tray=demo_set_2', 'summary': {'prints': 323, 'assigned': 22, 'rejected': 0, 'conflicted': 0, 'needs_processing': False, 'processing_ratio': 1.0, 'processing_status': 'READY', 'currently_scanning': True}, 'has_bin_assignments': True, 'active_scan_session': '82e8e71a-0c1f-41c5-b021-bd399eb2d6b3', 'auto_delete': False}, {'url': 'http://192.168.0.18/api/batch/demo_set_1/', 'created': '2021-03-04T11:50:06.446461+01:00', 'modified': '2021-05-12T12:05:58.546004+02:00', 'id': 'demo_set_1', 'title': 'demo_set_1', 'archived': False, 'view': 'by_tray', 'query': 'tray=demo_set_1', 'summary': {'prints': 611, 'assigned':
0, 'rejected': 0, 'conflicted': 0, 'needs_processing': False, 'processing_ratio': 1.0, 'processing_status': 'READY', 'currently_scanning': None}, 'has_bin_assignments': False, 'active_scan_session': 'becc3aba-bba4-4061-8a19-65abec2acbcd', 'auto_delete': False}], 'num_pages': 1, 'processing': False}
Done