python-utils 3.9.0__py2.py3-none-any.whl → 3.9.1__py2.py3-none-any.whl
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.
- python_utils/__about__.py +1 -1
- python_utils/__init__.py +30 -30
- python_utils/formatters.py +5 -5
- python_utils/types.py +84 -84
- {python_utils-3.9.0.dist-info → python_utils-3.9.1.dist-info}/METADATA +20 -20
- {python_utils-3.9.0.dist-info → python_utils-3.9.1.dist-info}/RECORD +9 -9
- {python_utils-3.9.0.dist-info → python_utils-3.9.1.dist-info}/WHEEL +1 -1
- {python_utils-3.9.0.dist-info → python_utils-3.9.1.dist-info}/LICENSE +0 -0
- {python_utils-3.9.0.dist-info → python_utils-3.9.1.dist-info}/top_level.txt +0 -0
python_utils/__about__.py
CHANGED
python_utils/__init__.py
CHANGED
|
@@ -83,44 +83,44 @@ from .time import (
|
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
__all__ = [
|
|
86
|
+
'CastedDict',
|
|
87
|
+
'LazyCastedDict',
|
|
88
|
+
'Logged',
|
|
89
|
+
'LoggerBase',
|
|
90
|
+
'UniqueList',
|
|
91
|
+
'abatcher',
|
|
92
|
+
'acount',
|
|
86
93
|
'aio',
|
|
87
|
-
'
|
|
94
|
+
'aio_generator_timeout_detector',
|
|
95
|
+
'aio_generator_timeout_detector_decorator',
|
|
96
|
+
'aio_timeout_generator',
|
|
97
|
+
'batcher',
|
|
98
|
+
'camel_to_underscore',
|
|
88
99
|
'converters',
|
|
89
100
|
'decorators',
|
|
101
|
+
'delta_to_seconds',
|
|
102
|
+
'delta_to_seconds_or_none',
|
|
103
|
+
'format_time',
|
|
90
104
|
'formatters',
|
|
105
|
+
'generators',
|
|
106
|
+
'get_terminal_size',
|
|
91
107
|
'import_',
|
|
108
|
+
'import_global',
|
|
109
|
+
'listify',
|
|
92
110
|
'logger',
|
|
93
|
-
'
|
|
94
|
-
'time',
|
|
95
|
-
'types',
|
|
96
|
-
'to_int',
|
|
97
|
-
'to_float',
|
|
98
|
-
'to_unicode',
|
|
99
|
-
'to_str',
|
|
100
|
-
'scale_1024',
|
|
111
|
+
'raise_exception',
|
|
101
112
|
'remap',
|
|
113
|
+
'reraise',
|
|
114
|
+
'scale_1024',
|
|
102
115
|
'set_attributes',
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'timesince',
|
|
106
|
-
'import_global',
|
|
107
|
-
'get_terminal_size',
|
|
116
|
+
'terminal',
|
|
117
|
+
'time',
|
|
108
118
|
'timedelta_to_seconds',
|
|
109
|
-
'format_time',
|
|
110
119
|
'timeout_generator',
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'
|
|
116
|
-
'
|
|
117
|
-
'delta_to_seconds',
|
|
118
|
-
'delta_to_seconds_or_none',
|
|
119
|
-
'reraise',
|
|
120
|
-
'raise_exception',
|
|
121
|
-
'Logged',
|
|
122
|
-
'LoggerBase',
|
|
123
|
-
'CastedDict',
|
|
124
|
-
'LazyCastedDict',
|
|
125
|
-
'UniqueList',
|
|
120
|
+
'timesince',
|
|
121
|
+
'to_float',
|
|
122
|
+
'to_int',
|
|
123
|
+
'to_str',
|
|
124
|
+
'to_unicode',
|
|
125
|
+
'types',
|
|
126
126
|
]
|
python_utils/formatters.py
CHANGED
|
@@ -161,11 +161,11 @@ def timesince(
|
|
|
161
161
|
|
|
162
162
|
output: types.List[str] = []
|
|
163
163
|
for period, singular, plural in periods:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
int_period = int(period)
|
|
165
|
+
if int_period == 1:
|
|
166
|
+
output.append(f'{int_period} {singular}')
|
|
167
|
+
elif int_period:
|
|
168
|
+
output.append(f'{int_period} {plural}')
|
|
169
169
|
|
|
170
170
|
if output:
|
|
171
171
|
return f'{" and ".join(output[:2])} ago'
|
python_utils/types.py
CHANGED
|
@@ -54,128 +54,128 @@ timestamp_type = U[
|
|
|
54
54
|
]
|
|
55
55
|
|
|
56
56
|
__all__ = [
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
|
|
60
|
-
'
|
|
61
|
-
'timestamp_type',
|
|
57
|
+
'IO',
|
|
58
|
+
'TYPE_CHECKING',
|
|
59
|
+
# ABCs (from collections.abc).
|
|
60
|
+
'AbstractSet',
|
|
62
61
|
# The types from the typing module.
|
|
63
62
|
# Super-special typing primitives.
|
|
64
63
|
'Annotated',
|
|
65
64
|
'Any',
|
|
65
|
+
# One-off things.
|
|
66
|
+
'AnyStr',
|
|
67
|
+
'AsyncContextManager',
|
|
68
|
+
'AsyncGenerator',
|
|
69
|
+
'AsyncGeneratorType',
|
|
70
|
+
'AsyncIterable',
|
|
71
|
+
'AsyncIterator',
|
|
72
|
+
'Awaitable',
|
|
73
|
+
# Other concrete types.
|
|
74
|
+
'BinaryIO',
|
|
75
|
+
'BuiltinFunctionType',
|
|
76
|
+
'BuiltinMethodType',
|
|
77
|
+
'ByteString',
|
|
66
78
|
'Callable',
|
|
79
|
+
# Concrete collection types.
|
|
80
|
+
'ChainMap',
|
|
81
|
+
'ClassMethodDescriptorType',
|
|
67
82
|
'ClassVar',
|
|
83
|
+
'CodeType',
|
|
84
|
+
'Collection',
|
|
68
85
|
'Concatenate',
|
|
86
|
+
'Container',
|
|
87
|
+
'ContextManager',
|
|
88
|
+
'Coroutine',
|
|
89
|
+
'CoroutineType',
|
|
90
|
+
'Counter',
|
|
91
|
+
'DecimalNumber',
|
|
92
|
+
'DefaultDict',
|
|
93
|
+
'Deque',
|
|
94
|
+
'Dict',
|
|
95
|
+
'DynamicClassAttribute',
|
|
69
96
|
'Final',
|
|
70
97
|
'ForwardRef',
|
|
98
|
+
'FrameType',
|
|
99
|
+
'FrozenSet',
|
|
100
|
+
# Types from the `types` module.
|
|
101
|
+
'FunctionType',
|
|
102
|
+
'Generator',
|
|
103
|
+
'GeneratorType',
|
|
71
104
|
'Generic',
|
|
72
|
-
'
|
|
73
|
-
'SupportsIndex',
|
|
74
|
-
'Optional',
|
|
75
|
-
'ParamSpec',
|
|
76
|
-
'ParamSpecArgs',
|
|
77
|
-
'ParamSpecKwargs',
|
|
78
|
-
'Protocol',
|
|
79
|
-
'Tuple',
|
|
80
|
-
'Type',
|
|
81
|
-
'TypeVar',
|
|
82
|
-
'Union',
|
|
83
|
-
# ABCs (from collections.abc).
|
|
84
|
-
'AbstractSet',
|
|
85
|
-
'ByteString',
|
|
86
|
-
'Container',
|
|
87
|
-
'ContextManager',
|
|
105
|
+
'GetSetDescriptorType',
|
|
88
106
|
'Hashable',
|
|
89
107
|
'ItemsView',
|
|
90
108
|
'Iterable',
|
|
91
109
|
'Iterator',
|
|
92
110
|
'KeysView',
|
|
111
|
+
'LambdaType',
|
|
112
|
+
'List',
|
|
113
|
+
'Literal',
|
|
93
114
|
'Mapping',
|
|
115
|
+
'MappingProxyType',
|
|
94
116
|
'MappingView',
|
|
117
|
+
'Match',
|
|
118
|
+
'MemberDescriptorType',
|
|
119
|
+
'MethodDescriptorType',
|
|
120
|
+
'MethodType',
|
|
121
|
+
'MethodWrapperType',
|
|
122
|
+
'ModuleType',
|
|
95
123
|
'MutableMapping',
|
|
96
124
|
'MutableSequence',
|
|
97
125
|
'MutableSet',
|
|
98
|
-
'
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
'
|
|
126
|
+
'NamedTuple', # Not really a type.
|
|
127
|
+
'NewType',
|
|
128
|
+
'NoReturn',
|
|
129
|
+
'Number',
|
|
130
|
+
'Optional',
|
|
131
|
+
'OptionalScope',
|
|
132
|
+
'OrderedDict',
|
|
133
|
+
'ParamSpec',
|
|
134
|
+
'ParamSpecArgs',
|
|
135
|
+
'ParamSpecKwargs',
|
|
136
|
+
'Pattern',
|
|
137
|
+
'Protocol',
|
|
108
138
|
# Structural checks, a.k.a. protocols.
|
|
109
139
|
'Reversible',
|
|
140
|
+
'Sequence',
|
|
141
|
+
'Set',
|
|
142
|
+
'SimpleNamespace',
|
|
143
|
+
'Sized',
|
|
110
144
|
'SupportsAbs',
|
|
111
145
|
'SupportsBytes',
|
|
112
146
|
'SupportsComplex',
|
|
113
147
|
'SupportsFloat',
|
|
114
148
|
'SupportsIndex',
|
|
149
|
+
'SupportsIndex',
|
|
115
150
|
'SupportsInt',
|
|
116
151
|
'SupportsRound',
|
|
117
|
-
|
|
118
|
-
'ChainMap',
|
|
119
|
-
'Counter',
|
|
120
|
-
'Deque',
|
|
121
|
-
'Dict',
|
|
122
|
-
'DefaultDict',
|
|
123
|
-
'List',
|
|
124
|
-
'OrderedDict',
|
|
125
|
-
'Set',
|
|
126
|
-
'FrozenSet',
|
|
127
|
-
'NamedTuple', # Not really a type.
|
|
128
|
-
'TypedDict', # Not really a type.
|
|
129
|
-
'Generator',
|
|
130
|
-
# Other concrete types.
|
|
131
|
-
'BinaryIO',
|
|
132
|
-
'IO',
|
|
133
|
-
'Match',
|
|
134
|
-
'Pattern',
|
|
152
|
+
'Text',
|
|
135
153
|
'TextIO',
|
|
136
|
-
|
|
137
|
-
'
|
|
154
|
+
'TracebackType',
|
|
155
|
+
'TracebackType',
|
|
156
|
+
'Tuple',
|
|
157
|
+
'Type',
|
|
158
|
+
'TypeAlias',
|
|
159
|
+
'TypeGuard',
|
|
160
|
+
'TypeVar',
|
|
161
|
+
'TypedDict', # Not really a type.
|
|
162
|
+
'Union',
|
|
163
|
+
'ValuesView',
|
|
164
|
+
'WrapperDescriptorType',
|
|
138
165
|
'cast',
|
|
166
|
+
'coroutine',
|
|
167
|
+
'delta_type',
|
|
139
168
|
'final',
|
|
140
169
|
'get_args',
|
|
141
170
|
'get_origin',
|
|
142
171
|
'get_type_hints',
|
|
143
172
|
'is_typeddict',
|
|
144
|
-
'
|
|
173
|
+
'new_class',
|
|
145
174
|
'no_type_check',
|
|
146
175
|
'no_type_check_decorator',
|
|
147
|
-
'NoReturn',
|
|
148
176
|
'overload',
|
|
149
|
-
'runtime_checkable',
|
|
150
|
-
'Text',
|
|
151
|
-
'TYPE_CHECKING',
|
|
152
|
-
'TypeAlias',
|
|
153
|
-
'TypeGuard',
|
|
154
|
-
'TracebackType',
|
|
155
|
-
# Types from the `types` module.
|
|
156
|
-
'FunctionType',
|
|
157
|
-
'LambdaType',
|
|
158
|
-
'CodeType',
|
|
159
|
-
'MappingProxyType',
|
|
160
|
-
'SimpleNamespace',
|
|
161
|
-
'GeneratorType',
|
|
162
|
-
'CoroutineType',
|
|
163
|
-
'AsyncGeneratorType',
|
|
164
|
-
'MethodType',
|
|
165
|
-
'BuiltinFunctionType',
|
|
166
|
-
'BuiltinMethodType',
|
|
167
|
-
'WrapperDescriptorType',
|
|
168
|
-
'MethodWrapperType',
|
|
169
|
-
'MethodDescriptorType',
|
|
170
|
-
'ClassMethodDescriptorType',
|
|
171
|
-
'ModuleType',
|
|
172
|
-
'TracebackType',
|
|
173
|
-
'FrameType',
|
|
174
|
-
'GetSetDescriptorType',
|
|
175
|
-
'MemberDescriptorType',
|
|
176
|
-
'new_class',
|
|
177
|
-
'resolve_bases',
|
|
178
177
|
'prepare_class',
|
|
179
|
-
'
|
|
180
|
-
'
|
|
178
|
+
'resolve_bases',
|
|
179
|
+
'runtime_checkable',
|
|
180
|
+
'timestamp_type',
|
|
181
181
|
]
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-utils
|
|
3
|
-
Version: 3.9.
|
|
3
|
+
Version: 3.9.1
|
|
4
4
|
Summary: Python Utils is a module with some convenient utilities not included with the standard Python install
|
|
5
5
|
Home-page: https://github.com/WoLpH/python-utils
|
|
6
6
|
Author: Rick van Hattem
|
|
7
7
|
Author-email: Wolph@wol.ph
|
|
8
8
|
License: BSD
|
|
9
9
|
Classifier: License :: OSI Approved :: BSD License
|
|
10
|
-
Requires-Python:
|
|
10
|
+
Requires-Python: >=3.9.0
|
|
11
11
|
License-File: LICENSE
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Provides-Extra: docs
|
|
14
|
-
Requires-Dist: mock ; extra == 'docs'
|
|
15
|
-
Requires-Dist: sphinx ; extra == 'docs'
|
|
16
|
-
Requires-Dist: python-utils ; extra == 'docs'
|
|
12
|
+
Requires-Dist: typing_extensions>3.10.0.2
|
|
17
13
|
Provides-Extra: loguru
|
|
18
|
-
Requires-Dist: loguru
|
|
14
|
+
Requires-Dist: loguru; extra == "loguru"
|
|
15
|
+
Provides-Extra: docs
|
|
16
|
+
Requires-Dist: mock; extra == "docs"
|
|
17
|
+
Requires-Dist: sphinx; extra == "docs"
|
|
18
|
+
Requires-Dist: python-utils; extra == "docs"
|
|
19
19
|
Provides-Extra: tests
|
|
20
|
-
Requires-Dist: ruff
|
|
21
|
-
Requires-Dist: pyright
|
|
22
|
-
Requires-Dist: pytest
|
|
23
|
-
Requires-Dist: pytest-cov
|
|
24
|
-
Requires-Dist: pytest-mypy
|
|
25
|
-
Requires-Dist: pytest-asyncio
|
|
26
|
-
Requires-Dist: sphinx
|
|
27
|
-
Requires-Dist: types-setuptools
|
|
28
|
-
Requires-Dist: loguru
|
|
29
|
-
Requires-Dist: loguru-mypy
|
|
30
|
-
Requires-Dist: mypy-ipython
|
|
31
|
-
Requires-Dist: blessings
|
|
20
|
+
Requires-Dist: ruff; extra == "tests"
|
|
21
|
+
Requires-Dist: pyright; extra == "tests"
|
|
22
|
+
Requires-Dist: pytest; extra == "tests"
|
|
23
|
+
Requires-Dist: pytest-cov; extra == "tests"
|
|
24
|
+
Requires-Dist: pytest-mypy; extra == "tests"
|
|
25
|
+
Requires-Dist: pytest-asyncio; extra == "tests"
|
|
26
|
+
Requires-Dist: sphinx; extra == "tests"
|
|
27
|
+
Requires-Dist: types-setuptools; extra == "tests"
|
|
28
|
+
Requires-Dist: loguru; extra == "tests"
|
|
29
|
+
Requires-Dist: loguru-mypy; extra == "tests"
|
|
30
|
+
Requires-Dist: mypy-ipython; extra == "tests"
|
|
31
|
+
Requires-Dist: blessings; extra == "tests"
|
|
32
32
|
|
|
33
33
|
Useful Python Utils
|
|
34
34
|
==============================================================================
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
python_utils/__about__.py,sha256=
|
|
2
|
-
python_utils/__init__.py,sha256=
|
|
1
|
+
python_utils/__about__.py,sha256=lMOnYAVKooZBgJnTQi0kgx5Zxo8TyRkQRrnElLuV96Q,804
|
|
2
|
+
python_utils/__init__.py,sha256=yOVuE16cQ7DqhS1UWZoipE27BM4W4Lhh9iAR6-lPKbw,2490
|
|
3
3
|
python_utils/aio.py,sha256=9xoMe_MEtDErbEBBi8_7jVw54-zY6wv1hgGXzEL4_ww,2923
|
|
4
4
|
python_utils/containers.py,sha256=SNHXfDvbt5MNL4WZc9Nj7JxyAfEV5cHba6VR5pH-K2Y,19099
|
|
5
5
|
python_utils/converters.py,sha256=HyvQZzIFXuVdwGl20woiW_X_ri5PagULJOqV4jcjKUY,13906
|
|
6
6
|
python_utils/decorators.py,sha256=60uq2L-2vME6TZ5AquCDrbMnFgDlZN-gQvJ8ak8kxbY,5991
|
|
7
7
|
python_utils/exceptions.py,sha256=KSGLr1M3IolDaM_fp5iTsC8pek2O8lOpjIpc_5gWJnw,1135
|
|
8
|
-
python_utils/formatters.py,sha256=
|
|
8
|
+
python_utils/formatters.py,sha256=kKBB_EnfeDU63v0ue8dutnaOF267YnE8VTUcQcQza_A,5701
|
|
9
9
|
python_utils/generators.py,sha256=aR9iuUZcHGElSScTtLrBMBEd1-oYgG64UMyispDwNYY,3808
|
|
10
10
|
python_utils/import_.py,sha256=RO_zcslYCq19OopzZtqSugdFF5S0sP-s5FScpfjNEN4,3838
|
|
11
11
|
python_utils/logger.py,sha256=BD7W1R9jEBO4_Ik28mPG5AgajOFBkJDPqJfQQQNtSn8,9984
|
|
@@ -13,9 +13,9 @@ python_utils/loguru.py,sha256=oRuG6CHR5UvrvSdLoqrvwJLBqBbDWXZ4bvvI7Xoufh0,1357
|
|
|
13
13
|
python_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
python_utils/terminal.py,sha256=iv72wsIHjqX7g18qpdbn56aGHVY4WHCRiv7O6nYdCTs,5519
|
|
15
15
|
python_utils/time.py,sha256=Ad44NddQQYMNJnpvzeqIHfu-SIGgUoyUsTNJK3kkwkY,13135
|
|
16
|
-
python_utils/types.py,sha256=
|
|
17
|
-
python_utils-3.9.
|
|
18
|
-
python_utils-3.9.
|
|
19
|
-
python_utils-3.9.
|
|
20
|
-
python_utils-3.9.
|
|
21
|
-
python_utils-3.9.
|
|
16
|
+
python_utils/types.py,sha256=TLw3YAAaBgeg-CUsNpXHQdiIFelxnzXC9ZM4qtTmX7g,4096
|
|
17
|
+
python_utils-3.9.1.dist-info/LICENSE,sha256=_Zrs9NZu-G6_aZT2g3Jv5_JREJQfhRNBC61EH6WDH-o,1501
|
|
18
|
+
python_utils-3.9.1.dist-info/METADATA,sha256=yJ0LG1qDlonBQbvajT26FUs3OiFEWoy9TyMNHnq46Ws,9811
|
|
19
|
+
python_utils-3.9.1.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
|
|
20
|
+
python_utils-3.9.1.dist-info/top_level.txt,sha256=zAx6OfEsjJs8BEW3okSiG_j9gpkI69xWShzum6oBgKI,13
|
|
21
|
+
python_utils-3.9.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|