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
- Supports Python2.7, Python3+.
- 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)
Built Distribution
Close
Hashes for ptimedelta-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cc57f485c95d8080fa497d795bf96fadfe8c402352ada8dabd4801d3726c1a2 |
|
MD5 | 1b8fbaf90bd2895371ca8f8496661352 |
|
BLAKE2b-256 | 08fb4f5a0ddbd3f7012be06e5091d118bdca7bb12600af2a2ba1df4fdbcb05ac |