Discussion: Ported the calendar code to Python

I ported the PHP code from the API docs on time to Python on a lark. Since the API docs say to let the devs know, here's a link to my GitHub copy:

glitch-time.py

(Revised pretty substantially, now that I've fixed up my late-night code fail. Unlike the PHP version, this one calculates the month and day based on the entire length of the year.)

--Janice/ Coraline
Cool, more pythoners! 

I have my own version here (though it's not nearly as clean/well documented as yours):
 https://github.com/fmoo/glitch-python/blob/master/glitch/datetime.py

Which I use to display at the footer at the demo site from that repo, here:
  http://glitch-python-contrib.appspot.com/
Yeah, I fussed with month lengths and then another player was all "Pffft, use the day of the year the month ends on, instead of the length of the month." It does somewhat simplify the mayhem.

I need to handle Recurse not having a named day of its own, though; thanks for reminding me. At the moment, I'm just handling it as a one-day month, which will work but require a little handling.
So, are there actually eight days in a week? Any idea why the official calendar shows only seven? Or why the days of the week reset every month, even though the API clearly suggests otherwise?

@fmoo, I like your use of divmod... totally forgot that was available. Going to go back and redo a bunch of my code to steal from my bette... err, optimize.
I'm glad I perused the old topics before starting my own on this. Here's my own Python date/time script:

gist.github.com/4009989

It's probably not as elegant as the others, since I'm just learning Python (I'm a Java dev by trade). But, you can customize the format and supply your own date, which is kinda fun.

For any of these scripts, I suggest using Rainmeter (Windows) or GeekTool (Mac) to present the output on your desktop. Then you always know what time it is!