Skip to content

Introduction to Sourcery


This page is incomplete - we're working on it!

What is Sourcery?

Sourcery is a refactoring engine - it statically analyses your Python code and tries to find ways to make it easier to read, write, and maintain.

Using Sourcery, you can:

  • Get real-time refactoring suggestions in your IDE
  • Have your pull requests reviewed (with fixes) in GitHub
  • Set up a pre-commit hook to guard against low-quality code
  • Adopt community rule sets such as the Google Python Style Guide
  • Create your own code rules to enforce internal best practices

and more.

Where can I use Sourcery?

Sourcery is available as a command-line interface (CLI), an IDE/editor plugin, and as a GitHub bot. Most people use Sourcery in their IDE, where it runs in the background, suggesting changes in real time.

Animation showing Sourcery running in VSCode and
suggesting several refactorings.
Sourcery running in VSCode