Rules file parsing in Python.