durationpy 0.9__tar.gz → 0.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {durationpy-0.9 → durationpy-0.11}/PKG-INFO +10 -3
- {durationpy-0.9 → durationpy-0.11}/README.md +4 -0
- durationpy-0.11/durationpy/__init__.pyi +6 -0
- {durationpy-0.9 → durationpy-0.11}/durationpy/duration.py +9 -1
- durationpy-0.11/durationpy/py.typed +0 -0
- {durationpy-0.9 → durationpy-0.11}/durationpy.egg-info/PKG-INFO +10 -3
- {durationpy-0.9 → durationpy-0.11}/durationpy.egg-info/SOURCES.txt +2 -0
- {durationpy-0.9 → durationpy-0.11}/setup.py +3 -2
- {durationpy-0.9 → durationpy-0.11}/LICENSE +0 -0
- {durationpy-0.9 → durationpy-0.11}/durationpy/__init__.py +0 -0
- {durationpy-0.9 → durationpy-0.11}/durationpy.egg-info/dependency_links.txt +0 -0
- {durationpy-0.9 → durationpy-0.11}/durationpy.egg-info/top_level.txt +0 -0
- {durationpy-0.9 → durationpy-0.11}/setup.cfg +0 -0
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: durationpy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11
|
|
4
4
|
Summary: Module for converting between datetime.timedelta and Go's Duration strings.
|
|
5
5
|
Home-page: https://github.com/icholy/durationpy
|
|
6
|
-
Download-URL: https://github.com/icholy/durationpy/tarball/0.
|
|
6
|
+
Download-URL: https://github.com/icholy/durationpy/tarball/0.11
|
|
7
7
|
Author: Ilia Choly
|
|
8
8
|
Author-email: ilia.choly@gmail.com
|
|
9
9
|
License: MIT
|
|
10
10
|
License-File: LICENSE
|
|
11
|
+
Dynamic: author
|
|
12
|
+
Dynamic: author-email
|
|
13
|
+
Dynamic: download-url
|
|
14
|
+
Dynamic: home-page
|
|
15
|
+
Dynamic: license
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
Dynamic: summary
|
|
@@ -70,7 +70,15 @@ def from_str(duration):
|
|
|
70
70
|
"Invalid value {} in duration {}".format(value, original))
|
|
71
71
|
|
|
72
72
|
microseconds = total / _microsecond_size
|
|
73
|
-
|
|
73
|
+
try:
|
|
74
|
+
return datetime.timedelta(microseconds=sign * microseconds)
|
|
75
|
+
except (OverflowError, ValueError) as e:
|
|
76
|
+
# A huge value overflows timedelta's day count, and a value large enough
|
|
77
|
+
# to become float inf makes timedelta reject it too. Report either as a
|
|
78
|
+
# DurationError instead of leaking the raw exception.
|
|
79
|
+
raise DurationError(
|
|
80
|
+
"Duration out of range: {}".format(original)
|
|
81
|
+
) from e
|
|
74
82
|
|
|
75
83
|
def to_str(delta, extended=False):
|
|
76
84
|
"""Format a datetime.timedelta to a duration string"""
|
|
File without changes
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: durationpy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11
|
|
4
4
|
Summary: Module for converting between datetime.timedelta and Go's Duration strings.
|
|
5
5
|
Home-page: https://github.com/icholy/durationpy
|
|
6
|
-
Download-URL: https://github.com/icholy/durationpy/tarball/0.
|
|
6
|
+
Download-URL: https://github.com/icholy/durationpy/tarball/0.11
|
|
7
7
|
Author: Ilia Choly
|
|
8
8
|
Author-email: ilia.choly@gmail.com
|
|
9
9
|
License: MIT
|
|
10
10
|
License-File: LICENSE
|
|
11
|
+
Dynamic: author
|
|
12
|
+
Dynamic: author-email
|
|
13
|
+
Dynamic: download-url
|
|
14
|
+
Dynamic: home-page
|
|
15
|
+
Dynamic: license
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
Dynamic: summary
|
|
@@ -6,8 +6,9 @@ setup(
|
|
|
6
6
|
url = 'https://github.com/icholy/durationpy',
|
|
7
7
|
author = 'Ilia Choly',
|
|
8
8
|
author_email = 'ilia.choly@gmail.com',
|
|
9
|
-
download_url = 'https://github.com/icholy/durationpy/tarball/0.
|
|
10
|
-
version = '0.
|
|
9
|
+
download_url = 'https://github.com/icholy/durationpy/tarball/0.11',
|
|
10
|
+
version = '0.11',
|
|
11
11
|
packages = ['durationpy'],
|
|
12
|
+
package_data = {'durationpy': ['py.typed', '*.pyi']},
|
|
12
13
|
license = 'MIT'
|
|
13
14
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|