google-pasta
pasta is an AST-based Python refactoring library
Install
google-pasta on PyPI
pip
pip install google-pastauv
uv add google-pastapoetry
poetry add google-pastaPackage facts
| License | Apache 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | abandoned — 2,344 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: google_pasta-0.2.0-py2-none-any.whl; google_pasta-0.2.0-py3-none-any.whl
Keywords: python, refactoring, ast
About google-pasta
from the package's own PyPI description — quoted content, verbatim
pasta: Python AST Augmentation
This is still a work-in-progress; there is much more to do. Existing functionality may not be perfect.
Mission
Enable python source code refactoring through AST modifications.
Sample use cases:
- Facilitate moving or renaming python modules by rewriting import statements.
- Refactor code to enforce a certain style, such as reordering function definitions.
- Safely migrate code from one API to another.
Design Goals
- Symmetry: Given any input source, it should hold that
pasta.dump(pasta.parse(src)) == src. - Mutability: Any changes made in the AST are reflected in the code generated from it.
- Standardization: The syntax tree parsed by pasta will not introduce new nodes or structure that the user must learn.
Python Version Support
Supports python 2.7 and up to 3.8.
Dependencies
pasta depends on six.
Basic Usage
import pasta
tree = pasta.parse(source_code)
# ... Augment contents of tree ...
source_code = pasta.dump(tree)
Built-in Augmentations
Pasta includes some common augmentations out-of-the-box. These can be used...
Read as markdown · JSON record · Source repository · Homepage
Similar packages
permissive · top 1,000 on PyPI
pure-evalpermissive · top 1,000 on PyPI
tree-sitterpermissive · top 1,000 on PyPI
giturlparsepermissive · top 1,000 on PyPI
libcstpermissive · top 1,000 on PyPI
executingpermissive · top 1,000 on PyPI
ast-serializepermissive · top 1,000 on PyPI
sixpermissive · top 100 on PyPI
vcs-versioningpermissive · top 1,000 on PyPI
jedipermissive · top 1,000 on PyPI