My favorite Python packages

Python generally lives up to its motto, “Batteries included.”  Here I want to give credit to folks who have provided some of my extra “batteries” — freely available Python tools that make my work easier and better.

Django — The de facto standard for Python web application development.  I’ve learned a lot from studying its code.  Includes a library of useful utilities (django.utils) that can used outside of web application contexts (e.g., check out django.utils.datastructures.SortedDict).

sphinx — Also a de facto standard in the Python universe.  It’s made me appreciate reStructured Text and improve my code documentation practices.  Ironically I find its own documentation rather hard to use.

virtualenv — How did we manage without it?

pip — Better package management than easy_install.

ipython — Worth it for the command history alone.

decorator — Almost essential for writing decorators, especially if you’re on Python < 2.5.

Fabric — A great addition to the developer’s or sysadmin’s toolkit.

lxml — For XML processing, I almost never use Python’s builtin XML libraries.

pycurl — Brings the power of libcurl into Python, filling gaps left by urllib/urllib2 and httplib (e.g., multiple asynchronous requests, multipart form data).

xlrd, xlwt — Good API for MS Excel processing.  Unfortunately, no support (yet) for Excel 2007 XML format.

simplejson — The standard JSON library for Python < 2.6.

py.test — Anything that makes writing and running unit tests easier is very good.

unittest2 — Makes available to Python 2.4-2.6 the significant enhancements made to the standard unittest module in Python 2.7.

I also want to thank Christof Gohlke for his “Unofficial Windows Binaries” site, since up-to-date versions of lxml and pycurl would be difficult to use on Windows without his builds.

And finally, there are essential libraries that I depend on without normally using directly: MySQL-Python, pysqlite (stuck on CentOS 5/Python 2.4), python-ldap, docutils, setuptools.