Port the lrparsing library to Python3