Apply equal UV grid across a mesh

Very Cool! do you have a version in python? is there something similar in python