Skip to main content

Pretty Timedelta. Convert your timedelta objects to pretty strings and vice versa.

Project description

ptimedelta

Convert time periods represented by strings to timedelta objects and vice versa.

Features

  1. Supports Python2.7, Python3+.
  2. Supports time periods with days, hours, minutes, seconds, milliseconds.

Installation

$ pip install ptimedelta

Examples

>>> import ptimedelta as ptd
>>> ptd.to_timedelta("12m34s")
datetime.timedelta(seconds=754)
>>> ptd.to_seconds("3h23m4s", as_int=True)
12184
>>> ptd.to_seconds("3.96ms")
0.00396

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

ptimedelta-0.1.5.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

ptimedelta-0.1.5-py2.py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 2 Python 3

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