How can you access group calendar information if your Exchange-like mail and calendaring server does not provide iCalendar feeds, and you do not, or cannot, use Outlook? Use Python to extract the calendar data and generate your own feed, of course! This article discusses a surprisingly simple program to perform what seems like a complex series of operations: scanning IMAP folders, extracting iCalendar attachments, and merging the contained events together into a single calendar.
The timeit module provides a simple interface for determining the execution time of small bits of Python code. It uses a platform-specific time function to provide the most accurate time calculation possible.
Read more at pymotw.com: timeit
Marsee Henon from O’Reilly recently interviewed a couple of us about the Atlanta-area Python Users’ Group Book Club. She asked some good questions, and although I’m not entirely comfortable with the group being characterized as an “O’Reilly” book club, O’Reilly does offer us a lot of support (esp. free books) so I guess I shouldn’t complain.
If you’re interested in participating in a technical book club, you don’t have to live in or even near, Atlanta to join ours.
The HMAC algorithm can be used to verify the integrity of information passed between applications or stored in a potentially vulnerable location. The basic idea is to generate a cryptographic hash of the actual data combined with a shared secret key. The resulting hash can then be used to check the transmitted or stored message to determine a level of trust, without transmitting the secret key.
Read more at pymotw.com: hmac
As part of the Atlanta Python Users’ Group Book Club, I received a copy of RESTful Web Services written by Leonard Richardson and Sam Ruby, and published by O’Reilly Media. When we started the book club, this was the first book I suggested we read. I had previously studied some material on various blogs discussing REST, but I wanted a clear description and more specific examples. The book provided both, and I highly recommend reading it before planning your next web development project.
I spent some time yesterday afternoon working on my personal site. I wanted a way to add “related links” for my projects, without hand-editing individual lists in HTML. That’s boring, after all. Surprisingly, I didn’t find an existing django app that did anything like that, and had to build one myself.
My requirements were pretty simple: My site uses codehosting to host project home pages, including file release management, and RSS feeds for updates.
Python’s unittest module, sometimes referred to as PyUnit, is based on the XUnit framework design by Kent Beck and Erich Gamma. The same pattern is repeated in many other languages, including C, perl, Java, and Smalltalk. The framework implemented by unittest supports fixtures, test suites, and a test runner to enable automated testing for your code.
Read more at pymotw.com: unittest
The optparse module is a modern alternative for command line option parsing that offers several features not available in getopt, including type conversion, option callbacks, and automatic help generation. There are many more features for to optparse than can be covered here, but hopefully this introduction will get you started if you are writing a command line program soon.
Read more at pymotw.com: optparse