encommon 0.15.0__tar.gz → 0.16.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. {encommon-0.15.0/encommon.egg-info → encommon-0.16.0}/PKG-INFO +1 -1
  2. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/config.py +13 -13
  3. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/logger.py +1 -1
  4. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/test/test_config.py +35 -2
  5. {encommon-0.15.0 → encommon-0.16.0}/encommon/crypts/crypts.py +2 -2
  6. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/time.py +1 -3
  7. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/timers.py +2 -2
  8. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/windows.py +2 -2
  9. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/classes.py +2 -2
  10. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/test/test_classes.py +2 -2
  11. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/sample.py +2 -2
  12. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/stdout.py +2 -3
  13. encommon-0.16.0/encommon/version.txt +1 -0
  14. {encommon-0.15.0 → encommon-0.16.0/encommon.egg-info}/PKG-INFO +1 -1
  15. {encommon-0.15.0 → encommon-0.16.0}/setup.cfg +0 -4
  16. encommon-0.15.0/encommon/version.txt +0 -1
  17. {encommon-0.15.0 → encommon-0.16.0}/LICENSE +0 -0
  18. {encommon-0.15.0 → encommon-0.16.0}/MANIFEST.in +0 -0
  19. {encommon-0.15.0 → encommon-0.16.0}/README.md +0 -0
  20. {encommon-0.15.0 → encommon-0.16.0}/encommon/__init__.py +0 -0
  21. {encommon-0.15.0 → encommon-0.16.0}/encommon/colors/__init__.py +0 -0
  22. {encommon-0.15.0 → encommon-0.16.0}/encommon/colors/color.py +0 -0
  23. {encommon-0.15.0 → encommon-0.16.0}/encommon/colors/test/__init__.py +0 -0
  24. {encommon-0.15.0 → encommon-0.16.0}/encommon/colors/test/test_color.py +0 -0
  25. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/__init__.py +0 -0
  26. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/files.py +0 -0
  27. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/params.py +0 -0
  28. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/paths.py +0 -0
  29. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/test/__init__.py +0 -0
  30. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/test/test_files.py +0 -0
  31. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/test/test_logger.py +0 -0
  32. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/test/test_paths.py +0 -0
  33. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/test/test_utils.py +0 -0
  34. {encommon-0.15.0 → encommon-0.16.0}/encommon/config/utils.py +0 -0
  35. {encommon-0.15.0 → encommon-0.16.0}/encommon/conftest.py +0 -0
  36. {encommon-0.15.0 → encommon-0.16.0}/encommon/crypts/__init__.py +0 -0
  37. {encommon-0.15.0 → encommon-0.16.0}/encommon/crypts/hashes.py +0 -0
  38. {encommon-0.15.0 → encommon-0.16.0}/encommon/crypts/params.py +0 -0
  39. {encommon-0.15.0 → encommon-0.16.0}/encommon/crypts/test/__init__.py +0 -0
  40. {encommon-0.15.0 → encommon-0.16.0}/encommon/crypts/test/test_crypts.py +0 -0
  41. {encommon-0.15.0 → encommon-0.16.0}/encommon/crypts/test/test_hashes.py +0 -0
  42. {encommon-0.15.0 → encommon-0.16.0}/encommon/py.typed +0 -0
  43. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/__init__.py +0 -0
  44. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/common.py +0 -0
  45. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/duration.py +0 -0
  46. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/params.py +0 -0
  47. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/parse.py +0 -0
  48. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/__init__.py +0 -0
  49. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_duration.py +0 -0
  50. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_params.py +0 -0
  51. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_parse.py +0 -0
  52. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_time.py +0 -0
  53. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_timer.py +0 -0
  54. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_timers.py +0 -0
  55. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_unitime.py +0 -0
  56. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_utils.py +0 -0
  57. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_window.py +0 -0
  58. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/test/test_windows.py +0 -0
  59. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/timer.py +0 -0
  60. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/unitime.py +0 -0
  61. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/utils.py +0 -0
  62. {encommon-0.15.0 → encommon-0.16.0}/encommon/times/window.py +0 -0
  63. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/__init__.py +0 -0
  64. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/dicts.py +0 -0
  65. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/empty.py +0 -0
  66. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/lists.py +0 -0
  67. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/notate.py +0 -0
  68. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/strings.py +0 -0
  69. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/test/__init__.py +0 -0
  70. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/test/test_dicts.py +0 -0
  71. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/test/test_empty.py +0 -0
  72. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/test/test_lists.py +0 -0
  73. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/test/test_notate.py +0 -0
  74. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/test/test_strings.py +0 -0
  75. {encommon-0.15.0 → encommon-0.16.0}/encommon/types/types.py +0 -0
  76. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/__init__.py +0 -0
  77. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/common.py +0 -0
  78. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/files.py +0 -0
  79. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/match.py +0 -0
  80. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/paths.py +0 -0
  81. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/test/__init__.py +0 -0
  82. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/test/test_files.py +0 -0
  83. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/test/test_match.py +0 -0
  84. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/test/test_paths.py +0 -0
  85. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/test/test_sample.py +0 -0
  86. {encommon-0.15.0 → encommon-0.16.0}/encommon/utils/test/test_stdout.py +0 -0
  87. {encommon-0.15.0 → encommon-0.16.0}/encommon.egg-info/SOURCES.txt +0 -0
  88. {encommon-0.15.0 → encommon-0.16.0}/encommon.egg-info/dependency_links.txt +0 -0
  89. {encommon-0.15.0 → encommon-0.16.0}/encommon.egg-info/requires.txt +0 -0
  90. {encommon-0.15.0 → encommon-0.16.0}/encommon.egg-info/top_level.txt +0 -0
  91. {encommon-0.15.0 → encommon-0.16.0}/pyproject.toml +0 -0
  92. {encommon-0.15.0 → encommon-0.16.0}/reqs-install.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.15.0
