Skip to main content

System cleanup and file management toolbox

Project description

Inspectomat Toolbox

A comprehensive set of utilities for cleaning up files and directories, comparing folders, managing projects, and more. Inspectomat helps you organize and maintain your file system efficiently.

Quick Start

We provide easy-to-use launcher scripts that automatically set up a virtual environment and install the latest version of Inspectomat:

Linux/macOS:

# Make the script executable (first time only)
chmod +x run.sh

# Run Inspectomat
./run.sh

Windows (Command Prompt):

run.bat

Windows (PowerShell):

.\run.ps1

These scripts will:

  1. Check if Python is installed
  2. Create a virtual environment if needed
  3. Install or update Inspectomat to the latest version
  4. Launch the tool with any arguments you provide

Manual Installation

If you prefer to install manually:

# Create and activate a virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install from PyPI
pip install inspectomat

# Or install in development mode from source
pip install -e .

Usage

After installation, you can use the inspectomat tool in three ways:

Interactive Shell

Simply run the inspectomat command without arguments to start the interactive shell:

inspectomat
# or explicitly
inspectomat -i

This will show a prompt where you can type commands. Use list to see all available commands:

inspectomat> list

Direct Command Execution

You can run specific commands directly:

inspectomat cleanemptydirs
inspectomat findbigfiles
inspectomat comparefolders
# etc.

Use inspectomat -l or inspectomat --list to see all available commands.

Scriptable Shell Interface

You can also use the scriptable shell interface to call specific functions with parameters:

# List all available commands
inspectomat -l

# Call a specific function in a module
inspectomat cleanemptydirs -f find_empty_dirs -p /path/to/directory

# Call with named parameters
inspectomat findbigfiles -f find_big_files -p min_size=1000000 dir_path=/home/user/Documents

Command line arguments:

  • -f, --function: Function to call within the module
  • -p, --params: Parameters for the function (space-separated, use key=value format for named parameters)
  • -i, --interactive: Start interactive shell
  • -l, --list: List available commands
  • -y, --yes: Automatically answer yes to all prompts
  • --repair: Check and repair dependencies

Dependency Management and Self-Repair

The inspectomat package includes a self-repair mechanism that can automatically detect and install missing dependencies. If a command fails due to a missing dependency, the system will offer to install it for you.

To manually check and install dependencies:

# Interactive mode (will ask for confirmation)
inspectomat repair

# Non-interactive mode (automatically installs dependencies)
inspectomat repair -y

In the interactive shell, you can use the repair command:

inspectomat> repair

The system will automatically detect the following types of dependencies:

  • Core dependencies required for basic functionality
  • Optional dependencies required for specific modules

If you want to install all optional dependencies at once:

pip install -e .[full]

Tools Overview

Inspectomat includes the following tools:

  • clean_empty_dirs – Remove empty directories recursively.
  • find_big_files – Find and list the largest files in a directory tree.
  • compare_folders – Compare contents of two folders and show differences.
  • compare_equal_folders – Compare contents of folders up to a chosen depth, log equal folders, and show progress.
  • batch_compare_folders – Batch compare multiple folders and show results.
  • move_batch_duplicates – Move detected duplicate folders/files in batch mode.
  • move_duplicate_folders – Interactively move duplicate folders to a specified location.
  • move_nonidentical_files – Identify and move files that are not identical across folders.
  • resolve_folder_differences – Powerful, interactive N-way folder comparison and resolution tool.
  • git_projects_audit – Audit local git projects, check remote existence and equality, log results.
  • find_similar_projects – Find groups of project folders with similar structure for comparison.
  • media_deduplicate – Find and manage duplicate media files based on content.

resolve_folder_differences

An interactive script for comparing subfolders (to a chosen depth) across multiple base directories. Quickly detect and resolve differences in project structures, even for large sets.

