Sourcery Blog

Thoughts, musings, advice, and best practice tutorials on how to program in Python from the Sourcery team

Making Our Tests More Concise with Helpers

Helper functions make your code more expressive and less repetitive. Assuming that you really use them.

Chatting with Will McGugan: From Side Project To Startup

Will's journey with Rich and Textual. Including insights about API design and speeding up Python code.

Zero-cost Exceptions and Error Interfaces

Handling and raising errors in Python plus some novelties introduced in 3.11

Chatting with Sebastian Witowski - Part II: Python Community and Developer Tools

Sebastian's work in the Python community: talks, articles, courses. And a favorite topic: developer tools and productivity.

Making the Sourcery CLI More Robust with Rich

Building blocks of a robust CLI App and how we've implemented them with Rich in the Sourcery CLI.

Chatting with Sebastian Witowski - Part I: Code Standards, Tooling, and Working in Teams

How to think about working in teams, consulting, setting common standards for your code, and finding a balance in the CI.

Review Just Your Changed Code

Review only the code in your current PR with Sourcery and incrementally improve the quality of your codebase.

GPSG in Practice / Part 1: the Sourcery Monorepo

How we've been adjusting the Google Python Style Guide for the Sourcery monorepo.

Dark Corners of Our Code - The Impact of Technical Debt - Part II

What leads to unmanageable pieces of codebases

The Impact of Technical Debt - 2022

How much does technical debt impact teams?

Introducing the Google Python Style Guide in Sourcery

A step by step guide towards implementing the Google Style Guide with Sourcery

Real Python podcast

Measuring Python Code Quality, Simplicity, and Maintainability

Dissecting the Google Style Guide

Breaking down how a code style guide can help speed up engineering teams

Maintainability Index - What is it and where does it fall short?

Calculating the Maintainability Index and looking at how you can use it for your projects.

Python Refactorings - Part 8

Six more examples of ways to refactor your Python code, and why they are improvements

How much information is too much information?

The link between complexity, cognitive overloading, and velocity.

Is your code too complicated?

Measuring complexity of your code with two different metrics - Cyclomatic Complexity & Cognitive Complexity

Stackoverflow podcast

Exploring the magic of instant Python refactoring with Sourcery

What Is Technical Debt (and why a bit of it is a good thing)

Technical debt can slow down your development, but focusing too aggressively on refactoring isn't always the right decision either.

Cloudy with a Chance of Python

Deploying a Python program as a Google Cloud Function

Functional Refactoring talk at PyData Eindhoven

Refactoring noughts and crosses into the functional programming style

Real Python podcast

Getting started with refactoring your python code

Podcast.__init__ interview

Make Your Code More Readable With The Magic Of Refactoring Using Sourcery

Python Refactorings - Part 7

Six more examples of ways to refactor your Python code, and why they are improvements

Making lunch faster with Python concurrency

A lunchtime story to demonstrate threading, asyncio, multiprocessing & cloud functions

Python Refactorings - Part 6

Six more examples of ways to refactor your Python code, and why they are improvements

Python Refactorings - Part 5

Six more examples of ways to refactor your Python code, and why they are improvements

Sourcery now available in Sublime!

Instantly refactor your Python code

Introducing Sourcery Pro!

Don't miss out on these powerful new features - write better code faster today.

Sourcery now available in Vim!

Instantly refactor your Python code

Can you fit all of this code in your head?

Measuring how hard code is to understand with our new working memory metric

Python Refactorings - Part 4

Six more examples of ways to refactor your Python code, and why they are improvements

Python Refactorings - Part 3

Six more examples of ways to refactor your Python code, and why they are improvements

Python Refactorings - Part 2

Six more examples of ways to refactor your Python code, and why they are improvements

Talk Python podcast

Refactoring your code, like magic with Sourcery

Python Refactorings - Part 1

Six examples of ways to refactor your Python code, and why they are improvements

How do you test code written by code?

Ensuring Sourcery improves code without changing its functionality

Sourcery Starbot ⭐ released!

Star our repo to refactor your most popular Python repo

Use Sourcery to review your code on GitHub!

Get an instant quality boost to your open source codebase

Python refactorings now available in VS Code with Sourcery!

Get instant Python refactorings as a VS Code extension

Getting the most out of Python collections

A guide to comprehensions, generators and useful functions and classes

GitHub Actions for perfect Python Continuous Integration

A simple GitHub action for formatting, linting, testing, and building a Python application

A Field Guide to Fixing Bugs

Best practices for tracking down and resolving software issues

A perfect way to Dockerize your Pipenv Python application

A simple Dockerfile for setting up a perfect Python application using Pipenv

Five Python Refactoring Tips to Improve Your Code

Easy ways to improve and simplify your code, with Python examples

Sourcery beta launched!

Sourcery is in beta - try our AI-powered refactoring in Pycharm now!

Sourcery now runs locally - plus beta launch next month!

Sourcery will now run locally on your machine, meaning that no code is sent to the cloud. We are also planning to launch into paid beta in October

How to set up a perfect Python project

Best practices for setting up a project to maintain the highest quality code

Refactoring the Gilded Rose kata

16 steps to transform and simplify the code

Introducing Sourcery

Refactor Python instantly using the power of AI