plexus-python-common 1.1.83__py3-none-any.whl → 1.1.84__py3-none-any.whl

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.
@@ -557,9 +557,9 @@ def dicttree_value[K, V](tree: dicttree[K, V], path: list[K]) -> V | None:
557
557
  """
558
558
  Gets the value stored at the specified path in the dicttree.
559
559
 
560
- :param tree: the dicttree to retrieve the value from.
561
- :param path: the list of keys representing the path to the desired value.
562
- :return: the value at the specified path, or ``None`` if the path does not exist.
560
+ :param tree: The dicttree to retrieve the value from.
561
+ :param path: The list of keys representing the path to the desired value.
562
+ :return: The value at the specified path, or ``None`` if the path does not exist.
563
563
  """
564
564
  value = None
565
565
  for key in path:
@@ -573,9 +573,9 @@ def dicttree_subtree[K, V](tree: dicttree[K, V], path: list[K]) -> dicttree[K, V
573
573
  """
574
574
  Gets the subtree located at the specified path in the dicttree.
575
575
 
576
- :param tree: the dicttree to retrieve the subtree from.
577
- :param path: the list of keys representing the path to the desired subtree.
578
- :return: the subtree at the specified path, or ``None`` if the path does not exist.
576
+ :param tree: The dicttree to retrieve the subtree from.
577
+ :param path: The list of keys representing the path to the desired subtree.
578
+ :return: The subtree at the specified path, or ``None`` if the path does not exist.
579
579
  """
580
580
  for key in path:
581
581
  if key not in tree:
@@ -588,9 +588,9 @@ def dicttree_children[K, V](tree: dicttree[K, V], *, leaves_only: bool = False)
588
588
  """
589
589
  Yields all values in the dicttree. If ``leaves_only`` is ``True``, only yields values at leaf nodes.
590
590
 
591
- :param tree: the dicttree to traverse.
592
- :param leaves_only: whether to yield only values at leaf nodes.
593
- :return: a generator yielding all values in the dicttree.
591
+ :param tree: The dicttree to traverse.
592
+ :param leaves_only: Whether to yield only values at leaf nodes.
593
+ :return: A generator yielding all values in the dicttree.
594
594
  """
595
595
  for value, subtree in tree.values():
596
596
  if value is not None and (not leaves_only or not subtree):
@@ -602,9 +602,9 @@ def dicttree_lineage[K, V](tree: dicttree[K, V], path: list[K]) -> Generator[V,
602
602
  """
603
603
  Yields all values along the specified path in the dicttree.
604
604
 
605
- :param tree: the dicttree to traverse.
606
- :param path: the list of keys representing the path to follow.
607
- :return: a generator yielding all values along the specified path.
605
+ :param tree: The dicttree to traverse.
606
+ :param path: The list of keys representing the path to follow.
607
+ :return: A generator yielding all values along the specified path.
608
608
  """
609
609
  for key in path:
610
610
  if key not in tree:
@@ -618,9 +618,9 @@ def dicttree_make[K, V](tree: dicttree[K, V], path: list[K]) -> dicttree[K, V]:
618
618
  """
619
619
  Ensures that the specified path exists in the dicttree, creating any missing nodes along the way.
620
620
 
621
- :param tree: the dicttree to modify.
622
- :param path: the list of keys representing the path to create.
623
- :return: the subtree at the end of the created path.
621
+ :param tree: The dicttree to modify.
622
+ :param path: The list of keys representing the path to create.
623
+ :return: The subtree at the end of the created path.
624
624
  """
625
625
  for key in path:
626
626
  tree.setdefault(key, (None, {}))
@@ -640,12 +640,12 @@ def dicttree_add[K, V](
640
640
  Adds a value at the specified path in the dicttree. If ``create_prefix`` is ``True``, any missing nodes along the
641
641
  path are created. If ``overwrite`` is ``False``, raises an error if the path already exists.
642
642
 
643
- :param tree: the dicttree to modify.
644
- :param path: the list of keys representing the path to add the value to.
645
- :param value: the value to add at the specified path.
646
- :param create_prefix: whether to create missing nodes along the path.
647
- :param overwrite: whether to overwrite an existing value at the path.
648
- :return: the modified dicttree.
643
+ :param tree: The dicttree to modify.
644
+ :param path: The list of keys representing the path to add the value to.
645
+ :param value: The value to add at the specified path.
646
+ :param create_prefix: Whether to create missing nodes along the path.
647
+ :param overwrite: Whether to overwrite an existing value at the path.
648
+ :return: The modified dicttree.
649
649
  """
650
650
  if len(path) == 0:
651
651
  raise ValueError("path cannot be empty")
@@ -673,10 +673,10 @@ def dicttree_remove[K, V](
673
673
  Removes the value at the specified path in the dicttree. If ``recursive`` is ``True``, removes the entire subtree
674
674
  at that path; otherwise, only removes the value, leaving any child nodes intact.
675
675
 
676
- :param tree: the dicttree to modify.
677
- :param path: the list of keys representing the path to remove the value from.
678
- :param recursive: whether to remove the entire subtree at the path.
679
- :return: the modified dicttree.
676
+ :param tree: The dicttree to modify.
677
+ :param path: The list of keys representing the path to remove the value from.
678
+ :param recursive: Whether to remove the entire subtree at the path.
679
+ :return: The modified dicttree.
680
680
  """
681
681
  if len(path) == 0:
682
682
  raise ValueError("path cannot be empty")
@@ -695,8 +695,8 @@ def dicttree_purge[K, V](tree: dicttree[K, V]) -> dicttree[K, V]:
695
695
  """
696
696
  Recursively removes all nodes in the dicttree that have no value and no children.
697
697
 
698
- :param tree: the dicttree to purge.
699
- :return: the purged dicttree.
698
+ :param tree: The dicttree to purge.
699
+ :return: The purged dicttree.
700
700
  """
701
701
  for key in list(tree.keys()):
702
702
  value, subtree = tree[key]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plexus-python-common
3
- Version: 1.1.83
3
+ Version: 1.1.84
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.12
6
6
  Classifier: Programming Language :: Python :: 3.13
@@ -6,7 +6,7 @@ plexus/common/utils/csvutils.py,sha256=quGN_F-WxtznhCLqst2coXaK-DVgxzwe2FA0qiisk
6
6
  plexus/common/utils/dbutils.py,sha256=0GhnW1P1fJsqB4NjS4V6R-oV8d4R-ZZzi-IpiZCRjAs,16575
7
7
  plexus/common/utils/dtutils.py,sha256=A_upNJJJ3q6e3QZ2m5jXkDLwpAtUU9lEBY2MotAV5aY,12229
8
8
  plexus/common/utils/funcutils.py,sha256=5ciB_kiASUfQelRkKrtNkRru7E7835e5g-8j33Qb8V4,9789
9
- plexus/common/utils/iterutils.py,sha256=Ct8JMCo_aIqI4_scF3o9gUCZvlYxkulNWJlGdufxcb8,30988
9
+ plexus/common/utils/iterutils.py,sha256=JL8j8plIoc2hF8D-BY6dOHEBoeoFZ1nLrhw4dFth_lA,30988
10
10
  plexus/common/utils/jsonutils.py,sha256=BDtqkvmWHiVFo4d5nGkmFtC00JQkGLC7ybchrpID5pU,18529
11
11
  plexus/common/utils/logger.py,sha256=FJaai6Sbchy4wKHcUMUCrrkBcXvIxq4qByERZ_TJBps,3881
12
12
  plexus/common/utils/numutils.py,sha256=p6Rz1qyCcUru3v1zDy2PM-nds2NWJdL5A_vLmG-kswk,4294
@@ -17,7 +17,7 @@ plexus/common/utils/span.py,sha256=RqgUuupN01xCjm4l5uxrr8BFFrUrytRVGihmENUawpk,6
17
17
  plexus/common/utils/strutils.py,sha256=PGOSYRgTnQcP0YXORzeTpiU9RweInxd5f6YcIHm6yiY,5096
18
18
  plexus/common/utils/testutils.py,sha256=D-EvK-Og8chyiks377PGDjqYid-l4F4Xfq9Q4yzrJtM,5441
19
19
  plexus/common/utils/typeutils.py,sha256=RVkYkFRgDrx77OHFH7PavMV0AIB0S8ly40rs4g7JWE4,8220
20
- plexus_python_common-1.1.83.dist-info/METADATA,sha256=G-IQyqrs6j0FZ69iSnoPnDacONBu7lk9GNRth2RTRr4,871
21
- plexus_python_common-1.1.83.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
22
- plexus_python_common-1.1.83.dist-info/top_level.txt,sha256=ug_g7CVwaMQuas5UzAXbHUrQvKGCn8ezc6ZNvvRlJOE,7
23
- plexus_python_common-1.1.83.dist-info/RECORD,,
20
+ plexus_python_common-1.1.84.dist-info/METADATA,sha256=R5q4cnQLocbTnpHRWc98ORvSirQ8Af92mTo5Auez84o,871
21
+ plexus_python_common-1.1.84.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
22
+ plexus_python_common-1.1.84.dist-info/top_level.txt,sha256=ug_g7CVwaMQuas5UzAXbHUrQvKGCn8ezc6ZNvvRlJOE,7
23
+ plexus_python_common-1.1.84.dist-info/RECORD,,