Pyflyby: Automatic imports for Python

Karl Chen (~quarl)




Python is a wonderful programming language because of its lack of boilerplate. However, one remaining area of boilerplate is import statements. When writing a python program, it's tedious to go back and forth to the top of the file to add and remove import statements. When using Python interactively, it's tedious to type import statements.

I have created a tool called Pyflyby to automate imports. Pyflyby has two killer features. (1) With one button, Pyflyby automatically modifies your Python code to add necessary imports and remove unnecessary imports. You can integrate into your editor or use the command-line tool. (2) Pyflyby enhances IPython/Jupyter to automatically import symbols on-demand.

I started Pyflyby in 2011 as a side project. It has become wildly popular within my firm; most developers at my firm swear by it. I recently open sourced Pyflyby to make it available to the community.

In this talk, I will present how to use Pyflyby, how it works, and how it has changed Python development at my firm.



Content URLs:

Speaker Info:

I have been a developer in the asset management division of the D. E. Shaw group since 2009. I also manage the Python infrastructure group at the firm.

Id: 909
Section: Developer tools and Automation
Type: Talks
Target Audience: Beginner
Last Updated: