skillfed

google-pasta

pasta is an AST-based Python refactoring library

google-pasta Permissive license Apache 2.0 Abandoned 360 v0.2.0 released

Install

google-pasta on PyPI

pip

pip install google-pasta

uv

uv add google-pasta

poetry

poetry add google-pasta

Package 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

Development Status :: 2 - Pre-AlphaLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8

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