3
+ Version: 0.16.0
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -174,19 +174,6 @@ class Config:
174
174
  return deepcopy(returned)
175
175
 
176
176
 
177
- @property
178
- def config(
179
- self,
180
- ) -> DictStrAny:
181
- """
182
- Return the configuration dumped from the Pydantic model.
183
-
184
- :returns: Configuration dumped from the Pydantic model.
185
- """
186
-
187
- return self.params.model_dump()
188
-
189
-
190
177
  @property
191
178
  def basic(
192
179
  self,
@@ -278,6 +265,19 @@ class Config:
278
265
  return self.__params
279
266
 
280
267
 
268
+ @property
269
+ def config(
270
+ self,
271
+ ) -> DictStrAny:
272
+ """
273
+ Return the configuration dumped from the Pydantic model.
274
+
275
+ :returns: Configuration dumped from the Pydantic model.
276
+ """
277
+
278
+ return self.params.endumped
279
+
280
+
281
281
  @property
282
282
  def logger(
283
283
  self,
@@ -329,7 +329,7 @@ class Logger:
329
329
  :param stdo_level: Minimum level for the message to pass.
330
330
  :param file_level: Minimum level for the message to pass.
331
331
  :param file_path: Enables writing to the filesystem path.
332
- :param params: Parameters for instantiating the instance.
332
+ :param params: Parameters used to instantiate the class.
333
333
  """
334
334
 
335
335
  __params: 'LoggerParams'
@@ -68,8 +68,6 @@ def test_Config(
68
68
 
69
69
  assert len(config.sargs) == 1
70
70
 
71
- assert len(config.config) == 3
72
-
73
71
  assert len(config.basic) == 3
74
72
 
75
73
  assert len(config.merge) == 5
@@ -78,6 +76,8 @@ def test_Config(
78
76
 
79
77
  assert config.params
80
78
 
79
+ assert len(config.config) == 3
80
+
81
81
  assert config.logger
82
82
 
83
83
  assert config.crypts
@@ -87,6 +87,39 @@ def test_Config(
87
87
  'pytemp': tmp_path,
88
88
  'PROJECT': PROJECT}
89
89
 
90
+
91
+ sample_path = (
92
+ SAMPLES / 'basic.json')
93
+
94
+ sample = load_sample(
95
+ path=sample_path,
96
+ update=ENPYRWS,
97
+ content=config.basic,
98
+ replace=replaces)
99
+
100
+ expect = prep_sample(
101
+ content=config.basic,
102
+ replace=replaces)
103
+
104
+ assert expect == sample
105
+
106
+
107
+ sample_path = (
108
+ SAMPLES / 'merge.json')
109
+
110
+ sample = load_sample(
111
+ path=sample_path,
112
+ update=ENPYRWS,
113
+ content=config.merge,
114
+ replace=replaces)
115
+
116
+ expect = prep_sample(
117
+ content=config.merge,
118
+ replace=replaces)
119
+
120
+ assert expect == sample
121
+
122
+
90
123
  sample_path = (
91
124
  SAMPLES / 'config.json')
92
125
 
@@ -48,7 +48,7 @@ class Crypts:
48
48
  >>> crypts.decrypt(encrypt)
49
49
  'example'
50
50
 
51
- :param params: Parameters for instantiating the instance.
51
+ :param params: Parameters used to instantiate the class.
52
52
  """
53
53
 
54
54
  __params: 'CryptsParams'
@@ -154,7 +154,7 @@ class Crypts:
154
154
  Create a new phrase using the provided input parameters.
155
155
 
156
156
  :param unique: Unique identifier of mapping passphrase.
157
- :param params: Parameters for instantiating the instance.
157
+ :param params: Parameters used to instantiate the class.
158
158
  """
159
159
 
160
160
  phrases = self.params.phrases
@@ -134,9 +134,7 @@ class Time:
134
134
  :returns: Boolean indicating outcome from the operation.
135
135
  """
136
136
 
137
- hashed = int(self.mpoch)
138
-
139
- return int(1e9 + hashed)
137
+ return hash(self.__source)
140
138
 
141
139
 
142
140
  def __str__(
@@ -97,7 +97,7 @@ class Timers:
97
97
  >>> timers.ready('one')
98
98
  True
99
99
 
100
- :param params: Parameters for instantiating the instance.
100
+ :param params: Parameters used to instantiate the class.
101
101
  :param store: Optional database path for keeping state.
102
102
  :param group: Optional override for default group name.
103
103
  """
@@ -374,7 +374,7 @@ class Timers:
374
374
  Create a new timer using the provided input parameters.
375
375
 
376
376
  :param unique: Unique identifier for the related child.
377
- :param params: Parameters for instantiating the instance.
377
+ :param params: Parameters used to instantiate the class.
378
378
  :returns: Newly constructed instance of related class.
379
379
  """
380
380
 
@@ -97,7 +97,7 @@ class Windows:
97
97
  >>> [windows.ready('one') for x in range(3)]
98
98
  [True, True, False]
99
99
 
100
- :param params: Parameters for instantiating the instance.
100
+ :param params: Parameters used to instantiate the class.
101
101
  :param start: Determine the start for scheduling window.
102
102
  :param stop: Determine the ending for scheduling window.
103
103
  :param store: Optional database path for keeping state.
@@ -439,7 +439,7 @@ class Windows:
439
439
  Create a new window using the provided input parameters.
440
440
 
441
441
  :param unique: Unique identifier for the related child.
442
- :param params: Parameters for instantiating the instance.
442
+ :param params: Parameters used to instantiate the class.
443
443
  :returns: Newly constructed instance of related class.
444
444
  """
445
445
 
@@ -22,7 +22,7 @@ class BaseModel(Pydantic, extra='forbid'):
22
22
 
23
23
 
24
24
  @property
25
- def model_dumped(
25
+ def endumped(
26
26
  self,
27
27
  ) -> DictStrAny:
28
28
  """
@@ -35,7 +35,7 @@ class BaseModel(Pydantic, extra='forbid'):
35
35
 
36
36
 
37
37
  @property
38
- def model_pruned(
38
+ def enpruned(
39
39
  self,
40
40
  ) -> DictStrAny:
41
41
  """
@@ -26,8 +26,8 @@ def test_BaseModel() -> None:
26
26
  params = LoggerParams(
27
27
  stdo_level='info')
28
28
 
29
- dumped = params.model_dumped
30
- pruned = params.model_pruned
29
+ dumped = params.endumped
30
+ pruned = params.enpruned
31
31
 
32
32
  assert dumped == {
33
33
  'file_level': None,
@@ -16,10 +16,10 @@ from typing import Any
16
16
  from typing import Callable
17
17
  from typing import Optional
18
18
 
19
- from pydantic import BaseModel
20
19
 
21
20
  from .files import read_text
22
21
  from .files import save_text
22
+ from ..types import BaseModel
23
23
  from ..types import DictStrAny
24
24
  from ..types import rplstr
25
25
 
@@ -72,7 +72,7 @@ def prep_sample( # noqa: CFQ004
72
72
  return asdict(value)
73
73
 
74
74
  if isinstance(value, BaseModel):
75
- return value.model_dump()
75
+ return value.endumped
76
76
 
77
77
  return str(value)
78
78
 
@@ -19,11 +19,10 @@ from typing import Optional
19
19
  from typing import TYPE_CHECKING
20
20
  from typing import Union
21
21
 
22
- from pydantic import BaseModel
23
-
24
22
  from .common import JOINABLE
25
23
  from ..times import Duration
26
24
  from ..times import Time
25
+ from ..types import BaseModel
27
26
  from ..types import Empty
28
27
  from ..types import clsname
29
28
  from ..types.strings import COMMAD
@@ -308,7 +307,7 @@ def array_ansi( # noqa: CFQ001, CFQ004
308
307
  ) -> None:
309
308
 
310
309
  if isinstance(source, BaseModel):
311
- source = source.model_dump()
310
+ source = source.endumped
312
311
 
313
312
  if is_dataclass(source):
314
313
  source = asdict(source)
@@ -0,0 +1 @@
1
+ 0.16.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.15.0
3
+ Version: 0.16.0
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -10,12 +10,8 @@ ignore =
10
10
  SFS301,
11
11
  W503,
12
12
  per-file-ignores =
13
- encommon/conftest.py:LIT015,
14
13
  encommon/crypts/hashes.py:S324,
15
- encommon/times/timers.py:S608,
16
- encommon/times/windows.py:S608,
17
14
  encommon/times/utils.py:DTZ001,
18
- encommon/utils/test/test_sample.py:S108,
19
15
  encommon/utils/test/test_stdout.py:LIT015,
20
16
  encommon/utils/sample.py:ANN401,SIM114,
21
17
  encommon/utils/stdout.py:SIM114,
@@ -1 +0,0 @@
1
- 0.15.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes