rhythm

Date and time package in pure-Python
Download

rhythm Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freely Distributable
  • Price:
  • FREE
  • Publisher Name:
  • jwp
  • Publisher web site:
  • http://jwp.io

rhythm Tags


rhythm Description

rhythm is a date and time Python package that moves to a different beat.rhythm is a pure-Python date and time package based on the Python int. By default, timestamps have microsecond precision granting common applications more than enough detail about a point in time. For specialized purposes, the units handled by rhythm can be arbitrarily extended--the int subclasses represent a designated unit.rhythm only supports the Gregorian calendar, but has tools for supporting arbitrary calendars.rhythm's APIs are not compatible with the standard library's datetime module. On purpose.Examples:from rhythm import libdate = lib.Date.of(year=1982, month=4, day=17)assert date.select('day', 'month') == 17However, the above actually represents:assert date.select('date') == (1982, 5, 18)The calendrical representation only takes effect through certain interfaces. ts = lib.Timestamp.of(iso="2001-01-01T05:30:01") print(repr(ts)) rhythm.lib.Timestamp.of(iso='2001-01-01T05:30:01.000000')From a date-time tuple:ts2 = lib.Timestamp.of(datetime = (2001, 1, 1, 5, 30, 1, 0))assert ts = ts2Product's homepage


rhythm Related Software