For a recent project I needed to parse ArcGIS files using Python. I came across this great library called pyshp which is written by someone with far more experience than me with GIS. I wanted to use pyshp to parse postal code data and then I would run that through some post-processing. The performance was less than stellar and I decided to see if there were any possible bottlenecks in the library.

After looking at the well-documented pyshp code I found a few methods that were backed by iterators but strangely enough nothing existed yet to get each shape record with its associated metadata. I cobbled a new method together that did this and humbly submitted this patch. It offers a quick performance win and is an easy addition to this great library.

This project ties together a few of my favorite things: coding and watches. It uses Python and Flask for the web scraper and site backend, Twitter Bootstrap for the UI, IndexDen for hosted search, and Heroku for hosting.

This is a lightning talk I delivered (shouted?) during PyCon 2013 at the infamous TIP-BOF open space. It covers potential ways your unit tests may be yielding false positives when they should indeed be failing when using the Mock library.

I include some example code to demonstrate how not using autospec is bad and present an example of how to extend the basic Mock and MagicMock classes to add new test assertions to further prevent common testing mistakes.

For a recent infrastructure project at work we decided to use RabbitMQ as our message broker to queue up e-mail messages to be sent to to our customers. While we ultimately ended up using Celery for managing and processing the tasks, I initially wrote a few custom classes to do this using Pika.

We mainly decided to go with Celery because it was very mature and abstracted things away in a very usable way. While the pure Pika implementation was faster, it did not make sense when Celery offers so much more.

One thing I ran into while using Pika was the lack of a good example in their documentation to cover reconnecting when a connection to the queue is lost.

I threw together a Github repository that correctly demonstrates how to reconnect to RabbitMQ when a connection is lost.