feedcache 1.0

What’s new? I am happy with the API for feedcache, so I bumped the release to 1.0 and beta status. The package includes tests and 2 separate examples (one with shelve and another using threads and shove).

PyMOTW: getopt

The getopt module is the old-school command line option parser which supports the conventions established by the Unix function getopt(). It parses an argument sequence, such as sys.argv and returns a sequence of (option, argument) pairs and a sequence of non-option arguments. Read more at pymotw.com: getopt

ORM envy

Jonathan LaCour presented an overview of SQLAlchemy at last night’s PyATL meeting, and now I have ORM envy. It’s too bad I can’t afford the effort that would be involved in replacing the in-house ORM we use at work, but I’ll definitely consider using it for my own projects.

New project: feedcache

Back in mid-June I promised Jeremy Jones that I would clean up some of the code I use for CastSampler.com to cache RSS and Atom feeds so he could look at it for his podgrabber project. I finally found some time to work on it this weekend (not quite 2 months later, sorry Jeremy). The result is feedcache, which I have released in “alpha” status, for now. I don’t usually bother releasing my code in alpha state, because that usually means I’m not actually using it anywhere with enough regularity to ensure that it is robust.

PyMOTW: shelve

The shelve module can be used as a simple persistent storage option for Python objects when a relational database is overkill. The shelf is accessed by keys, just as with a dictionary. The values are pickled and written to a database created and managed by anydbm. Read more at pymotw.com: shelve

AstronomyPictureOfTheDay 2.0

What’s new? There is a new release of AstronomyPictureOfTheDay available this morning. Version 2.0 is a substantial rewrite of the 1.1 version, but retains essentially the same functionality. The primary difference is that you no longer have to run a script to “personalize” it during installation. Now that it is distributed as an Application instead of an Automator workflow, you can just drag it to your Applications folder. The source is still created with Automator, but some of the Finder actions for working with directories have been replaced by Shell Script actions to perform the same operations.

PyMOTW: glob

Even though the glob API is very simple, the module packs a lot of power. It is useful in any situation where your program needs to look for a list of files on the filesystem with names matching a pattern. If you need a list of filenames that all have a certain extension, prefix, or any common string in the middle, use glob instead of writing code to scan the directory contents yourself.

PyMOTW: calendar

The calendar module defines the Calendar class, which encapsulates calculations for values such as the dates of the weeks in a given month or year. In addition, the TextCalendar and HTMLCalendar classes can produce pre-formatted output. Read more at pymotw.com: calendar

Converting podcasts to regular tracks in iTunes

I have spent the better part of the morning trying to work out how to convert podcasts to “regular” tracks in iTunes, so they would show up in shuffle, etc. Mostly this was for my collection of Jonathan Coulton “Thing a Week” episodes, but it would be useful for anything you wanted to move out of your podcast list into the main audio portion of the library. I suppose the reason it took so long to find the solution is I started by searching for it on Google instead of just looking through the iTunes menu options, though as you will see the solution wasn’t immediately obvious even once I had found it.

Unexpectedly broken, and fixed: svnbackup

Yesterday Pierre Lemay sent me one of the clearest bug reports I’ve seen in quite a while, and a patch to fix the problem. He was having trouble with svnbackup duplicating changesets in the dump files. It turns out every changeset that appeared on a “boundary” (at the end of one dump file and the beginning of the next) was included in both dumps. Oops. When I tested the script, I was able to recover the repository without any trouble.