stouputils 1.9.3__tar.gz → 1.9.5__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.
Files changed (139) hide show
  1. {stouputils-1.9.3 → stouputils-1.9.5}/PKG-INFO +23 -20
  2. {stouputils-1.9.3 → stouputils-1.9.5}/README.md +22 -19
  3. {stouputils-1.9.3 → stouputils-1.9.5}/pyproject.toml +1 -1
  4. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/__main__.py +25 -11
  5. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/archive.py +19 -1
  6. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/archive.pyi +1 -1
  7. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/backup.py +17 -15
  8. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/collections.py +6 -5
  9. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/collections.pyi +4 -3
  10. {stouputils-1.9.3 → stouputils-1.9.5}/.gitignore +0 -0
  11. {stouputils-1.9.3 → stouputils-1.9.5}/LICENSE +0 -0
  12. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/__init__.py +0 -0
  13. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/__init__.pyi +0 -0
  14. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/_deprecated.py +0 -0
  15. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/_deprecated.pyi +0 -0
  16. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/all_doctests.py +0 -0
  17. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/all_doctests.pyi +0 -0
  18. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/__init__.py +0 -0
  19. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/__init__.pyi +0 -0
  20. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/automatic_docs.py +0 -0
  21. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/automatic_docs.pyi +0 -0
  22. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/upscaler/__init__.py +0 -0
  23. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/upscaler/__init__.pyi +0 -0
  24. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/upscaler/config.py +0 -0
  25. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/upscaler/config.pyi +0 -0
  26. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/upscaler/image.py +0 -0
  27. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/upscaler/image.pyi +0 -0
  28. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/upscaler/video.py +0 -0
  29. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/applications/upscaler/video.pyi +0 -0
  30. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/backup.pyi +0 -0
  31. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/__init__.py +0 -0
  32. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/__init__.pyi +0 -0
  33. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/cd_utils.py +0 -0
  34. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/cd_utils.pyi +0 -0
  35. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/github.py +0 -0
  36. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/github.pyi +0 -0
  37. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/pypi.py +0 -0
  38. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/pypi.pyi +0 -0
  39. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/pyproject.py +0 -0
  40. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/pyproject.pyi +0 -0
  41. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/stubs.py +0 -0
  42. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/continuous_delivery/stubs.pyi +0 -0
  43. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/ctx.py +0 -0
  44. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/ctx.pyi +0 -0
  45. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/config/get.py +0 -0
  46. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/config/set.py +0 -0
  47. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/__init__.py +0 -0
  48. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/auto_contrast.py +0 -0
  49. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/axis_flip.py +0 -0
  50. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/bias_field_correction.py +0 -0
  51. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/binary_threshold.py +0 -0
  52. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/blur.py +0 -0
  53. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/brightness.py +0 -0
  54. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/canny.py +0 -0
  55. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/clahe.py +0 -0
  56. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/common.py +0 -0
  57. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/contrast.py +0 -0
  58. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/curvature_flow_filter.py +0 -0
  59. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/denoise.py +0 -0
  60. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/histogram_equalization.py +0 -0
  61. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/invert.py +0 -0
  62. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/laplacian.py +0 -0
  63. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/median_blur.py +0 -0
  64. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/noise.py +0 -0
  65. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/normalize.py +0 -0
  66. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/random_erase.py +0 -0
  67. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/resize.py +0 -0
  68. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/rotation.py +0 -0
  69. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/salt_pepper.py +0 -0
  70. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/sharpening.py +0 -0
  71. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/shearing.py +0 -0
  72. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/threshold.py +0 -0
  73. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/translation.py +0 -0
  74. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image/zoom.py +0 -0
  75. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image_augmentation.py +0 -0
  76. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/image_preprocess.py +0 -0
  77. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/prosthesis_detection.py +0 -0
  78. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/data_processing/technique.py +0 -0
  79. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/dataset/__init__.py +0 -0
  80. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/dataset/dataset.py +0 -0
  81. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/dataset/dataset_loader.py +0 -0
  82. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/dataset/grouping_strategy.py +0 -0
  83. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/dataset/image_loader.py +0 -0
  84. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/dataset/xy_tuple.py +0 -0
  85. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/metric_dictionnary.py +0 -0
  86. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/metric_utils.py +0 -0
  87. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/mlflow_utils.py +0 -0
  88. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/abstract_model.py +0 -0
  89. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/all.py +0 -0
  90. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/base_keras.py +0 -0
  91. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/all.py +0 -0
  92. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/convnext.py +0 -0
  93. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/densenet.py +0 -0
  94. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/efficientnet.py +0 -0
  95. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/mobilenet.py +0 -0
  96. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/resnet.py +0 -0
  97. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/squeezenet.py +0 -0
  98. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/vgg.py +0 -0
  99. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras/xception.py +0 -0
  100. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/callbacks/__init__.py +0 -0
  101. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/callbacks/colored_progress_bar.py +0 -0
  102. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/callbacks/learning_rate_finder.py +0 -0
  103. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/callbacks/model_checkpoint_v2.py +0 -0
  104. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/callbacks/progressive_unfreezing.py +0 -0
  105. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/callbacks/warmup_scheduler.py +0 -0
  106. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/losses/__init__.py +0 -0
  107. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/losses/next_generation_loss.py +0 -0
  108. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/keras_utils/visualizations.py +0 -0
  109. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/model_interface.py +0 -0
  110. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/models/sandbox.py +0 -0
  111. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/range_tuple.py +0 -0
  112. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/scripts/augment_dataset.py +0 -0
  113. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/scripts/exhaustive_process.py +0 -0
  114. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/scripts/preprocess_dataset.py +0 -0
  115. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/scripts/routine.py +0 -0
  116. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/data_science/utils.py +0 -0
  117. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/decorators.py +0 -0
  118. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/decorators.pyi +0 -0
  119. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/image.py +0 -0
  120. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/image.pyi +0 -0
  121. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/__init__.py +0 -0
  122. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/__init__.pyi +0 -0
  123. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/common.py +0 -0
  124. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/common.pyi +0 -0
  125. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/downloader.py +0 -0
  126. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/downloader.pyi +0 -0
  127. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/linux.py +0 -0
  128. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/linux.pyi +0 -0
  129. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/main.py +0 -0
  130. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/main.pyi +0 -0
  131. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/windows.py +0 -0
  132. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/installer/windows.pyi +0 -0
  133. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/io.py +0 -0
  134. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/io.pyi +0 -0
  135. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/parallel.py +0 -0
  136. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/parallel.pyi +0 -0
  137. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/print.py +0 -0
  138. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/print.pyi +0 -0
  139. {stouputils-1.9.3 → stouputils-1.9.5}/stouputils/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stouputils
