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.4.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for ptimedelta-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dc1d04ca00efaac96a2a19f9093f82713e603ef7719e1c536f5953f3e3f0f64 |
|
MD5 | 34586590f23380bdefbb9d0e4b7175e2 |
|
BLAKE2b-256 | 49aeb40d34db6666dc903e2a069ff69f806ae670527c96efacfef304dcd5fd2b |