encommon 0.19.2__tar.gz → 0.20.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {encommon-0.19.2/encommon.egg-info → encommon-0.20.1}/PKG-INFO +6 -4
- {encommon-0.19.2 → encommon-0.20.1}/README.md +3 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/colors/color.py +1 -4
- {encommon-0.19.2 → encommon-0.20.1}/encommon/colors/test/test_color.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/config.py +3 -3
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/test/test_config.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/test/test_files.py +4 -2
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/test/test_logger.py +4 -2
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/test/test_paths.py +4 -2
- {encommon-0.19.2 → encommon-0.20.1}/encommon/conftest.py +1 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/crypts/crypts.py +32 -11
- {encommon-0.19.2 → encommon-0.20.1}/encommon/crypts/test/test_crypts.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/crypts/test/test_hashes.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/parse/test/test_jinja2.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/parse/test/test_network.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/duration.py +1 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_duration.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_time.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_timer.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_timers.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_window.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_windows.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/timers.py +3 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/windows.py +3 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/test/test_empty.py +2 -1
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/stdout.py +4 -2
- encommon-0.20.1/encommon/version.txt +1 -0
- {encommon-0.19.2 → encommon-0.20.1/encommon.egg-info}/PKG-INFO +6 -4
- {encommon-0.19.2 → encommon-0.20.1}/pyproject.toml +3 -3
- {encommon-0.19.2 → encommon-0.20.1}/setup.cfg +1 -0
- encommon-0.19.2/encommon/version.txt +0 -1
- {encommon-0.19.2 → encommon-0.20.1}/LICENSE +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/MANIFEST.in +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/colors/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/colors/test/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/files.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/logger.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/params.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/paths.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/test/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/test/test_utils.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/config/utils.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/crypts/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/crypts/hashes.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/crypts/params.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/crypts/test/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/parse/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/parse/jinja2.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/parse/network.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/parse/test/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/py.typed +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/common.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/params.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/parse.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_params.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_parse.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_unitime.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/test/test_utils.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/time.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/timer.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/unitime.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/utils.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/times/window.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/classes.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/dicts.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/empty.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/lists.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/notate.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/strings.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/test/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/test/test_classes.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/test/test_dicts.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/test/test_lists.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/test/test_notate.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/test/test_strings.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/types/types.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/common.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/files.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/match.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/paths.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/sample.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/test/__init__.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/test/test_files.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/test/test_match.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/test/test_paths.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/test/test_sample.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon/utils/test/test_stdout.py +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon.egg-info/SOURCES.txt +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon.egg-info/dependency_links.txt +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon.egg-info/requires.txt +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/encommon.egg-info/top_level.txt +0 -0
- {encommon-0.19.2 → encommon-0.20.1}/reqs-install.txt +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: encommon
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.20.1
|
4
4
|
Summary: Enasis Network Common Library
|
5
5
|
License: MIT
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
7
|
-
Classifier: Programming Language :: Python :: 3.10
|
8
7
|
Classifier: Programming Language :: Python :: 3.11
|
9
|
-
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
9
|
+
Requires-Python: >=3.11
|
10
10
|
Description-Content-Type: text/markdown
|
11
11
|
License-File: LICENSE
|
12
12
|
Requires-Dist: croniter
|
@@ -39,6 +39,8 @@ Should you venture into the sections below you will be able to use the
|
|
39
39
|
## Projects using library
|
40
40
|
- [Enasis Network Remote Connect](https://github.com/enasisnetwork/enconnect)
|
41
41
|
- [Enasis Network Homie Automate](https://github.com/enasisnetwork/enhomie)
|
42
|
+
- [Enasis Network Chatting Robie](https://github.com/enasisnetwork/enrobie)
|
43
|
+
- [Enasis Network Orchestrations](https://github.com/enasisnetwork/orchestro)
|
42
44
|
|
43
45
|
## Installing the package
|
44
46
|
Installing stable from the PyPi repository
|
@@ -77,7 +79,7 @@ make -s pytest
|
|
77
79
|
```
|
78
80
|
|
79
81
|
## Version management
|
80
|
-
:warning: Ensure that no changes are pending.
|
82
|
+
> :warning: Ensure that no changes are pending.
|
81
83
|
|
82
84
|
1. Rebuild the environment.
|
83
85
|
```
|
@@ -18,6 +18,8 @@ Should you venture into the sections below you will be able to use the
|
|
18
18
|
## Projects using library
|
19
19
|
- [Enasis Network Remote Connect](https://github.com/enasisnetwork/enconnect)
|
20
20
|
- [Enasis Network Homie Automate](https://github.com/enasisnetwork/enhomie)
|
21
|
+
- [Enasis Network Chatting Robie](https://github.com/enasisnetwork/enrobie)
|
22
|
+
- [Enasis Network Orchestrations](https://github.com/enasisnetwork/orchestro)
|
21
23
|
|
22
24
|
## Installing the package
|
23
25
|
Installing stable from the PyPi repository
|
@@ -56,7 +58,7 @@ make -s pytest
|
|
56
58
|
```
|
57
59
|
|
58
60
|
## Version management
|
59
|
-
:warning: Ensure that no changes are pending.
|
61
|
+
> :warning: Ensure that no changes are pending.
|
60
62
|
|
61
63
|
1. Rebuild the environment.
|
62
64
|
```
|
@@ -185,7 +185,7 @@ class Config:
|
|
185
185
|
:returns: Configuration source loaded from the objects.
|
186
186
|
"""
|
187
187
|
|
188
|
-
files = self.
|
188
|
+
files = self.__files
|
189
189
|
|
190
190
|
ferged = files.merge
|
191
191
|
|
@@ -207,8 +207,8 @@ class Config:
|
|
207
207
|
:returns: Configuration source loaded from the objects.
|
208
208
|
"""
|
209
209
|
|
210
|
-
files = self.
|
211
|
-
paths = self.
|
210
|
+
files = self.__files
|
211
|
+
paths = self.__paths
|
212
212
|
|
213
213
|
ferged = files.merge
|
214
214
|
perged = paths.merge
|
@@ -61,7 +61,8 @@ def test_ConfigFile(
|
|
61
61
|
'files.ConfigFile object',
|
62
62
|
file)
|
63
63
|
|
64
|
-
assert
|
64
|
+
assert isinstance(
|
65
|
+
hash(file), int)
|
65
66
|
|
66
67
|
assert instr(
|
67
68
|
'files.ConfigFile object',
|
@@ -96,7 +97,8 @@ def test_ConfigFiles(
|
|
96
97
|
'files.ConfigFiles object',
|
97
98
|
files)
|
98
99
|
|
99
|
-
assert
|
100
|
+
assert isinstance(
|
101
|
+
hash(files), int)
|
100
102
|
|
101
103
|
assert instr(
|
102
104
|
'files.ConfigFiles object',
|
@@ -83,7 +83,8 @@ def test_Message() -> None:
|
|
83
83
|
'Message(level="info"',
|
84
84
|
message)
|
85
85
|
|
86
|
-
assert
|
86
|
+
assert isinstance(
|
87
|
+
hash(message), int)
|
87
88
|
|
88
89
|
assert instr(
|
89
90
|
'Message(level="info"',
|
@@ -157,7 +158,8 @@ def test_Logger(
|
|
157
158
|
'logger.Logger object',
|
158
159
|
logger)
|
159
160
|
|
160
|
-
assert
|
161
|
+
assert isinstance(
|
162
|
+
hash(logger), int)
|
161
163
|
|
162
164
|
assert instr(
|
163
165
|
'logger.Logger object',
|
@@ -64,7 +64,8 @@ def test_ConfigPath(
|
|
64
64
|
'paths.ConfigPath object',
|
65
65
|
path)
|
66
66
|
|
67
|
-
assert
|
67
|
+
assert isinstance(
|
68
|
+
hash(path), int)
|
68
69
|
|
69
70
|
assert instr(
|
70
71
|
'paths.ConfigPath object',
|
@@ -98,7 +99,8 @@ def test_ConfigPaths(
|
|
98
99
|
'paths.ConfigPaths object',
|
99
100
|
paths)
|
100
101
|
|
101
|
-
assert
|
102
|
+
assert isinstance(
|
103
|
+
hash(paths), int)
|
102
104
|
|
103
105
|
assert instr(
|
104
106
|
'paths.ConfigPaths object',
|
@@ -62,12 +62,14 @@ class Crypts:
|
|
62
62
|
Initialize instance for class using provided parameters.
|
63
63
|
"""
|
64
64
|
|
65
|
-
from .params import
|
65
|
+
from .params import (
|
66
|
+
CryptsParams)
|
66
67
|
|
67
68
|
if params is None:
|
68
69
|
params = CryptsParams()
|
69
70
|
|
70
|
-
self.__params =
|
71
|
+
self.__params = (
|
72
|
+
deepcopy(params))
|
71
73
|
|
72
74
|
|
73
75
|
@property
|
@@ -96,16 +98,22 @@ class Crypts:
|
|
96
98
|
:returns: Encrypted value using the relevant passphrase.
|
97
99
|
"""
|
98
100
|
|
99
|
-
phrases =
|
101
|
+
phrases = (
|
102
|
+
self.params
|
103
|
+
.phrases)
|
100
104
|
|
101
105
|
if unique not in phrases:
|
102
106
|
raise ValueError('unique')
|
103
107
|
|
104
|
-
phrase =
|
108
|
+
phrase = (
|
109
|
+
phrases[unique]
|
110
|
+
.phrase)
|
111
|
+
|
112
|
+
encoded = value.encode()
|
105
113
|
|
106
114
|
encrypt = (
|
107
115
|
Fernet(phrase)
|
108
|
-
.encrypt(
|
116
|
+
.encrypt(encoded)
|
109
117
|
.decode())
|
110
118
|
|
111
119
|
return (
|
@@ -124,11 +132,16 @@ class Crypts:
|
|
124
132
|
:returns: Decrypted value using the relevant passphrase.
|
125
133
|
"""
|
126
134
|
|
127
|
-
phrases =
|
135
|
+
phrases = (
|
136
|
+
self.params
|
137
|
+
.phrases)
|
128
138
|
|
129
139
|
value = crypt_clean(value)
|
130
140
|
|
131
|
-
|
141
|
+
match = re_match(
|
142
|
+
ENCRYPT, value)
|
143
|
+
|
144
|
+
if match is None:
|
132
145
|
raise ValueError('string')
|
133
146
|
|
134
147
|
version, unique, value = (
|
@@ -137,11 +150,15 @@ class Crypts:
|
|
137
150
|
if version != '1.0':
|
138
151
|
raise ValueError('version')
|
139
152
|
|
140
|
-
phrase =
|
153
|
+
phrase = (
|
154
|
+
phrases[unique]
|
155
|
+
.phrase)
|
156
|
+
|
157
|
+
encoded = value.encode()
|
141
158
|
|
142
159
|
return (
|
143
160
|
Fernet(phrase)
|
144
|
-
.decrypt(
|
161
|
+
.decrypt(encoded)
|
145
162
|
.decode())
|
146
163
|
|
147
164
|
|
@@ -157,7 +174,9 @@ class Crypts:
|
|
157
174
|
:param params: Parameters used to instantiate the class.
|
158
175
|
"""
|
159
176
|
|
160
|
-
phrases =
|
177
|
+
phrases = (
|
178
|
+
self.params
|
179
|
+
.phrases)
|
161
180
|
|
162
181
|
if unique in phrases:
|
163
182
|
raise ValueError('unique')
|
@@ -175,7 +194,9 @@ class Crypts:
|
|
175
194
|
:param unique: Unique identifier of mapping passphrase.
|
176
195
|
"""
|
177
196
|
|
178
|
-
phrases =
|
197
|
+
phrases = (
|
198
|
+
self.params
|
199
|
+
.phrases)
|
179
200
|
|
180
201
|
if unique not in phrases:
|
181
202
|
raise ValueError('unique')
|
@@ -210,6 +210,8 @@ def array_ansi( # noqa: CFQ001, CFQ004
|
|
210
210
|
|
211
211
|
repeat = f'<c{colors.other}>REPEAT<c0>'
|
212
212
|
|
213
|
+
space: str = ' '
|
214
|
+
|
213
215
|
|
214
216
|
def _append(
|
215
217
|
prefix: str,
|
@@ -319,7 +321,7 @@ def array_ansi( # noqa: CFQ001, CFQ004
|
|
319
321
|
for key, value in items:
|
320
322
|
|
321
323
|
prefix = (
|
322
|
-
f'{
|
324
|
+
f'{space * indent}'
|
323
325
|
f'<c{colors.key}>{key}'
|
324
326
|
f'<c{colors.colon}>:<c0>')
|
325
327
|
|
@@ -340,7 +342,7 @@ def array_ansi( # noqa: CFQ001, CFQ004
|
|
340
342
|
for value in source:
|
341
343
|
|
342
344
|
prefix = (
|
343
|
-
f'{
|
345
|
+
f'{space * indent}'
|
344
346
|
f'<c{colors.hyphen}>-<c0>')
|
345
347
|
|
346
348
|
_append(
|
@@ -0,0 +1 @@
|
|
1
|
+
0.20.1
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: encommon
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.20.1
|
4
4
|
Summary: Enasis Network Common Library
|
5
5
|
License: MIT
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
7
|
-
Classifier: Programming Language :: Python :: 3.10
|
8
7
|
Classifier: Programming Language :: Python :: 3.11
|
9
|
-
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
9
|
+
Requires-Python: >=3.11
|
10
10
|
Description-Content-Type: text/markdown
|
11
11
|
License-File: LICENSE
|
12
12
|
Requires-Dist: croniter
|
@@ -39,6 +39,8 @@ Should you venture into the sections below you will be able to use the
|
|
39
39
|
## Projects using library
|
40
40
|
- [Enasis Network Remote Connect](https://github.com/enasisnetwork/enconnect)
|
41
41
|
- [Enasis Network Homie Automate](https://github.com/enasisnetwork/enhomie)
|
42
|
+
- [Enasis Network Chatting Robie](https://github.com/enasisnetwork/enrobie)
|
43
|
+
- [Enasis Network Orchestrations](https://github.com/enasisnetwork/orchestro)
|
42
44
|
|
43
45
|
## Installing the package
|
44
46
|
Installing stable from the PyPi repository
|
@@ -77,7 +79,7 @@ make -s pytest
|
|
77
79
|
```
|
78
80
|
|
79
81
|
## Version management
|
80
|
-
:warning: Ensure that no changes are pending.
|
82
|
+
> :warning: Ensure that no changes are pending.
|
81
83
|
|
82
84
|
1. Rebuild the environment.
|
83
85
|
```
|
@@ -12,10 +12,10 @@ license.text = "MIT"
|
|
12
12
|
|
13
13
|
classifiers = [
|
14
14
|
"Programming Language :: Python :: 3",
|
15
|
-
"Programming Language :: Python :: 3.
|
16
|
-
"Programming Language :: Python :: 3.
|
15
|
+
"Programming Language :: Python :: 3.11",
|
16
|
+
"Programming Language :: Python :: 3.12"]
|
17
17
|
|
18
|
-
requires-python = ">= 3.
|
18
|
+
requires-python = ">= 3.11"
|
19
19
|
|
20
20
|
dynamic = ["version", "dependencies"]
|
21
21
|
|
@@ -1 +0,0 @@
|
|
1
|
-
0.19.2
|
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
|