# dupeSweep - Python Package

**Find and remove duplicate files safely with undo capability.**

[![PyPI version](https://badge.fury.io/py/dupesweep.svg)](https://badge.fury.io/py/dupesweep)
[![Python Support](https://img.shields.io/pypi/pyversions/dupesweep.svg)](https://pypi.org/project/dupesweep/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

---

## Installation

### From PyPI (Recommended)

```bash
pip install dupesweep
```

### From Source

```bash
git clone https://github.com/larryste1/dupesweep.git
cd dupesweep/python
pip install .
```

### Development Installation

```bash
pip install -e ".[dev]"
```

---

## Quick Start

### GUI Mode (Default)

```bash
dupesweep
```

### CLI Mode

```bash
# Scan a directory
dupesweep scan ~/Downloads

# Remove files (with confirmation)
dupesweep remove file1.txt file2.txt

# Undo last operation
dupesweep undo

# Check operation history
dupesweep status

# Show help
dupesweep help
```

---

## Features

- 🔍 **SHA256 Content Hashing** - Full file hashing for accurate duplicate detection
- 🛡️ **Safe Operations** - Files moved to trash with collision-resistant naming
- ↩️ **Undo Support** - Restore files from any operation with verification
- 📊 **Statistics** - See wasted space and duplicate counts
- 🖥️ **GUI + CLI** - Graphical and command-line interfaces
- ⚡ **Two-Phase Hashing** - Quick hash first, full hash on collision
- 🧹 **OS Junk Filtering** - Automatically skips .DS_Store, Thumbs.db, etc.

---

## Requirements

- **Python**: 3.7 or higher
- **tkinter**: Usually included with Python (for GUI mode)
- **No external dependencies**!

---

## Usage Examples

### Find Duplicates

```bash
# Scan home directory
dupesweep scan ~

# Scan specific folder
dupesweep scan /path/to/folder

# Scan with progress indicator
dupesweep scan /large/directory
```

### Remove Duplicates

```bash
# Interactive GUI (recommended)
dupesweep

# CLI removal with confirmation
dupesweep remove /path/to/file1.txt /path/to/file2.txt
```

### Undo Operations

```bash
# Undo last batch
dupesweep undo

# View operation history
dupesweep status
```

---

## Testing

```bash
# Install test dependencies
pip install ".[dev]"

# Run tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=python --cov-report=html
```

---

## License

MIT License - See LICENSE file for details.

---

## Support

- **Issues**: https://github.com/larryste1/dupesweep/issues
- **Discussions**: https://github.com/larryste1/dupesweep/discussions
- **Source**: https://github.com/larryste1/dupesweep
