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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file ptimedelta-0.1.5.tar.gz.

File metadata

  • Download URL: ptimedelta-0.1.5.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.1 Darwin/21.1.0

File hashes

Hashes for ptimedelta-0.1.5.tar.gz
Algorithm Hash digest
SHA256 2b08adcc486ef1905f0b0413864bf7d039ef3ad3900ca40f526b450d25496a01
MD5 d4b44dba6ef135e3874be02b71a5ac0e
BLAKE2b-256 4bd9ee22e0d689786ba3a27fa270a76cb594895882f015ace9bb3ab2ec621b68

See more details on using hashes here.

File details

Details for the file ptimedelta-0.1.5-py2.py3-none-any.whl.

File metadata

  • Download URL: ptimedelta-0.1.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.1 Darwin/21.1.0

File hashes

Hashes for ptimedelta-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4cc57f485c95d8080fa497d795bf96fadfe8c402352ada8dabd4801d3726c1a2
MD5 1b8fbaf90bd2895371ca8f8496661352
BLAKE2b-256 08fb4f5a0ddbd3f7012be06e5091d118bdca7bb12600af2a2ba1df4fdbcb05ac

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