3
- Version: 1.9.3
3
+ Version: 1.9.5
4
4
  Summary: Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more.
5
5
  Project-URL: Homepage, https://github.com/Stoupy51/stouputils
6
6
  Project-URL: Issues, https://github.com/Stoupy51/stouputils/issues
@@ -104,34 +104,48 @@ stouputils all_<TAB> # Completes to: all_doctests
104
104
  .code-tree .comment {
105
105
  color:rgb(231, 213, 48);
106
106
  }
107
+ .code-tree .paren {
108
+ color: orange;
109
+ }
107
110
  </style>
108
111
  </details>
109
112
 
110
113
  <pre class="code-tree">stouputils/
114
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.print.html">print.py</a> <span class="comment"># 🖨️ Utility functions for printing <span class="paren">(info, debug, warning, error, whatisit, breakpoint, colored_for_loop, ...)</span></span>
115
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.decorators.html">decorators.py</a> <span class="comment"># 🎯 Decorators <span class="paren">(measure_time, handle_error, timeout, retry, simple_cache, abstract, deprecated, silent)</span></span>
116
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.ctx.html">ctx.py</a> <span class="comment"># 🔇 Context managers <span class="paren">(LogToFile, MeasureTime, Muffle, DoNothing, SetMPStartMethod)</span></span>
117
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.io.html">io.py</a> <span class="comment"># 💾 Utilities for file management <span class="paren">(json_dump, json_load, csv_dump, csv_load, read_file, super_copy, super_open, clean_path, ...)</span></span>
118
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.parallel.html">parallel.py</a> <span class="comment"># 🔀 Utility functions for parallel processing <span class="paren">(multiprocessing, multithreading, run_in_subprocess)</span></span>
119
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.image.html">image.py</a> <span class="comment"># 🖼️ Little utilities for image processing <span class="paren">(image_resize, auto_crop, numpy_to_gif, numpy_to_obj)</span></span>
120
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.collections.html">collections.py</a> <span class="comment"># 🧰 Utilities for collection manipulation <span class="paren">(unique_list, sort_dict_keys, upsert_in_dataframe, array_to_disk)</span></span>
121
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.all_doctests.html">all_doctests.py</a> <span class="comment"># ✅ Run all doctests for all modules in a given directory <span class="paren">(launch_tests, test_module_with_progress)</span></span>
122
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.backup.html">backup.py</a> <span class="comment"># 💾 Utilities for backup management <span class="paren">(delta backup, consolidate)</span></span>
123
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.archive.html">archive.py</a> <span class="comment"># 📦 Functions for creating and managing archives</span>
124
+
111
125
  ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.html">applications/</a>
