Simple Text Parser in Python