import time from backup_monitoring.parsing.parsers import ontap_df as parser file = open('test.txt', 'r') stream = parser.stream(file) i = 0 for record in stream: i += 1 print i #print record instance = parser.parse(record) for key, value in instance.items(): print '[%s] = [%s]' % (key, value) # time.sleep(5) file.close()