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.
Files changed (79) hide show
  1. {vcorelib-2.2.0 → vcorelib-2.2.2}/PKG-INFO +3 -3
  2. {vcorelib-2.2.0 → vcorelib-2.2.2}/README.md +2 -2
  3. {vcorelib-2.2.0 → vcorelib-2.2.2}/pyproject.toml +1 -1
  4. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/__init__.py +2 -2
  5. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/asyncio/__init__.py +5 -1
  6. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/paths/__init__.py +33 -2
  7. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/PKG-INFO +3 -3
  8. {vcorelib-2.2.0 → vcorelib-2.2.2}/LICENSE +0 -0
  9. {vcorelib-2.2.0 → vcorelib-2.2.2}/setup.cfg +0 -0
  10. {vcorelib-2.2.0 → vcorelib-2.2.2}/setup.py +0 -0
  11. {vcorelib-2.2.0 → vcorelib-2.2.2}/tests/test_logging.py +0 -0
  12. {vcorelib-2.2.0 → vcorelib-2.2.2}/tests/test_names.py +0 -0
  13. {vcorelib-2.2.0 → vcorelib-2.2.2}/tests/test_namespace.py +0 -0
  14. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/args/__init__.py +0 -0
  15. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/args/newline.py +0 -0
  16. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/asyncio/cli.py +0 -0
  17. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/asyncio/subprocess.py +0 -0
  18. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dev_requirements.txt +0 -0
  19. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/__init__.py +0 -0
  20. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/cache.py +0 -0
  21. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/codec.py +0 -0
  22. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/config.py +0 -0
  23. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/dict/env.py +0 -0
  24. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/__init__.py +0 -0
  25. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/abc.py +0 -0
  26. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/edge.py +0 -0
  27. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/node.py +0 -0
  28. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/graph/port.py +0 -0
  29. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/__init__.py +0 -0
  30. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/abc.py +0 -0
  31. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/arbiter/__init__.py +0 -0
  32. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/arbiter/base.py +0 -0
  33. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/arbiter/context.py +0 -0
  34. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/arbiter/directory.py +0 -0
  35. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/archive/__init__.py +0 -0
  36. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/cache.py +0 -0
  37. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/decode.py +0 -0
  38. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/encode.py +0 -0
  39. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/mapping.py +0 -0
  40. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/io/types.py +0 -0
  41. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/logging.py +0 -0
  42. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/__init__.py +0 -0
  43. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/__init__.py +0 -0
  44. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/average.py +0 -0
  45. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/buffer.py +0 -0
  46. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/rate/__init__.py +0 -0
  47. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/rate/limiter.py +0 -0
  48. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/analysis/weighted.py +0 -0
  49. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/time.py +0 -0
  50. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/math/unit.py +0 -0
  51. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/names.py +0 -0
  52. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/namespace.py +0 -0
  53. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/paths/context.py +0 -0
  54. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/paths/info.py +0 -0
  55. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/paths/info_cache.py +0 -0
  56. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/platform/__init__.py +0 -0
  57. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/py.typed +0 -0
  58. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/requirements.txt +0 -0
  59. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/schemas/__init__.py +0 -0
  60. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/schemas/base.py +0 -0
  61. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/schemas/json.py +0 -0
  62. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/schemas/mixins.py +0 -0
  63. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/script/__init__.py +0 -0
  64. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/target/__init__.py +0 -0
  65. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/target/evaluation.py +0 -0
  66. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/target/expression.py +0 -0
  67. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/target/resolver.py +0 -0
  68. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/__init__.py +0 -0
  69. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/dict/__init__.py +0 -0
  70. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/dict/melder.py +0 -0
  71. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/manager.py +0 -0
  72. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/subprocess/__init__.py +0 -0
  73. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/subprocess/run.py +0 -0
  74. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/time/__init__.py +0 -0
  75. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib/task/time/sleep.py +0 -0
  76. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/SOURCES.txt +0 -0
  77. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/dependency_links.txt +0 -0
  78. {vcorelib-2.2.0 → vcorelib-2.2.2}/vcorelib.egg-info/requires.txt +2 -2
  79. {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.0
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=374e34758a21f390e0aadace844e5d8c
28
+ hash=9d5d3a05af6eef0ccd3e45362818a324
29
29
  =====================================
30
30
  -->
31
31
 
32
- # vcorelib ([2.2.0](https://pypi.org/project/vcorelib/))
32
+ # vcorelib ([2.2.2](https://pypi.org/project/vcorelib/))
33
33
 
34
34
  [![python](https://img.shields.io/pypi/pyversions/vcorelib.svg)](https://pypi.org/project/vcorelib/)
35
35
  ![Build Status](https://github.com/vkottler/vcorelib/workflows/Python%20Package/badge.svg)
@@ -2,11 +2,11 @@
2
2
  =====================================
3
3
  generator=datazen
4
4
  version=3.1.2
5
- hash=374e34758a21f390e0aadace844e5d8c
5
+ hash=9d5d3a05af6eef0ccd3e45362818a324
6
6
  =====================================
7
7
  -->
8
8
 
9
- # vcorelib ([2.2.0](https://pypi.org/project/vcorelib/))
9
+ # vcorelib ([2.2.2](https://pypi.org/project/vcorelib/))
10
10
 
11
11
  [![python](https://img.shields.io/pypi/pyversions/vcorelib.svg)](https://pypi.org/project/vcorelib/)
12
12
  ![Build Status](https://github.com/vkottler/vcorelib/workflows/Python%20Package/badge.svg)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"
4
4
 
5
5
  [project]
6
6
  name = "vcorelib"
7
- version = "2.2.0"
7
+ version = "2.2.2"
8
8
  description = "A collection of core Python utilities."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -1,7 +1,7 @@
1
1
  # =====================================
2
2
  # generator=datazen
3
3
  # version=3.1.2
4
- # hash=fd79df0979840803853839ae98afb3ad
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.0"
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 exc is not None and not isinstance(exc, _CancelledError):
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 _md5(bytes(data, encoding)).hexdigest()
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 _md5(stream.read()).hexdigest()
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.0
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=374e34758a21f390e0aadace844e5d8c
28
+ hash=9d5d3a05af6eef0ccd3e45362818a324
29
29
  =====================================
30
30
  -->
31
31
 
32
- # vcorelib ([2.2.0](https://pypi.org/project/vcorelib/))
32
+ # vcorelib ([2.2.2](https://pypi.org/project/vcorelib/))
33
33
 
34
34
  [![python](https://img.shields.io/pypi/pyversions/vcorelib.svg)](https://pypi.org/project/vcorelib/)
35
35
  ![Build Status](https://github.com/vkottler/vcorelib/workflows/Python%20Package/badge.svg)
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
@@ -1,8 +1,8 @@
1
+ tomli
1
2
  fastjsonschema
2
- tomli-w
3
3
  ruamel.yaml
4
- tomli
5
4
  cerberus
5
+ tomli-w
6
6
 
7
7
  [test]
8
8
  pylint