The fifth public release of the period library is available at http://www.biostat.wisc.edu/%7Eannis/creations/period.py.html . The library is designed to allow one to specify both unique and recurring time periods symbolically. For example, if you have some program which should only run on Sunday evenings (say, web-log rotations), you can specify that in your program:
from period import in_period import sys
if in_period('Sunday.Hr17-23'): do_something() else: sys.exit(1) # Don't start at other times!
The most significant change to the code since previous versions is that it is now possible to nest and group period expressions, which makes the library much easier to use. For example, you can now specify a period such as '!(Monday|Friday).Hr11-14' and get a reasonable answer.
Documentation is on the web page and is included with the source.