112
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.automatic_docs.html">automatic_docs.py</a> <span class="comment"># 📚 Documentation generation utilities (used to create this documentation)</span>
113
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.upscaler.html">upscaler/</a> <span class="comment"># 🔎 Image & Video upscaler (configurable)</span>
126
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.automatic_docs.html">automatic_docs.py</a> <span class="comment"># 📚 Documentation generation utilities <span class="paren">(used to create this documentation)</span></span>
127
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.upscaler.html">upscaler/</a> <span class="comment"># 🔎 Image & Video upscaler <span class="paren">(configurable)</span></span>
114
128
  │ └── ...
115
129
 
116
130
  ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.html">continuous_delivery/</a>
117
131
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.cd_utils.html">cd_utils.py</a> <span class="comment"># 🔧 Utilities for continuous delivery</span>
118
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.github.html">github.py</a> <span class="comment"># 📦 Utilities for continuous delivery on GitHub (upload_to_github)</span>
119
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.pypi.html">pypi.py</a> <span class="comment"># 📦 Utilities for PyPI (pypi_full_routine)</span>
132
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.github.html">github.py</a> <span class="comment"># 📦 Utilities for continuous delivery on GitHub <span class="paren">(upload_to_github)</span></span>
133
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.pypi.html">pypi.py</a> <span class="comment"># 📦 Utilities for PyPI <span class="paren">(pypi_full_routine)</span></span>
120
134
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.pyproject.html">pyproject.py</a> <span class="comment"># 📝 Utilities for reading, writing and managing pyproject.toml files</span>
121
135
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.stubs.html">stubs.py</a> <span class="comment"># 📝 Utilities for generating stub files using stubgen</span>
122
136
  │ └── ...
123
137
 
124
138
  ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.html">data_science/</a>
125
139
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.config.html">config/</a> <span class="comment"># ⚙️ Configuration utilities for data science</span>
126
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.dataset.html">dataset/</a> <span class="comment"># 📊 Dataset handling (dataset, dataset_loader, grouping_strategy)</span>
127
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.data_processing.html">data_processing/</a> <span class="comment"># 🔄 Data processing utilities (image augmentation, preprocessing)</span>
140
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.dataset.html">dataset/</a> <span class="comment"># 📊 Dataset handling <span class="paren">(dataset, dataset_loader, grouping_strategy)</span></span>
141
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.data_processing.html">data_processing/</a> <span class="comment"># 🔄 Data processing utilities <span class="paren">(image augmentation, preprocessing)</span></span>
128
142
  │ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.data_processing.image.html">image/</a> <span class="comment"># 🖼️ Image processing techniques</span>
129
143
  │ │ └── ...
130
144
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.models.html">models/</a> <span class="comment"># 🧠 ML/DL model interfaces and implementations</span>
131
145
  │ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.models.keras.html">keras/</a> <span class="comment"># 🤖 Keras model implementations</span>
132
- │ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.models.keras_utils.html">keras_utils/</a> <span class="comment"># 🛠️ Keras utilities (callbacks, losses, visualizations)</span>
146
+ │ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.models.keras_utils.html">keras_utils/</a> <span class="comment"># 🛠️ Keras utilities <span class="paren">(callbacks, losses, visualizations)</span></span>
133
147
  │ │ └── ...
134
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.scripts.html">scripts/</a> <span class="comment"># 📜 Data science scripts (augment, preprocess, routine)</span>
148
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.scripts.html">scripts/</a> <span class="comment"># 📜 Data science scripts <span class="paren">(augment, preprocess, routine)</span></span>
135
149
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.metric_utils.html">metric_utils.py</a> <span class="comment"># 📏 Static methods for calculating various ML metrics</span>
136
150
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.mlflow_utils.html">mlflow_utils.py</a> <span class="comment"># 📊 Utility functions for working with MLflow</span>
137
151
  │ └── ...
@@ -143,17 +157,6 @@ stouputils all_<TAB> # Completes to: all_doctests
143
157
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.installer.main.html">main.py</a> <span class="comment"># 🚀 Core installation functions for installing programs from zip files or URLs</span>
144
158
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.installer.windows.html">windows.py</a> <span class="comment"># 💻 Windows specific implementations for installation</span>
145
159
  │ └── ...
