Python bindings to

December 7th, 2009

After receiving threatening letters from my webhost for storing too many photos online, I decided to move the photo backend of this site to  I really enjoy the sophistication of their service in terms of privacy settings per photo and group, the ability to manage photos in folder-like objects (in a much better manner than Smugmug), direct printing, and unlimited storage for a fairly low price.  Even better, they gave me a free account when I told them I’d be writing Python code for it!

The end result of my switch is that I have wrapped their public API in Python.  I have made three packages available:

  • zenapi, a proper Python interface to Zenfolio which exposes their API in clean Python objects
  • zensync, a service built on zenapi which synchronizes a local directory with Zenfolio
  • djzen, a Django plugin built on top of zenapi which mirrors a Zenfolio account into a Django database for all the Web 2.0 you can get.  This plugin is currently running on this site and providing all the integration between my Photos page and my Zenfolio account.
Categories: Code, News

PyMVPA sprint

December 7th, 2009

I have just returned from a week of overhauling the world’s most popular machine learning suite.  PyMVPA is an extremely powerful and flexible toolset for machine learning research and applications in Python, and although the 0.4x release is stable and wonderful enough for my own research, the upcoming 0.5 release features some amazing core improvements that will reset the standards for multivariate data analysis.  Seriously, if you aren’t using PyMVPA for your own work, start now.

Categories: Code, News

LaTeX and typesetting goodness

September 18th, 2009

As I progressively include more and more math in my research and the documents I write become larger and larger, I have been gradually learning the LaTeX typesetting system.  Simply put, there is no better method for creating distinctive documents that don’t shout ‘I’m Times New Roman!’, or worse, ‘I’m Comic Sans!’ (don’t even get me started on Papyrus!).

A great way to learn the ins and outs of LaTeX was to put it to use updating my resume, as hand-formatting those beasts in the past has lead me to no end of ‘why can’t Word just do this…’-syndrome. In case you like LaTeX and want to use my resume and cv class, feel free (and browse the repository for my examples).  It was originally based on the moderncv class but I found that too casual and clunky, so a good deal has been rewritten and I have not yet updated the license or documentation.

Categories: Code


August 18th, 2009

This is the Django package I developed to run the photo backend on this site.  It is based on Justin Driscoll’s ImageKit but differs from most web photo album software (including Justin’s Photologue) in that it is designed to mirror a large filesystem of photos with minimal user intervention.


  • Django-powered database organization of all your photos (and potentially other media with some hacks), with all the templating and Python scripting Django has to offer
  • Automatically catalogs new photos on your server’s hard drive and incorporates them into the Django database, organized by the folder hierarchy of your photo directory.  That is, you never have to manually upload and organize photos.  Ever.  Just rsync or FTP photos from home to your server, and run the glLocalSync command through the Django admin shell (or set it up to run automatically via cron).
  • Automatically deletes photos and folders from the Django database when they are removed from your local folder (this can be turned off).
  • Various permission levels to control public visibility of photos and folders
  • All the fun image conversion and precaching available from ImageKit and ImageMagick.

The source is available in my galleria.git repository.  Install it like any ol’ Django app and add the variable GALLERIA_LOCAL_SYNC to your (this is the path containing your hierarchy of photos, not the Django media directory).  You’ll also need the ImageKit mentioned above.  Sorry but at this point there is no documentation and comments are probably sparser than ideal, but the source should be fairly straightforward for anyone interested in running or modifying it.

Categories: Code

Embedding Django in PHP

July 30th, 2009

Here’s a quicky I solved while developing this site.  I’m an avid lover of Python and so Django was an obvious framework for this site; however, all the prebuilt goodies like WordPress run in crusty old PHP.  How could I build the custom backends I need without recoding the wheel?
Read more…

Categories: Code