imio.pyutils 1.2.2__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.2 → imio_pyutils-1.2.3}/CHANGES.rst +7 -0
- {imio_pyutils-1.2.2/imio.pyutils.egg-info → imio_pyutils-1.2.3}/PKG-INFO +8 -1
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio/pyutils/tests.py +7 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio/pyutils/utils.py +12 -1
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3/imio.pyutils.egg-info}/PKG-INFO +8 -1
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/setup.py +1 -1
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/MANIFEST.in +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/Makefile +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/README.rst +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio/__init__.py +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio/pyutils/__init__.py +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio/pyutils/batching.py +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio/pyutils/bs.py +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio/pyutils/postgres.py +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio/pyutils/system.py +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/SOURCES.txt +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/dependency_links.txt +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/namespace_packages.txt +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/not-zip-safe +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/requires.txt +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/imio.pyutils.egg-info/top_level.txt +0 -0
- {imio_pyutils-1.2.2 → imio_pyutils-1.2.3}/setup.cfg +0 -0
|
@@ -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,13 @@ 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
|
+
|
|
100
107
|
1.2.2 (2026-03-26)
|
|
101
108
|
------------------
|
|
102
109
|
|
|
@@ -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,13 @@ 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
|
+
|
|
100
107
|
1.2.2 (2026-03-26)
|
|
101
108
|
------------------
|
|
102
109
|
|
|
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
|