Writing Plugin Friendly Python Applications
2023-04-18 , B05-B06

In modern software engineering, plugin systems are a ubiquitous way to extend and modify the behavior of applications and libraries. When software is written in a way that is plugin friendly, it encourages the use of modular organization where the contracts between the core software and the plugin have been well thought out. In this talk, we cover exactly how to define this contract and how you can start designing your software to be more plugin friendly.

Throughout the talk we will be creating our own plugin friendly application using the pluggy library to show these design principles in action. At the end of the talk, I also cover a real-life case study of how the package manager conda is currently making its 10 year old code more plugin friendly to illustrate how to retrofit an existing project.


This talk begins with a general discussion about what plugins are and how they are used in software. We cover important theoretical concepts and show just how pervasive plugins are in much of the software we use everyday.

With a firm idea about what plugins allow us to do, we will begin creating our own command line application that downloads images via APIs given a search term. We will write our application with plugins in mind so that we can quickly expand and support any number of image searching backends (e.g. Google, Unsplash, etc.). The presentation will focus on everything we have to do to let plugin authors extend our application and add their own backends.

A fully functional implementation of this application can be found here: https://github.com/travishathaway/latz.

After building our own application, I will then present how the conda project approaches making its software plugin friendly. Much of what I show in the example also applies to conda's plugin architecture.

This talk should prepare those interested in writing their own plugin friendly applications to get started with the pluggy library. The example project will also provide a great starting point and inspiration for new and existing applications.


Expected audience expertise: Domain

Intermediate

Expected audience expertise: Python

Intermediate

Abstract as a tweet

Learn how to write plugin friendly applications with Python with the pluggy library!

Public link to supporting material

https://github.com/travishathaway/latz

I have been a practicing software engineer for just over 10 years now. I've done a lot of work in the past building and maintaining web applications but now develop CLI tools for the conda project. My interest in plugins was largely motivated by the work I've done at Anaconda for the conda project.