Skip to content

About

Python tools for archiving, cleaning, organizing, and validating media collections.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

106 Commits

Folders and files

Repository files navigation

ArchiveTools

ArchiveTools is a suite of Python-based tools for streamlining file management tasks. It includes utilities for converting folders to ZIP archives (optionally with AES-256 encryption), extracting ZIPs with password handling, organizing media by date, detecting and deleting duplicate files, flattening folder structures, cleaning up junk and empty files/folders, and setting file creation and modification dates using EXIF data, sidecar files, or metadata. The tools are designed to simplify managing large file collections and maintaining organized directories.

Usage

When a selected file is unsupported, commands consistently report: Selected file is not supported by this command.

Organize all Media by Date

This script organizes either one media file or every media file directly inside a folder into dated subfolders. The date can come from EXIF data, sidecars, filenames, metadata, or folder names. Matching sidecars move with the media file. Optionally, early morning times can be treated as belonging to the previous day (--midnight-shift).

organizebydate TARGET --[day|week|month|year] [--rename] [--mode mode] [--midnight-shift] [--verbose]

Flatten Folder Structure

For a folder target, this script moves files from its subfolders into that folder and removes emptied subfolders. For a file target, it moves only that file one directory level upward. --depth applies only to folder targets. Conflicting files can be renamed instead of skipped.

flattenfolder TARGET [--rename] [--depth n] [--verbose]

Convert all Folders to ZIPs

This command accepts folders only. By default, it compresses each immediate subfolder into an individual ZIP. Add -s/--single to compress the target folder itself into a sibling ZIP instead. Verified source folders are removed in both modes. A file target is rejected with an error. AES-256 encryption is optional.

convertfolderstozips TARGET [-s|--single] [--aes256 [password]] [--verbose]

If no password is specified with --aes256, you will be prompted securely.

Convert all ZIPs to Folders

For a folder target, this script extracts every ZIP directly inside it, verifies the results, and removes verified source archives. For a ZIP file target, it extracts only that archive into a sibling folder and keeps the selected ZIP. Any other file type is rejected with an error. AES-256 password handling is supported.

convertzipstofolders TARGET [--aes256 [password]] [--verbose]

If no password is specified with --aes256, you will be prompted securely when needed.

Delete all Duplicate Files

For a folder target, this script recursively finds duplicate media and keeps one preferred copy from each matching group. For a file target, it searches the file's parent tree for identical copies but can delete only the selected file; all other files are left unchanged. The preferred copy is chosen using the selected date strategy.

deleteduplicates TARGET [--mode mode] [--dry-run] [--verbose]

Set Files to Selected Date

This script updates either one media file or every media file directly inside a folder. The date can be chosen from EXIF data, ffprobe metadata, sidecars, filenames, folder names, or file timestamps. It also updates matching sidecars, JPEG EXIF metadata, and MP4/MOV metadata where possible.

Supports dry-run mode and force-overwrite mode.

setdates TARGET [--mode mode] [--force] [--dry-run] [--verbose]

Clean up Junk Files and Empty Folders

For a file target, this script removes that file only if it is junk or an empty sidecar. For a folder target, it recursively removes junk files/folders, empty sidecars, and empty folders. Files whose names start with ._ are removed only when their contents identify them as AppleDouble metadata. Use --dry-run to preview every removal without changing anything.

cleanup TARGET [--dry-run] [--verbose]

Check Media Files for Corruption

This script checks exactly one file when given a file target, or recursively checks every file under a folder target. Recognized images and RAW photos are fully decoded, videos are decoded from beginning to end with FFmpeg, and GPX/KML/KMZ files are parsed. Files outside the recognized media extension list are reported as UNSUPPORTED. Each file is classified as OK, READABLE_DAMAGED, CORRUPT, UNSUPPORTED, or ERROR; only files that complete strict format-specific validation count as OK. JPEGs with an allowlisted truncation error are reported as readable but damaged only when complete tolerant Pillow decoding and an independent FFmpeg frame decode both succeed. Every frame of multi-frame images is checked.

FFmpeg must be installed and available on PATH for video validation. One grouped result is logged per folder containing files. Skipped extensions and each readable-damaged, corrupt, or error file are shown as color-coded tree entries below the folder result. Folders where everything passes simply report that all files are OK. Use --move to move readable-damaged files into a DAMAGED subfolder and corrupt files into a CORRUPT subfolder beside the originals. Existing files are never overwritten.

checkmediacorruption TARGET [--move] [--verbose]

© 2025 gabbro246. All rights reserved.

About

Python tools for archiving, cleaning, organizing, and validating media collections.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages