Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    pytimeago r11

    Download button

    Downloads: 377  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Adomas Paltanavicius | More programs
    LGPL / FREE
    August 15th, 2006, 19:23 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    pytimeago description

    pytimeago is a human-oriented representation of time deltas, a Python library

    pytimeago is a human-oriented representation of time deltas, a Python library.

    First, I shall define what time delta is. Since Δ generally means “difference”, we take time delta to stand for difference between two events in time. Quite common, however, is to have the current time for the second event. In pytimeago we deal with time deltas from such a perspective.

    Quite possibly, you can make use of this library if your application displays some dynamically generated items to the user, and you are looking for a good way to present information on how long ago specific item was created/processed/whatever.

    Below is small code snippet demonstrating how simple it is to embed pytimeago:

    from pytimeago.english import english
    from time import time, sleep

    message = queue.getNextMessage()
    delta = time() - message.arrived_time
    print "Message arrived %s" % english(delta)

    Prints, e.g.
    Message arrived 15mins ago

    As you see, pytimeago is package, and has individual modules for every language supported. As of 2006-08-13 the only supported language is English. However, you can take a look at rather trivial implementation of English engine, write one for your language, and send it to to me (email at the bottom of page).

    Every language should come with a set of doctests (I prefer them to casual unit tests), just like the English version does. Don't be too verbose, but check essential cases.

    Product's homepage

      


    TAGS:

    Python library | time deltas | deltas representation | pytimeago | Python | library

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM