How do I apply a refactoring?

There are 3 options:

  1. Press Alt+Enter on the suggested refactoring and apply the refactoring
  2. Hover the mouse over the refactoring and a lightbulb will appear. Click the lightbulb and apply the refactoring.
  3. Right click on the suggested refactoring in the Sourcery window and select the Refactor function option

How do I disable Sourcery on a function?

There are 3 options:

  1. Add this comment to the function definition: # sourcery off.
    For example:
    def func(a, b):  # sourcery off
        return a + b
  2. Press Alt+Enter on the suggested refactoring and select the Disable Sourcery for this function option
  3. Right click on the suggested refactoring in the code editor and select the Disable Sourcery for this function option

Where do I get support?

Raise an issue on our GitHub issues page


How does Sourcery protect my code?

Sourcery only makes web requests for the purposes of downloading updates, validating tokens and reporting exceptions. Your code is not sent anywhere, even to Sourcery servers.


Can I use Sourcery at work?

Yes you can! Sourcery can always be used on open source code. To use it on private code you need to sign up to Sourcery Pro which is currently free while we're in beta
Try free beta


Can I use Sourcery on multiple machines?

Tokens are per-user, rather than per-machine, so you can use Sourcery on as many computers and operating systems as you wish.


What editors is Sourcery available for?

Sourcery is available for:

  • PyCharm

Coming soon:

  • Sublime
  • VSCode
  • Vim

Sign up to our mailing list to get updates on new plugins.

Or raise an issue for your favourite editor on our GitHub page