Skip to main content

Human-oriented representation of time deltas, a Python library

Project description

Convert time deltas into phrases like “5min ago”, “3h ago”, “2 days ago” etc.

Base work from Adomas Paltanavicius, but with two added versions: french and “short english”

This package has a number of modules in it, each for separate language. It is standard that module pytimeago.X has function X, which accepts at least on argument – number of seconds between two events. It may also accept extra keywords, which should be documented in the docstring of the function. Returned is always unicode string.

Usage pattern:

from pytimeago.english import english # or other… from time import time, sleep

a = time() # …do something here… delta = int(time() - a) print “job started %s” % english(delta)

Prints, e.g.

job started 15mins ago

Licenced under GNU Lesser General Public License, you can get a copy at: http://www.gnu.org/licenses/lgpl.html

Written by Adomas Paltanavicius (adomas.paltanavicius@gmail.com).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytimeago-1.0.2.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file pytimeago-1.0.2.tar.gz.

File metadata

  • Download URL: pytimeago-1.0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pytimeago-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e59e60716d2e87bce3c4f4e7f843773bfb3d8b8cc6708a8db0aeb293b47c3888
MD5 084623d64a4f4a35fe89f99508f2ddc3
BLAKE2b-256 711f09ef33b650ec54e5ae4024d1dd67b603ec4b388553de1235defcd45e3f6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page