Welcome to divmod.org, a source of open software.

This page is no longer maintained. For a link to this project's current page, see http://divmod.org/trac/

Epsilon

Epsilon is a small utility package. It contains several different, small, useful modules.

First, there's epsilon.extime, a module which offers conversion to and from a variety of time formats: RFC 2822 formatted dates, POSIX timestamps, datetime objects, struct_time objects, ISO8601 formatted timestamps, and a particular context-aware format known as the "human readable format". Additionally, it offers a Time class which can be constructed from or converted to any of these formats, as well as have certain date math performed on it. Here's a brief sample:

>>> from epsilon.extime import Time
>>> Time().asDatetime()
datetime.datetime(
    2005, 10, 12, 4, 52, 8, 237248,
    tzinfo=<epsilon.extime.FixedOffset object at 0x-4860a234 offset datetime.timedelta(0)>)
>>> Time().asISO8601TimeAndDate()
'2005-10-12T04:52:29.485647+00:00'
>>>
Time.fromISO8601TimeAndDate('2005-10-12T04:52:29.485647+00:00').asHumanly()
'04:52 am'
>>> import datetime
>>> (Time() + datetime.timedelta(days=2)).asHumanly()
'14 Oct, 04:53 am'
>>> 

Next up is epsilon.cooperator. This provides a scheduler for tasks implemented as iterators. It offers full Deferred support and hooks for scheduling behavior. In particular, it can be used when it's possible for so many tasks to be running concurrently that to allow them all to set their own pace would damage interactive performance: here it slows things down and makes sure new events can be processed. With a little creativity, it can also be used to group or prioritize tasks.

The remaining features include a setup hook for Twisted applications which install plugins to cause the distutils process to regenerate the plugin cache, a class for simplifying providing multiple listeners with the result of a Deferred, and a structured Version class with special SVN integration (for example,

$ python -c 'from epsilon import version; print version'
[epsilon, version 0.2.1 (SVN r2581)]
showing that I have something at least as new as Epsilon 0.2.1 installed, and it is being imported from an SVN checkout at revision 2581).

Download 0.2.1, the latest release.

The latest code is also available from subversion:

svn co http://divmod.org/svn/Divmod/trunk

Stay tuned! More documentation is on its way!