Skip to content
Safe code refactoring for modern Python.
Python JavaScript Other
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Replace Travis with Github Actions Oct 17, 2019
bowler Don't compare retcode with 'None' Jun 21, 2019
docs Maybe even this emphasis? Jul 26, 2019
website Correct minor typos Nov 14, 2018
.gitignore Ignore vscode directory Mar 14, 2019 Prepare for v0.8.0 release Jun 12, 2019 Initial commit Aug 25, 2018 Initial commit Aug 25, 2018
LICENSE Initial commit Aug 25, 2018 Add a basic maintainers guide May 4, 2019 Initial commit Aug 25, 2018 Use Github Actions badge in readme Oct 18, 2019
makefile Replace Travis with Github Actions Oct 17, 2019
requirements-dev.txt Replace Travis with Github Actions Oct 17, 2019
setup.cfg Create setup.cfg and move mypy/isort out of makefile Apr 1, 2019 Requires Python 3.6 or greater Apr 1, 2019


Safe code refactoring for modern Python projects.

build status code coverage version changelog license code style


Bowler is a refactoring tool for manipulating Python at the syntax tree level. It enables safe, large scale code modifications while guaranteeing that the resulting code compiles and runs. It provides both a simple command line interface and a fluent API in Python for generating complex code modifications in code.

Bowler uses a "fluent" Query API to build refactoring scripts through a series of selectors, filters, and modifiers. Many simple modifications are already possible using the existing API, but you can also provide custom selectors, filters, and modifiers as needed to build more complex or custom refactorings. See the Query Reference for more details.

Using the query API to rename a single function, and generate an interactive diff from the results, would look something like this:

query = (
    Query(<paths to modify>)

For more details or documentation, check out

Installing Bowler

Bowler supports modifications to code from any version of Python 2 or 3, but it requires Python 3.6 or higher to run. Bowler can be easily installed using most common Python packaging tools. We recommend installing the latest stable release from PyPI with pip:

pip install bowler

You can also install a development version from source by checking out the Git repo:

git clone
cd bowler
python install


Bowler is MIT licensed, as found in the LICENSE file.

You can’t perform that action at this time.