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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b08adcc486ef1905f0b0413864bf7d039ef3ad3900ca40f526b450d25496a01
|
|
| MD5 |
d4b44dba6ef135e3874be02b71a5ac0e
|
|
| BLAKE2b-256 |
4bd9ee22e0d689786ba3a27fa270a76cb594895882f015ace9bb3ab2ec621b68
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cc57f485c95d8080fa497d795bf96fadfe8c402352ada8dabd4801d3726c1a2
|
|
| MD5 |
1b8fbaf90bd2895371ca8f8496661352
|
|
| BLAKE2b-256 |
08fb4f5a0ddbd3f7012be06e5091d118bdca7bb12600af2a2ba1df4fdbcb05ac
|