146
-
147
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.all_doctests.html">all_doctests.py</a> <span class="comment"># ✅ Run all doctests for all modules in a given directory</span>
148
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.archive.html">archive.py</a> <span class="comment"># 📦 Functions for creating and managing archives</span>
149
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.backup.html">backup.py</a> <span class="comment"># 💾 Utilities for backup management (delta backup, consolidate)</span>
150
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.collections.html">collections.py</a> <span class="comment"># 🧰 Utilities for collection manipulation (unique_list, sort_dict_keys, upsert_in_dataframe, array_to_disk)</span>
151
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.ctx.html">ctx.py</a> <span class="comment"># 🔇 Context managers (Muffle, LogToFile, MeasureTime, DoNothing)</span>
152
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.decorators.html">decorators.py</a> <span class="comment"># 🎯 Decorators (measure_time, handle_error, timeout, retry, simple_cache, abstract, deprecated, silent)</span>
153
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.image.html">image.py</a> <span class="comment"># 🖼️ Little utilities for image processing (image_resize, auto_crop, numpy_to_gif, numpy_to_obj)</span>
154
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.io.html">io.py</a> <span class="comment"># 💾 Utilities for file management (super_json, super_csv, super_copy, super_open, clean_path)</span>
155
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.parallel.html">parallel.py</a> <span class="comment"># 🔀 Utility functions for parallel processing (multiprocessing, multithreading)</span>
156
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.print.html">print.py</a> <span class="comment"># 🖨️ Utility functions for printing messages with different levels of importance</span>
157
160
  └── ...
158
161
  </pre>
159
162
  </html>
@@ -62,34 +62,48 @@ stouputils all_<TAB> # Completes to: all_doctests
62
62
  .code-tree .comment {
63
63
  color:rgb(231, 213, 48);
64
64
  }
65
+ .code-tree .paren {
66
+ color: orange;
67
+ }
65
68
  </style>
66
69
  </details>
67
70
 
68
71
  <pre class="code-tree">stouputils/
72
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.print.html">print.py</a> <span class="comment"># 🖨️ Utility functions for printing <span class="paren">(info, debug, warning, error, whatisit, breakpoint, colored_for_loop, ...)</span></span>
73
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.decorators.html">decorators.py</a> <span class="comment"># 🎯 Decorators <span class="paren">(measure_time, handle_error, timeout, retry, simple_cache, abstract, deprecated, silent)</span></span>
74
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.ctx.html">ctx.py</a> <span class="comment"># 🔇 Context managers <span class="paren">(LogToFile, MeasureTime, Muffle, DoNothing, SetMPStartMethod)</span></span>
75
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.io.html">io.py</a> <span class="comment"># 💾 Utilities for file management <span class="paren">(json_dump, json_load, csv_dump, csv_load, read_file, super_copy, super_open, clean_path, ...)</span></span>
76
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.parallel.html">parallel.py</a> <span class="comment"># 🔀 Utility functions for parallel processing <span class="paren">(multiprocessing, multithreading, run_in_subprocess)</span></span>
77
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.image.html">image.py</a> <span class="comment"># 🖼️ Little utilities for image processing <span class="paren">(image_resize, auto_crop, numpy_to_gif, numpy_to_obj)</span></span>
78
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.collections.html">collections.py</a> <span class="comment"># 🧰 Utilities for collection manipulation <span class="paren">(unique_list, sort_dict_keys, upsert_in_dataframe, array_to_disk)</span></span>
79
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.all_doctests.html">all_doctests.py</a> <span class="comment"># ✅ Run all doctests for all modules in a given directory <span class="paren">(launch_tests, test_module_with_progress)</span></span>
80
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.backup.html">backup.py</a> <span class="comment"># 💾 Utilities for backup management <span class="paren">(delta backup, consolidate)</span></span>
81
+ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.archive.html">archive.py</a> <span class="comment"># 📦 Functions for creating and managing archives</span>
82
+
69
83
  ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.html">applications/</a>
70
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.automatic_docs.html">automatic_docs.py</a> <span class="comment"># 📚 Documentation generation utilities (used to create this documentation)</span>
71
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.upscaler.html">upscaler/</a> <span class="comment"># 🔎 Image & Video upscaler (configurable)</span>
84
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.automatic_docs.html">automatic_docs.py</a> <span class="comment"># 📚 Documentation generation utilities <span class="paren">(used to create this documentation)</span></span>
85
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.applications.upscaler.html">upscaler/</a> <span class="comment"># 🔎 Image & Video upscaler <span class="paren">(configurable)</span></span>
72
86
  │ └── ...
