google-pasta

pasta is an AST-based Python refactoring library

Here are some articles that you may find helpful