stouputils 1.9.3__tar.gz → 1.9.4__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.
- {stouputils-1.9.3 → stouputils-1.9.4}/PKG-INFO +1 -1
- {stouputils-1.9.3 → stouputils-1.9.4}/pyproject.toml +1 -1
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/__main__.py +8 -1
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/archive.py +19 -1
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/archive.pyi +1 -1
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/backup.py +17 -15
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/collections.py +6 -5
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/collections.pyi +4 -3
- {stouputils-1.9.3 → stouputils-1.9.4}/.gitignore +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/LICENSE +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/README.md +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/__init__.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/_deprecated.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/_deprecated.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/all_doctests.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/all_doctests.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/__init__.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/automatic_docs.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/automatic_docs.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/upscaler/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/upscaler/__init__.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/upscaler/config.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/upscaler/config.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/upscaler/image.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/upscaler/image.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/upscaler/video.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/applications/upscaler/video.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/backup.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/__init__.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/cd_utils.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/cd_utils.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/github.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/github.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/pypi.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/pypi.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/pyproject.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/pyproject.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/stubs.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/continuous_delivery/stubs.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/ctx.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/ctx.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/config/get.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/config/set.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/auto_contrast.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/axis_flip.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/bias_field_correction.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/binary_threshold.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/blur.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/brightness.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/canny.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/clahe.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/common.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/contrast.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/curvature_flow_filter.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/denoise.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/histogram_equalization.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/invert.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/laplacian.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/median_blur.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/noise.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/normalize.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/random_erase.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/resize.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/rotation.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/salt_pepper.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/sharpening.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/shearing.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/threshold.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/translation.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/zoom.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image_augmentation.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image_preprocess.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/prosthesis_detection.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/technique.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/dataset/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/dataset/dataset.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/dataset/dataset_loader.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/dataset/grouping_strategy.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/dataset/image_loader.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/dataset/xy_tuple.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/metric_dictionnary.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/metric_utils.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/mlflow_utils.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/abstract_model.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/all.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/base_keras.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/all.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/convnext.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/densenet.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/efficientnet.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/mobilenet.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/resnet.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/squeezenet.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/vgg.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras/xception.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/callbacks/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/callbacks/colored_progress_bar.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/callbacks/learning_rate_finder.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/callbacks/model_checkpoint_v2.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/callbacks/progressive_unfreezing.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/callbacks/warmup_scheduler.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/losses/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/losses/next_generation_loss.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/visualizations.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/model_interface.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/sandbox.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/range_tuple.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/scripts/augment_dataset.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/scripts/exhaustive_process.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/scripts/preprocess_dataset.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/scripts/routine.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/utils.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/decorators.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/decorators.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/image.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/image.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/__init__.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/__init__.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/common.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/common.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/downloader.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/downloader.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/linux.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/linux.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/main.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/main.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/windows.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/installer/windows.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/io.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/io.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/parallel.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/parallel.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/print.py +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/print.pyi +0 -0
- {stouputils-1.9.3 → stouputils-1.9.4}/stouputils/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: stouputils
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.4
|
|
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
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "stouputils"
|
|
8
|
-
version = "1.9.
|
|
8
|
+
version = "1.9.4"
|
|
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,14 @@ 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=["--version", "-v", "all_doctests", "archive", "backup"])
|
|
18
19
|
parser.add_argument("args", nargs="*")
|
|
19
20
|
argcomplete.autocomplete(parser)
|
|
20
21
|
|
|
@@ -33,6 +34,11 @@ def main() -> None:
|
|
|
33
34
|
sys.exit(1)
|
|
34
35
|
return
|
|
35
36
|
|
|
37
|
+
# Handle "archive" command
|
|
38
|
+
if second_arg == "archive":
|
|
39
|
+
sys.argv.pop(1) # Remove "archive" from argv so archive_cli gets clean arguments
|
|
40
|
+
return archive_cli()
|
|
41
|
+
|
|
36
42
|
# Handle "backup" command
|
|
37
43
|
if second_arg == "backup":
|
|
38
44
|
sys.argv.pop(1) # Remove "backup" from argv so backup_cli gets clean arguments
|
|
@@ -58,6 +64,7 @@ def main() -> None:
|
|
|
58
64
|
print(f"\n{CYAN}Available commands:{RESET}")
|
|
59
65
|
print(f" {GREEN}--version, -v{RESET} Show version information")
|
|
60
66
|
print(f" {GREEN}all_doctests{RESET} [dir] Run all doctests in the specified directory")
|
|
67
|
+
print(f" {GREEN}archive{RESET} --help Archive utilities (make, repair)")
|
|
61
68
|
print(f" {GREEN}backup{RESET} --help Backup utilities (delta, consolidate, limit)")
|
|
62
69
|
print(f"{CYAN}{separator}{RESET}")
|
|
63
70
|
return
|
|
@@ -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:
|
|
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 (
|
|
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[
|
|
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[
|
|
58
|
-
result: list[
|
|
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:
|
|
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(
|
|
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[
|
|
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
|
|
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
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/__init__.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/auto_contrast.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/axis_flip.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/brightness.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/canny.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/clahe.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/common.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/contrast.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/denoise.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/invert.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/laplacian.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/median_blur.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/noise.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/normalize.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/random_erase.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/resize.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/rotation.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/salt_pepper.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/sharpening.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/shearing.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/threshold.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image/translation.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image_augmentation.py
RENAMED
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/data_processing/image_preprocess.py
RENAMED
|
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
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/losses/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{stouputils-1.9.3 → stouputils-1.9.4}/stouputils/data_science/models/keras_utils/visualizations.py
RENAMED
|
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
|