Python Power and Gnomedex ‘07
Sometimes when you are in crazy situations you need to use crazy solutions.
Polar Rose is are a 95% Java shop. Basically everything is Java, from distributed image processing infrastructure to web sites and web services. (That five percent is some amazing C++ code to do the most difficult task of finding and analyzing faces.)
So, lately we have been working on a really nice project that allows us to capture all kinds of feeds (syndication, photo sites, etc.) and process images from those feeds so that we can link the found faces to for example collections for users or events. We planned to use this for the Gnomedex ‘07 conference pages that we we host so that you can see people who are at the conference.
Unfortunately due to crazy circumstances we were not able to get this stable on time so we had to come up with a (for us) crazy solution. Python to the rescue! I wrote a simple script to glue together the Flickr API and Polar Rose Web Services (not public yet). This was an interesting exercise since my Python skills are absolutely still n00b level. But I had something basic up and running pretty quickly.
So, instead of having a nice redundant application deployed in an application server cluster we now run a simple version as a 120 line Python script that is executed from a classic unix cron job. Doesn’t give me the same warm feeling inside but at least it works
I’m not ready to keep this in production or to start putting more Python code in production, but I am curious to find out if we can use more scripting to do things we would otherwise code in Java.
Specially when you are talking about simple API barriers based on things like REST and XML-RPC it makes a lot of sense to glue things together in a simple language. It also guarantees that you don’t introduce any hard dependencies.
Modified
