A suggestion: I think the python api could be more useful if it returned a structured tree and possibly also could accept a structured tree. I'm guessing you're using maturin, there are some nice low energy ways of getting a tree like structure out even if you have to copy internal trees into a new version with nice python bindings. I've done similar things here https://github.com/philzook58/scryerpy https://github.com/philzook58/steelpy https://github.com/philzook58/microeggpy