ENH/CLN: refactor to support PythonParser as well as CParser