Seek and ye shall find….
Posted by thepythonista on 13 June 2008
One of the things I like best about the Python community is that, chances are, if you’re after a module to do X, someone’s probably already written it (and likely at least 2 or 3 someones have). While the Python Package Index (PyPI) isn’t nearly as comprehensive as Perl’s CPAN, or the LaTeX equivalent (CTAN), there’s a lot of good stuff on there.
Specifically, I was looking for a database interface implemented as a Python iterator. Why, you might ask? Well, so I could do stuff like
results = [r for r in records if "foo" in r.name]
using list comprehensions. I know I could easily do this stuff with SQL cursors, but, for this particular app, I’d like to avoid that as much as possible, keeping the code “pure python,” if I can.
A quick search of PyPI yielded buzhug, which does exactly what I want it to. I can’t really evaluate it yet, since I’m not done playing with it, but I’ll probably post about it sometime later. If anyone else has any experiences with buzhug, I’d really appreciate if you dropped me a comment.