Cachetools

I was looking for a simple, off-the-shelf caching library for Python. Dissatisfied with what I could find, I wrote my own, and called it cachetools.

Cachetools provides a simple set/get interface to cache objects manually, either in-memory or to a filesystem shelve-based store; a caching decorator for functions, that indexes return values based on the sha1 hash of a pickle of the call arguments; and some logging facilities. In the future I plan to add proper expiry logic (right now it supports simple LRU, only for in-memory caches) and use SQLite as a backend, since it can easily store and index metadata for cached objects.

I'd love to hear if you find cachetools useful, or if you have any ideas for improvements.

Created:
9 Jun 2009, 11:45

Tiny Python web service

I had an excessive amount of fun today doing some yak shaving. There's this CSS mangling script I'm writing for Naaya, that compares different versions of a file, and we need to run it on many sites, so I decided to package the main code as a web service, and deploy a minimal runner script on each site.

The shaved yak was, of course, a spiffy web service wrapper. It's running behind mod_wsgi, with URL dispatching and request/response objects by Werkzeug, logging to a StringIO that can be sent out with the response, a view that serves static content, another one that serves Genshi templates, a couple of others for JSON and repr output, and, the application auto-reloads when a source file is changed – all this in 99 lines of code, including blank lines and comments. Python is pure awesomeness. :)

The code is up on gist: wsgiapp.py. I think it's useful as a working example of a nicely rounded web service using the latest and greatest libraries from the Python world.

Created:
5 Jun 2009, 00:06

eLiberatica 2009

Got my yearly dose of open source enthusiasm at the 2009 edition of eLiberatica. The organisers managed to gather a good group of speakers again, together with a record number of attendees. You can find some more coverage by Ionuţ "mapleoin" Arţărişi and Mihai Maruseac, and photos from Anamaria Stoica and Lucian Săvluc.

The talks

I missed Zak Greant from previous eLiberaticas, he has a gift of explaining and geek-herding abilities that were missing this year; still there were some very good talks. Highlights from day one: Richard Stallman sent a video presentation, explaining the fundamental ideas behind open source software, which was a great kickoff for the conference. Georg Greve was back, talking about laws and standards and patents and licenses. George Mitropoulos from Sun showed off their storage platform – they use Flash drives for intermediate caching, and their powerful Fishworks analytics package is open source. Ovidiu Moişanu gave a star trek-themed presentation about selling open source – clients want working solutions, not progressive ideas; as it happens, open source solutions are some of the best out there. Jeroen van Meeuwen talked about the Fedora packaging policy – they don't maintain patches but rather contribute to upstream projects, and distribute the latest versions, thereby exposing users to potentially half-baked software in order to generate feedback and bug reports (that's why I prefer Debian – I want my software to work, thank you).

Day two: They tell me Danese Cooper had a great talk about licenses and juicy insider bits from big software companies but I missed that one. Monty Widenius of MySQL fame, veteran of eLiberatica, gave a straight, practical talk about business models. David Axmark, also from the MySQL posse, talked about Drizzle – they're taking the MySQL codebase, removing lots of unnecessary stuff, breaking it up into pluggable components and having way too much fun. Danese later organized half an hour of lightning talks; the crowd really enjoyed this format, and I'm hoping that next year we'll have dedicated time for lightning talks.

Logistics

The venue was Politehnica university, a familiar place for myself and lots of other attendees, many of which were students at the CS department. With tickets much cheaper this year, attendance was up. Wireless internet actually worked much of the time, and there was a surprising amount of twitter traffic on #eliberatica.

It was great to meet up with old friends and I got to feel smug about knowing lots of people at the conference. I also wore XKCD clothing (making a statement, I guess); in hindsight, I should have shown off my PyCon t-shirt :)

Bottom line

I still think the first eLiberatica (Braşov, 2007) was the best. I'm glad I keep coming back though; it would be a shame to miss some great speakers, and one doesn't often get the chance to have geeky conversations with so many people in one day :)

Created:
24 May 2009, 12:59
« older articles newer articles »