73
87
 
74
88
  ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.html">continuous_delivery/</a>
75
89
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.cd_utils.html">cd_utils.py</a> <span class="comment"># 🔧 Utilities for continuous delivery</span>
76
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.github.html">github.py</a> <span class="comment"># 📦 Utilities for continuous delivery on GitHub (upload_to_github)</span>
77
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.pypi.html">pypi.py</a> <span class="comment"># 📦 Utilities for PyPI (pypi_full_routine)</span>
90
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.github.html">github.py</a> <span class="comment"># 📦 Utilities for continuous delivery on GitHub <span class="paren">(upload_to_github)</span></span>
91
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.pypi.html">pypi.py</a> <span class="comment"># 📦 Utilities for PyPI <span class="paren">(pypi_full_routine)</span></span>
78
92
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.pyproject.html">pyproject.py</a> <span class="comment"># 📝 Utilities for reading, writing and managing pyproject.toml files</span>
79
93
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.continuous_delivery.stubs.html">stubs.py</a> <span class="comment"># 📝 Utilities for generating stub files using stubgen</span>
80
94
  │ └── ...
81
95
 
82
96
  ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.html">data_science/</a>
83
97
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.config.html">config/</a> <span class="comment"># ⚙️ Configuration utilities for data science</span>
84
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.dataset.html">dataset/</a> <span class="comment"># 📊 Dataset handling (dataset, dataset_loader, grouping_strategy)</span>
85
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.data_processing.html">data_processing/</a> <span class="comment"># 🔄 Data processing utilities (image augmentation, preprocessing)</span>
98
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.dataset.html">dataset/</a> <span class="comment"># 📊 Dataset handling <span class="paren">(dataset, dataset_loader, grouping_strategy)</span></span>
99
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.data_processing.html">data_processing/</a> <span class="comment"># 🔄 Data processing utilities <span class="paren">(image augmentation, preprocessing)</span></span>
86
100
  │ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.data_processing.image.html">image/</a> <span class="comment"># 🖼️ Image processing techniques</span>
87
101
  │ │ └── ...
88
102
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.models.html">models/</a> <span class="comment"># 🧠 ML/DL model interfaces and implementations</span>
89
103
  │ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.models.keras.html">keras/</a> <span class="comment"># 🤖 Keras model implementations</span>
90
- │ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.models.keras_utils.html">keras_utils/</a> <span class="comment"># 🛠️ Keras utilities (callbacks, losses, visualizations)</span>
104
+ │ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.models.keras_utils.html">keras_utils/</a> <span class="comment"># 🛠️ Keras utilities <span class="paren">(callbacks, losses, visualizations)</span></span>
91
105
  │ │ └── ...
92
- │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.scripts.html">scripts/</a> <span class="comment"># 📜 Data science scripts (augment, preprocess, routine)</span>
106
+ │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.scripts.html">scripts/</a> <span class="comment"># 📜 Data science scripts <span class="paren">(augment, preprocess, routine)</span></span>
93
107
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.metric_utils.html">metric_utils.py</a> <span class="comment"># 📏 Static methods for calculating various ML metrics</span>
94
108
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.data_science.mlflow_utils.html">mlflow_utils.py</a> <span class="comment"># 📊 Utility functions for working with MLflow</span>
95
109
  │ └── ...
@@ -101,17 +115,6 @@ stouputils all_<TAB> # Completes to: all_doctests
101
115
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.installer.main.html">main.py</a> <span class="comment"># 🚀 Core installation functions for installing programs from zip files or URLs</span>
102
116
  │ ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.installer.windows.html">windows.py</a> <span class="comment"># 💻 Windows specific implementations for installation</span>
103
117
  │ └── ...
