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