Checkcards on Github

My library loan tracking scripts, checkcards and checkcards.py, stopped working this weekend. After a bit of debugging, I came to learn that the library—or, more accurately, its software vendor—had snuck in a new <span> tag at the ends of magazine titles. My Python/BeautifulSoup code wasn’t expecting this and choked on it.1

The fix was fairly simple, but as I was editing checkcards.py, the Python script that does all the heavy lifting, I got a little too aggressive in tearing out the old code and had to reconstruct some of it from memory. It was then that I realized that I’d never put the checkcards scripts under version control. Now I have.

• checkcards.py, which communicates with the library’s website and prepares the email with the list of items checked out and on hold.
• checkcards, which runs checkcards.py and pipes the result to sendmail for emailing.
• com.leancrew.checkcards.plist, which tells launchd to run checkcards every morning.
My login information has been redacted, and the README tells you how to customize it for yourself. Frankly, I doubt that this will be useful to anyone who doesn’t use the Naperville Public Library, but who knows? I think it makes pretty good use of the mechanize library to interact with web pages.