104
-
105
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.all_doctests.html">all_doctests.py</a> <span class="comment"># ✅ Run all doctests for all modules in a given directory</span>
106
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.archive.html">archive.py</a> <span class="comment"># 📦 Functions for creating and managing archives</span>
107
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.backup.html">backup.py</a> <span class="comment"># 💾 Utilities for backup management (delta backup, consolidate)</span>
108
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.collections.html">collections.py</a> <span class="comment"># 🧰 Utilities for collection manipulation (unique_list, sort_dict_keys, upsert_in_dataframe, array_to_disk)</span>
109
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.ctx.html">ctx.py</a> <span class="comment"># 🔇 Context managers (Muffle, LogToFile, MeasureTime, DoNothing)</span>
110
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.decorators.html">decorators.py</a> <span class="comment"># 🎯 Decorators (measure_time, handle_error, timeout, retry, simple_cache, abstract, deprecated, silent)</span>
111
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.image.html">image.py</a> <span class="comment"># 🖼️ Little utilities for image processing (image_resize, auto_crop, numpy_to_gif, numpy_to_obj)</span>
112
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.io.html">io.py</a> <span class="comment"># 💾 Utilities for file management (super_json, super_csv, super_copy, super_open, clean_path)</span>
113
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.parallel.html">parallel.py</a> <span class="comment"># 🔀 Utility functions for parallel processing (multiprocessing, multithreading)</span>
114
- ├── <a href="https://stoupy51.github.io/stouputils/latest/modules/stouputils.print.html">print.py</a> <span class="comment"># 🖨️ Utility functions for printing messages with different levels of importance</span>
115
118
  └── ...
116
119
  </pre>
117
120
  </html>
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
 
6
6
  [project]
7
7
  name = "stouputils"
8
- version = "1.9.3"
8
+ version = "1.9.5"
9
9
  description = "Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more."
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.10"
@@ -8,13 +8,16 @@ import sys
8
8
  import argcomplete
9
9
 
10
10
  from .all_doctests import launch_tests
11
+ from .archive import archive_cli
11
12
  from .backup import backup_cli
12
13
  from .decorators import handle_error
13
14
  from .print import CYAN, GREEN, RESET, show_version
14
15
 
15
16
  # Argument Parser Setup for Auto-Completion
16
17
  parser = argparse.ArgumentParser(prog="stouputils", add_help=False)
17
- parser.add_argument("command", nargs="?", choices=["--version", "-v", "all_doctests", "backup"])
18
+ parser.add_argument("command", nargs="?", choices=[
19
+ "--version", "-v", "version", "show_version", "all_doctests", "archive", "backup"
20
+ ])
18
21
  parser.add_argument("args", nargs="*")
19
22
  argcomplete.autocomplete(parser)
20
23
 
@@ -24,7 +27,9 @@ def main() -> None:
24
27
  second_arg: str = sys.argv[1].lower() if len(sys.argv) >= 2 else ""
25
28
 
26
29
  # Print the version of stouputils and its dependencies
27
- if second_arg in ("--version","-v"):
30
+ if second_arg in ("--version", "-v", "version", "show_version"):
31
+ if len(sys.argv) >= 3:
32
+ return show_version(sys.argv[2])
28
33
  return show_version()
29
34
 
30
35
  # Handle "all_doctests" command
@@ -33,6 +38,11 @@ def main() -> None:
33
38
  sys.exit(1)
34
39
  return
35
40
 
41
+ # Handle "archive" command
42
+ if second_arg == "archive":
43
+ sys.argv.pop(1) # Remove "archive" from argv so archive_cli gets clean arguments
44
+ return archive_cli()
45
+
36
46
  # Handle "backup" command
37
47
  if second_arg == "backup":
38
48
  sys.argv.pop(1) # Remove "backup" from argv so backup_cli gets clean arguments
@@ -51,15 +61,19 @@ def main() -> None:
51
61
 
52
62
  # Print help with nice formatting
53
63
  separator: str = "─" * 60
54
- print(f"{CYAN}{separator}{RESET}")
55
- print(f"{CYAN}stouputils {GREEN}CLI {CYAN}v{pkg_version}{RESET}")
56
- print(f"{CYAN}{separator}{RESET}")
57
- print(f"\n{CYAN}Usage:{RESET} stouputils <command> [options]")
58
- print(f"\n{CYAN}Available commands:{RESET}")
59
- print(f" {GREEN}--version, -v{RESET} Show version information")
60
- print(f" {GREEN}all_doctests{RESET} [dir] Run all doctests in the specified directory")
61
- print(f" {GREEN}backup{RESET} --help Backup utilities (delta, consolidate, limit)")
62
- print(f"{CYAN}{separator}{RESET}")
64
+ print(f"""
65
+ {CYAN}{separator}{RESET}
66
+ {CYAN}stouputils {GREEN}CLI {CYAN}v{pkg_version}{RESET}
67
+ {CYAN}{separator}{RESET}
68
+ {CYAN}Usage:{RESET} stouputils <command> [options]
69
+
70
+ {CYAN}Available commands:{RESET}
71
+ {GREEN}--version, -v{RESET} [pkg] Show version information (optionally for a specific package)
72
+ {GREEN}all_doctests{RESET} [dir] Run all doctests in the specified directory
73
+ {GREEN}archive{RESET} --help Archive utilities (make, repair)
74
+ {GREEN}backup{RESET} --help Backup utilities (delta, consolidate, limit)
75
+ {CYAN}{separator}{RESET}
76
+ """.strip())
63
77
  return
