A Python-based file management and automated archiving script designed to scan directories, filter out already compressed files, and systematically bundle items into zip archives based on custom size thresholds.
- Recursive Directory Traversal: Deeply crawls target directories to catalog files and folders into an execution queue.
- Smart Extension Filtering: Automatically detects and skips existing compressed archives (such as
.zip,.gz,.7z, and.rar) to prevent redundant packaging. - Threshold-Based Archiving: Evaluates individual file sizes and cumulative directory volumes against predefined limits to trigger automated compression routines.
- Storage Analytics: Calculates storage deltas upon completion, outputting a summary of zipped items and total bytes saved.
- Language: Python
- Standard Libraries:
os: For file system navigation, path resolution, and fetching file sizes.sys: For system-level operations.zipfile: For programmatically creating and managing archive packages.
- Run the script and input your target directory path when prompted.
- The script isolates the directory, maps out all non-archived files and folders, and checks them against size constraints.
- Items exceeding specific size limits are bundled into structured zip archives, and a final summary reports the total storage saved.