vcorelib 2.2.0__tar.gz → 2.2.2__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.
- {vcorelib-2.2.0 → vcorelib-2.2.2}/PKG-INFO +3 -3
- {vcorelib-2.2.0 → vcorelib-2.2.2}/README.md +2 -2
- {vcorelib-2.2.0 → vcorelib-2.2.2}/pyproject.toml +1 -1
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/__init__.py +2 -2
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/asyncio/__init__.py +5 -1
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/paths/__init__.py +33 -2
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/PKG-INFO +3 -3
- {vcorelib-2.2.0 → vcorelib-2.2.2}/LICENSE +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/setup.cfg +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/setup.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/tests/test_logging.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/tests/test_names.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/tests/test_namespace.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/args/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/args/newline.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/asyncio/cli.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/asyncio/subprocess.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dev_requirements.txt +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/cache.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/codec.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/config.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/env.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/abc.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/edge.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/node.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/port.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/abc.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/arbiter/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/arbiter/base.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/arbiter/context.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/arbiter/directory.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/archive/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/cache.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/decode.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/encode.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/mapping.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/types.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/logging.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/average.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/buffer.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/rate/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/rate/limiter.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/weighted.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/time.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/unit.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/names.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/namespace.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/paths/context.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/paths/info.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/paths/info_cache.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/platform/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/py.typed +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/requirements.txt +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/schemas/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/schemas/base.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/schemas/json.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/schemas/mixins.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/script/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/target/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/target/evaluation.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/target/expression.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/target/resolver.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/dict/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/dict/melder.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/manager.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/subprocess/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/subprocess/run.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/time/__init__.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/time/sleep.py +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/SOURCES.txt +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/dependency_links.txt +0 -0
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/requires.txt +2 -2
- {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vcorelib
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: A collection of core Python utilities.
|
|
5
5
|
Home-page: https://github.com/vkottler/vcorelib
|
|
6
6
|
Author: Vaughn Kottler
|
|
@@ -25,11 +25,11 @@ License-File: LICENSE
|
|
|
25
25
|
=====================================
|
|
26
26
|
generator=datazen
|
|
27
27
|
version=3.1.2
|
|
28
|
-
hash=
|
|
28
|
+
hash=9d5d3a05af6eef0ccd3e45362818a324
|
|
29
29
|
=====================================
|
|
30
30
|
-->
|
|
31
31
|
|
|
32
|
-
# vcorelib ([2.2.
|
|
32
|
+
# vcorelib ([2.2.2](https://pypi.org/project/vcorelib/))
|
|
33
33
|
|
|
34
34
|
[](https://pypi.org/project/vcorelib/)
|
|
35
35
|

|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
=====================================
|
|
3
3
|
generator=datazen
|
|
4
4
|
version=3.1.2
|
|
5
|
-
hash=
|
|
5
|
+
hash=9d5d3a05af6eef0ccd3e45362818a324
|
|
6
6
|
=====================================
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
|
-
# vcorelib ([2.2.
|
|
9
|
+
# vcorelib ([2.2.2](https://pypi.org/project/vcorelib/))
|
|
10
10
|
|
|
11
11
|
[](https://pypi.org/project/vcorelib/)
|
|
12
12
|

|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# =====================================
|
|
2
2
|
# generator=datazen
|
|
3
3
|
# version=3.1.2
|
|
4
|
-
# hash=
|
|
4
|
+
# hash=bdc75eb0a895b331c46cd22610ba8fbc
|
|
5
5
|
# =====================================
|
|
6
6
|
|
|
7
7
|
"""
|
|
@@ -10,7 +10,7 @@ Useful defaults and other package metadata.
|
|
|
10
10
|
|
|
11
11
|
DESCRIPTION = "A collection of core Python utilities."
|
|
12
12
|
PKG_NAME = "vcorelib"
|
|
13
|
-
VERSION = "2.2.
|
|
13
|
+
VERSION = "2.2.2"
|
|
14
14
|
|
|
15
15
|
# vcorelib-specific content.
|
|
16
16
|
DEFAULT_INDENT = 2
|
|
@@ -41,7 +41,11 @@ def log_task_exception(task: _Task[_Any], logger: _LoggerType = None) -> None:
|
|
|
41
41
|
if task.done():
|
|
42
42
|
with _suppress(_CancelledError):
|
|
43
43
|
exc = task.exception()
|
|
44
|
-
if
|
|
44
|
+
if (
|
|
45
|
+
exc is not None
|
|
46
|
+
and not isinstance(exc, _CancelledError)
|
|
47
|
+
and not isinstance(exc, KeyboardInterrupt)
|
|
48
|
+
):
|
|
45
49
|
logger.exception("Task raised exception:", exc_info=exc)
|
|
46
50
|
|
|
47
51
|
|
|
@@ -5,6 +5,7 @@ Common path manipulation utilities.
|
|
|
5
5
|
# built-in
|
|
6
6
|
from contextlib import suppress as _suppress
|
|
7
7
|
from hashlib import md5 as _md5
|
|
8
|
+
from hashlib import new as _new
|
|
8
9
|
from logging import Logger as _Logger
|
|
9
10
|
from os import stat_result as _stat_result
|
|
10
11
|
from pathlib import Path as _Path
|
|
@@ -102,15 +103,45 @@ def get_file_ext(path: Pathlike, maxsplit: int = -1) -> str:
|
|
|
102
103
|
return normalize(path).name.split(".", maxsplit=maxsplit)[-1]
|
|
103
104
|
|
|
104
105
|
|
|
106
|
+
DEFAULT_HASH = "sha256"
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def bytes_hash_hex(data: bytes, algorithm: str = DEFAULT_HASH) -> str:
|
|
110
|
+
"""
|
|
111
|
+
Get the hex digest from some bytes for some provided hashing algorithm.
|
|
112
|
+
"""
|
|
113
|
+
inst = _new(algorithm)
|
|
114
|
+
inst.update(data)
|
|
115
|
+
return inst.hexdigest()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def str_hash_hex(
|
|
119
|
+
data: str, encoding: str = _DEFAULT_ENCODING, algorithm: str = DEFAULT_HASH
|
|
120
|
+
) -> str:
|
|
121
|
+
"""Get the hex digest for string data."""
|
|
122
|
+
return bytes_hash_hex(bytes(data, encoding), algorithm=algorithm)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def file_hash_hex(path: Pathlike, algorithm: str = DEFAULT_HASH) -> str:
|
|
126
|
+
"""Get the hex digest from file data."""
|
|
127
|
+
with normalize(path).open("rb") as stream:
|
|
128
|
+
return bytes_hash_hex(stream.read(), algorithm=algorithm)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def bytes_md5_hex(data: bytes) -> str:
|
|
132
|
+
"""Get the MD5 sum for some bytes."""
|
|
133
|
+
return _md5(data).hexdigest()
|
|
134
|
+
|
|
135
|
+
|
|
105
136
|
def str_md5_hex(data: str, encoding: str = _DEFAULT_ENCODING) -> str:
|
|
106
137
|
"""Get an md5 hex string from string data."""
|
|
107
|
-
return
|
|
138
|
+
return bytes_md5_hex(bytes(data, encoding))
|
|
108
139
|
|
|
109
140
|
|
|
110
141
|
def file_md5_hex(path: Pathlike) -> str:
|
|
111
142
|
"""Get an md5 hex string for a file by path."""
|
|
112
143
|
with normalize(path).open("rb") as stream:
|
|
113
|
-
return
|
|
144
|
+
return bytes_md5_hex(stream.read())
|
|
114
145
|
|
|
115
146
|
|
|
116
147
|
def _construct_search_path(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vcorelib
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: A collection of core Python utilities.
|
|
5
5
|
Home-page: https://github.com/vkottler/vcorelib
|
|
6
6
|
Author: Vaughn Kottler
|
|
@@ -25,11 +25,11 @@ License-File: LICENSE
|
|
|
25
25
|
=====================================
|
|
26
26
|
generator=datazen
|
|
27
27
|
version=3.1.2
|
|
28
|
-
hash=
|
|
28
|
+
hash=9d5d3a05af6eef0ccd3e45362818a324
|
|
29
29
|
=====================================
|
|
30
30
|
-->
|
|
31
31
|
|
|
32
|
-
# vcorelib ([2.2.
|
|
32
|
+
# vcorelib ([2.2.2](https://pypi.org/project/vcorelib/))
|
|
33
33
|
|
|
34
34
|
[](https://pypi.org/project/vcorelib/)
|
|
35
35
|

|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|