64
78
 
65
79
  if __name__ == "__main__":
@@ -17,7 +17,7 @@ from zipfile import ZIP_DEFLATED, ZipFile, ZipInfo
17
17
 
18
18
  from .decorators import LogLevels, handle_error
19
19
  from .io import clean_path, super_copy
20
- from .print import debug, error, info
20
+ from .print import CYAN, GREEN, RESET, debug, error, info
21
21
 
22
22
 
23
23
  # Function that repair a corrupted zip file (ignoring some of the errors)
@@ -267,6 +267,24 @@ def archive_cli() -> None:
267
267
  import argparse
268
268
  import sys
269
269
 
270
+ # Check for help or no command
271
+ if len(sys.argv) == 1 or (len(sys.argv) == 2 and sys.argv[1] in ("--help", "-h", "help")):
272
+ separator: str = "─" * 60
273
+ print(f"{CYAN}{separator}{RESET}")
274
+ print(f"{CYAN}stouputils {GREEN}archive {CYAN}utilities{RESET}")
275
+ print(f"{CYAN}{separator}{RESET}")
276
+ print(f"\n{CYAN}Usage:{RESET} stouputils archive <command> [options]")
277
+ print(f"\n{CYAN}Available commands:{RESET}")
278
+ print(f" {GREEN}make{RESET} <source> <destination> [--ignore PATTERNS] [--create-dir]")
279
+ print(" Create a zip archive from source directory")
280
+ print(f" {CYAN}--ignore{RESET} Glob patterns to ignore (comma-separated)")
281
+ print(f" {CYAN}--create-dir{RESET} Create destination directory if needed")
282
+ print(f"\n {GREEN}repair{RESET} <input_file> [output_file]")
283
+ print(" Repair a corrupted zip file")
284
+ print(" If output_file is omitted, adds '_repaired' suffix")
285
+ print(f"{CYAN}{separator}{RESET}")
286
+ return
287
+
270
288
  parser = argparse.ArgumentParser(description="Archive utilities")
271
289
  subparsers = parser.add_subparsers(dest="command", help="Available commands")
272
290
 
@@ -1,6 +1,6 @@
1
1
  from .decorators import LogLevels as LogLevels, handle_error as handle_error
2
2
  from .io import clean_path as clean_path, super_copy as super_copy
3
- from .print import debug as debug, error as error, info as info
3
+ from .print import CYAN as CYAN, GREEN as GREEN, RESET as RESET, debug as debug, error as error, info as info
4
4
 
5
5
  def repair_zip_file(file_path: str, destination: str) -> bool:
