imio.pyutils 1.2.1__tar.gz → 1.2.3__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.
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/CHANGES.rst +13 -0
- {imio_pyutils-1.2.1/imio.pyutils.egg-info → imio_pyutils-1.2.3}/PKG-INFO +14 -1
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio/pyutils/system.py +2 -2
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio/pyutils/tests.py +7 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio/pyutils/utils.py +12 -1
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3/imio.pyutils.egg-info}/PKG-INFO +14 -1
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/setup.py +1 -1
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/MANIFEST.in +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/Makefile +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/README.rst +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio/__init__.py +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio/pyutils/__init__.py +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio/pyutils/batching.py +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio/pyutils/bs.py +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio/pyutils/postgres.py +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/SOURCES.txt +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/dependency_links.txt +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/namespace_packages.txt +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/not-zip-safe +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/requires.txt +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/top_level.txt +0 -0
- {imio_pyutils-1.2.1 → imio_pyutils-1.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
1.2.3 (2026-11-16)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
- Added `utils.is_true_value` to check if a value (like an environment variable) is considered as true.
|
|
8
|
+
[sgeulette]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
1.2.2 (2026-03-26)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
- Added kwargs parameter in `system.post_request`, so other parameters are passed to requests.post.
|
|
15
|
+
[sgeulette]
|
|
16
|
+
|
|
4
17
|
1.2.1 (2026-02-06)
|
|
5
18
|
------------------
|
|
6
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: imio.pyutils
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: Some python useful methods
|
|
5
5
|
Home-page: https://github.com/imio/imio.pyutils/
|
|
6
6
|
Author: IMIO
|
|
@@ -97,6 +97,19 @@ Can be run with: `bin/python -m unittest discover`
|
|
|
97
97
|
Changelog
|
|
98
98
|
=========
|
|
99
99
|
|
|
100
|
+
1.2.3 (2026-11-16)
|
|
101
|
+
------------------
|
|
102
|
+
|
|
103
|
+
- Added `utils.is_true_value` to check if a value (like an environment variable) is considered as true.
|
|
104
|
+
[sgeulette]
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
1.2.2 (2026-03-26)
|
|
108
|
+
------------------
|
|
109
|
+
|
|
110
|
+
- Added kwargs parameter in `system.post_request`, so other parameters are passed to requests.post.
|
|
111
|
+
[sgeulette]
|
|
112
|
+
|
|
100
113
|
1.2.1 (2026-02-06)
|
|
101
114
|
------------------
|
|
102
115
|
|
|
@@ -446,7 +446,7 @@ def get_temporary_filename(file_name):
|
|
|
446
446
|
|
|
447
447
|
|
|
448
448
|
def post_request(url, data=None, json=None, headers=None, files=None, return_json=False, logger=None,
|
|
449
|
-
clean_files_for_logging=True):
|
|
449
|
+
clean_files_for_logging=True, **kwargs):
|
|
450
450
|
"""Post data to url.
|
|
451
451
|
|
|
452
452
|
:param url: the url to post to
|
|
@@ -463,7 +463,7 @@ def post_request(url, data=None, json=None, headers=None, files=None, return_jso
|
|
|
463
463
|
raise ValueError("Cannot use both json and data or files parameters")
|
|
464
464
|
if logger is None:
|
|
465
465
|
logger = logging.getLogger("imio.pyutils")
|
|
466
|
-
kwargs = {}
|
|
466
|
+
# kwargs = {}
|
|
467
467
|
|
|
468
468
|
if files:
|
|
469
469
|
kwargs["files"] = files
|
|
@@ -13,6 +13,7 @@ from imio.pyutils.utils import append
|
|
|
13
13
|
from imio.pyutils.utils import get_clusters
|
|
14
14
|
from imio.pyutils.utils import get_ordinal_clusters
|
|
15
15
|
from imio.pyutils.utils import insert_in_ordereddict
|
|
16
|
+
from imio.pyutils.utils import is_true_value
|
|
16
17
|
from imio.pyutils.utils import iterable_as_list_of_list
|
|
17
18
|
from imio.pyutils.utils import letters_sequence
|
|
18
19
|
from imio.pyutils.utils import listify
|
|
@@ -280,6 +281,12 @@ class TestUtils(unittest.TestCase):
|
|
|
280
281
|
self.assertEqual(listify(("value",)), ("value",))
|
|
281
282
|
self.assertEqual(listify(("value",), force=True), ["value"])
|
|
282
283
|
|
|
284
|
+
def test_is_true_value(self):
|
|
285
|
+
for value in ("yes", "Y", "TRUE", "True", "on", "1", True, 1):
|
|
286
|
+
self.assertTrue(is_true_value(value), value)
|
|
287
|
+
for value in (None, "", "no", "false", "False", "0", "off", "2", False, 0):
|
|
288
|
+
self.assertFalse(is_true_value(value), value)
|
|
289
|
+
|
|
283
290
|
|
|
284
291
|
class TestSystem(unittest.TestCase):
|
|
285
292
|
""" """
|
|
@@ -166,6 +166,15 @@ def insert_in_ordereddict(dic, value, after_key="", at_position=None):
|
|
|
166
166
|
return OrderedDict(tuples)
|
|
167
167
|
|
|
168
168
|
|
|
169
|
+
def is_true_value(value):
|
|
170
|
+
"""Check if given value (string, bool, number, None) is considered as true.
|
|
171
|
+
|
|
172
|
+
:param value: the value to check, like an environment variable value
|
|
173
|
+
:return: True if lowercased value is in ("yes", "y", "true", "on", "1")
|
|
174
|
+
"""
|
|
175
|
+
return str(value).lower() in ("yes", "y", "true", "on", "1")
|
|
176
|
+
|
|
177
|
+
|
|
169
178
|
def iterable_as_list_of_list(lst, cols=1):
|
|
170
179
|
"""Transform an iterable as list of list.
|
|
171
180
|
|
|
@@ -311,7 +320,9 @@ def setup_logger(logger, replace=logging.StreamHandler, level=20):
|
|
|
311
320
|
:param level: level to set
|
|
312
321
|
"""
|
|
313
322
|
for i_c, container in enumerate((logger, logger.parent)):
|
|
314
|
-
|
|
323
|
+
if container is None:
|
|
324
|
+
continue
|
|
325
|
+
found = [i for i, hdl in enumerate(container.handlers) if isinstance(hdl, replace)]
|
|
315
326
|
if found:
|
|
316
327
|
if i_c:
|
|
317
328
|
logger.parent = container = copy.copy(logger.parent)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: imio.pyutils
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: Some python useful methods
|
|
5
5
|
Home-page: https://github.com/imio/imio.pyutils/
|
|
6
6
|
Author: IMIO
|
|
@@ -97,6 +97,19 @@ Can be run with: `bin/python -m unittest discover`
|
|
|
97
97
|
Changelog
|
|
98
98
|
=========
|
|
99
99
|
|
|
100
|
+
1.2.3 (2026-11-16)
|
|
101
|
+
------------------
|
|
102
|
+
|
|
103
|
+
- Added `utils.is_true_value` to check if a value (like an environment variable) is considered as true.
|
|
104
|
+
[sgeulette]
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
1.2.2 (2026-03-26)
|
|
108
|
+
------------------
|
|
109
|
+
|
|
110
|
+
- Added kwargs parameter in `system.post_request`, so other parameters are passed to requests.post.
|
|
111
|
+
[sgeulette]
|
|
112
|
+
|
|
100
113
|
1.2.1 (2026-02-06)
|
|
101
114
|
------------------
|
|
102
115
|
|
|
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
|