Key features:

  • Compare N folders at once – Enter any number of directory paths to compare.
  • In-depth analysis – Compares all files in subfolders (to chosen depth), detects missing and differing files.
  • Difference table – Clear, wide table with full folder paths and file modification dates (oldest/newest highlighted). Only shows files that differ.
  • Interactive menu – For each group of differing subfolders you can: delete a selected folder, move a selected folder to a different subfolder in another and delete the original, skip, or exit.
  • Support for .ignore – An .ignore file (created automatically) allows excluding directories and files from comparisons (e.g., .git, .idea, venv).
  • Colorful, readable interface – Colors for headers, dates, menu, progress bar.
  • Progress bar – Shows scanning and comparison progress.
  • No differences notification – Clear message if no differences are found.
  • Adjustable scanning depth – Choose the depth at startup (default is 2).

Quick Start

  1. Add directories to compare:

    python resolve_folder_differences.py
    

    Enter the paths to the directories, followed by an empty line. You will be asked for the scanning depth.

  2. Customize exclusions: Edit the .ignore file in the toolbox directory to exclude irrelevant directories/files.

  3. Proceed with the menu: The script will display differences and ask for action for each group of subfolders.

Example Exclusion

.ignore file (automatically created with .git entry):

.git
.idea
venv
*.log

find_similar_projects

This script helps you automatically find similar projects in a large directory structure. It simplifies preparing a list of paths for further comparison.

Features:

  • You specify the starting path and scanning depth (default is 2).
  • The script finds folders that look like projects (e.g., contain setup.py, .git, package.json, etc.).
  • It groups projects with very similar file and folder structures.
  • For each path, it shows the number of files (recursive) and total folder size.
  • The result is groups of paths that you can provide to resolve_folder_differences.py for comparison.

Example Usage

python find_similar_projects.py
Enter root path to search for projects: /home/tom/Projects
How deep should be scanned? (default 2): 2

Groups of similar projects:

Group 1:
  /home/tom/Projects/app1   files:   123   size: 12.3 MB
  /home/tom/Projects/app2   files:   121   size: 12.2 MB

You can use the above paths as input to resolve_folder_differences.py for comparison.

Tips

  • The deeper the scan, the more potential projects will be found (but slower).
  • You can edit the .ignore file to exclude directories like .git, .idea, node_modules, etc.

Development

Project Structure

inspectomat/
├── inspectomat/             # Package directory
│   ├── __init__.py          # Package initialization
│   ├── _version.py          # Version information
│   ├── cli.py               # Command-line interface
│   ├── clean_empty_dirs.py  # Utility modules
│   ├── ...
├── tests/                   # Test directory
│   ├── __init__.py
│   ├── test_cli.py          # Tests for CLI
│   ├── ...
├── setup.py                 # Package setup file
├── pyproject.toml           # Modern Python packaging configuration
├── run.sh                   # Linux/macOS launcher script
├── run.bat                  # Windows CMD launcher script
├── run.ps1                  # Windows PowerShell launcher script
├── README.md                # This documentation
└── LICENSE                  # License file

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Version History

See the CHANGELOG.md file for details on version history and changes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inspectomat-0.1.6.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inspectomat-0.1.6-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

File details

Details for the file inspectomat-0.1.6.tar.gz.

File metadata

  • Download URL: inspectomat-0.1.6.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for inspectomat-0.1.6.tar.gz
Algorithm Hash digest
SHA256 59afc95ec31328add1784cebc9c923cfed70221cd3d292d13c7d0c1cce99b170
MD5 7be3f5079f68cb5b77e127353d4c9396
BLAKE2b-256 1bafaac9fc36e64e4457c1fac5aed3f25f4a6d6e329cc69ac7e25aa53bebe3bf

See more details on using hashes here.

File details

Details for the file inspectomat-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: inspectomat-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 43.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for inspectomat-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8adf7ec06f5ea363572b7987d85faf0f353417bbe6ff0addf109567784a59d01
MD5 9c460e38ef4451a2b86526722f872285
BLAKE2b-256 acc1c793dae06232f90d94e527604cc280a3d8b80c2cd09918eb20e0ca775143

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page