6
6
  ''' Try to repair a corrupted zip file by ignoring some of the errors
@@ -50,6 +50,23 @@ def backup_cli() -> None:
50
50
  python -m stouputils.backup limit 5 /path/to/backups
51
51
  """
52
52
  import argparse
53
+ import sys
54
+
55
+ # Check for help or no command
56
+ if len(sys.argv) == 1 or (len(sys.argv) == 2 and sys.argv[1] in ("--help", "-h", "help")):
57
+ separator: str = "─" * 60
58
+ print(f"{CYAN}{separator}{RESET}")
59
+ print(f"{CYAN}Backup Utilities{RESET}")
60
+ print(f"{CYAN}{separator}{RESET}")
61
+ print(f"\n{CYAN}Usage:{RESET} stouputils backup <command> [options]")
62
+ print(f"\n{CYAN}Available commands:{RESET}")
63
+ print(f" {GREEN}delta{RESET} Create a new delta backup")
64
+ print(f" {GREEN}consolidate{RESET} Consolidate existing backups into one")
65
+ print(f" {GREEN}limit{RESET} Limit the number of delta backups")
66
+ print(f"\n{CYAN}For detailed help on a specific command:{RESET}")
67
+ print(" stouputils backup <command> --help")
68
+ print(f"{CYAN}{separator}{RESET}")
69
+ return
53
70
 
54
71
  # Setup command line argument parser
55
72
  parser: argparse.ArgumentParser = argparse.ArgumentParser(
@@ -82,21 +99,6 @@ def backup_cli() -> None:
82
99
  # Parse arguments and execute appropriate command
83
100
  args: argparse.Namespace = parser.parse_args()
84
101
 
85
- # Show custom help if no command is provided
86
- if not args.command:
87
- separator: str = "─" * 60
88
- print(f"{CYAN}{separator}{RESET}")
89
- print(f"{CYAN}Backup Utilities{RESET}")
90
- print(f"{CYAN}{separator}{RESET}")
91
- print(f"\n{CYAN}Usage:{RESET} stouputils backup <command> [options]")
92
- print(f"\n{CYAN}Available commands:{RESET}")
93
- print(f" {GREEN}delta{RESET} Create a new delta backup")
94
- print(f" {GREEN}consolidate{RESET} Consolidate existing backups into one")
95
- print(f" {GREEN}limit{RESET} Limit the number of delta backups")
96
- print(f"\n{CYAN}For detailed help on a specific command:{RESET}")
97
- print(" stouputils backup <command> --help")
98
- print(f"{CYAN}{separator}{RESET}")
99
- return
100
102
 
101
103
  if args.command == "delta":
102
104
  create_delta_backup(args.source, args.destination, args.exclude)
@@ -15,6 +15,7 @@ import atexit
15
15
  import os
16
16
  import shutil
17
17
  import tempfile
18
+ from collections.abc import Iterable
18
19
  from typing import TYPE_CHECKING, Any, Literal, TypeVar
19
20
 
20
21
  # Lazy imports for typing
@@ -28,14 +29,14 @@ if TYPE_CHECKING:
28
29
  T = TypeVar("T")
29
30
 
30
31
  # Functions
31
- def unique_list(list_to_clean: list[Any], method: Literal["id", "hash", "str"] = "str") -> list[Any]:
32
+ def unique_list(list_to_clean: Iterable[T], method: Literal["id", "hash", "str"] = "str") -> list[T]:
32
33
  """ Remove duplicates from the list while keeping the order using ids (default) or hash or str
33
34
 
34
35
  Args:
35
- list_to_clean (list[Any]): The list to clean
36
+ list_to_clean (Iterable[T]): The list to clean
36
37
  method (Literal["id", "hash", "str"]): The method to use to identify duplicates
37
38
  Returns:
38
- list[Any]: The cleaned list
39
+ list[T]: The cleaned list
39
40
 
40
41
  Examples:
41
42
  >>> unique_list([1, 2, 3, 2, 1], method="id")
@@ -54,8 +55,8 @@ def unique_list(list_to_clean: list[Any], method: Literal["id", "hash", "str"] =
54
55
  [{1, 2, 3}, {2, 3, 4}]
55
56
  """
56
57
  # Initialize the seen ids set and the result list
57
- seen: set[Any] = set()
58
- result: list[Any] = []
58
+ seen: set[int | str] = set()
59
+ result: list[T] = []
59
60
 
60
61
  # Iterate over each item in the list
61
62
  for item in list_to_clean:
@@ -1,18 +1,19 @@
1
1
  import polars as pl
2
2
  import zarr
3
+ from collections.abc import Iterable
3
4
  from numpy.typing import NDArray as NDArray
4
5
  from typing import Any, Literal, TypeVar
5
6
 
6
7
  T = TypeVar('T')
7
8
 
8
- def unique_list(list_to_clean: list[Any], method: Literal['id', 'hash', 'str'] = 'str') -> list[Any]:
9
+ def unique_list(list_to_clean: Iterable[T], method: Literal['id', 'hash', 'str'] = 'str') -> list[T]:
9
10
  ''' Remove duplicates from the list while keeping the order using ids (default) or hash or str
10
11
 
11
12
  \tArgs:
12
- \t\tlist_to_clean\t(list[Any]):\t\t\t\t\tThe list to clean
13
+ \t\tlist_to_clean\t(Iterable[T]):\t\t\t\t\tThe list to clean
13
14
  \t\tmethod\t\t\t(Literal["id", "hash", "str"]):\tThe method to use to identify duplicates
14
15
  \tReturns:
15
- \t\tlist[Any]: The cleaned list
16
+ \t\tlist[T]: The cleaned list
16
17
 
17
18
  \tExamples:
18
19
  \t\t>>> unique_list([1, 2, 3, 2, 1], method="id")
File without changes
File without changes
File without changes
File without changes
File without changes