Extract all the keys from an Ordered dict recursively
I have tried using some recursive functions available online but could get what I was looking for.
The input ordered dictionary takes the below value
input = OrderedDict([('report',
OrderedDict([('generated_at', '2019-07-01 05:07:13'),
('record_count', 23),
('start_date', '2019-02-10'),
('end_date', '2019-02-10'),
('records',
[OrderedDict([('_data_type', 'PREGNANT'),
('_app_type', 'DAYS_POST')]),
OrderedDict([('_data_type', 'VISION'),
('_app_type', 'DAYS_PRE')])])]))])
The expected output is a list of all the keys including nesting.
['generated_at','record_count','start_date','end_date','_data_type','_app_type']
The order needs to be in the above specified sequence.