Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎬 Final Cut Pro Bundle Cleaner

Python 3.6+ License: MIT macOS

A powerful Python utility to clean up large cache folders from Final Cut Pro projects before backing them up. Save 50-70% disk space by safely removing regenerable files!

🎯 What It Does

This tool safely removes regenerable cache folders from your Final Cut Pro projects:

  • ✅ Analysis Files - Automatically regenerated when you open the project
  • ✅ Render Files - Regenerated when you render
  • ✅ Transcoded Media - Automatically regenerated

What It NEVER Touches:

  • ❌ Original Media
  • ❌ Project files (CurrentVersion.fcpevent)
  • ❌ Any other important files

Real-world results: From testing on 8 projects, we freed up 60.5 GB of disk space! 🎉


📦 Features

  • 🔍 Multiple Interfaces:

    • CLI mode with interactive menus
    • TUI (Terminal UI) with curses
    • File browser for easy navigation
  • 🛡️ Safety First:

    • Dry-run mode to preview before deleting
    • Confirmation prompts
    • Detailed error messages
  • ⚡ Performance:

    • Optimized folder size calculation
    • Fast recursive scanning
    • Progress indicators
  • 🌐 Bilingual:

    • Full Arabic/English documentation
    • Arabic interface for local users

🚀 Quick Start

Prerequisites

  • Python 3.6 or higher
  • macOS (Final Cut Pro)
  • No external dependencies required!

Installation

# Clone the repository
git clone https://github.com/YOUR_USERNAME/backup-cleaner.git
cd backup-cleaner

# Make scripts executable (optional)
chmod +x *.py *.sh *.command

Usage

1️⃣ Dry Run (Preview Only)

See what will be deleted without actually deleting:

python3 fcp_cleaner.py /path/to/projects --dry-run

Example:

python3 fcp_cleaner.py ~/Videos/December_Backup --dry-run

Output:

📊 Final Cut Pro Project Analysis Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] Project: Episode_1.fcpbundle
    📁 Date: 2-12-2025
       • Analysis Files: 1.4 MB
       • Render Files: 15.0 GB
    💾 Total Cleanable: 15.0 GB
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🗑️  Total Space Savings: 60.5 GB

2️⃣ Interactive Mode (Recommended)

Choose exactly what to delete:

python3 fcp_cleaner.py /path/to/projects

You can:

  • Delete a specific folder from a specific project
  • Delete all cache folders from one project
  • Delete everything from all projects

3️⃣ Auto Mode (Batch Delete)

Delete everything automatically:

python3 fcp_cleaner.py /path/to/projects --auto

⚠️ Warning: This will delete all cache folders without confirmation!


4️⃣ TUI Mode (Terminal User Interface)

Interactive curses-based interface with keyboard navigation:

python3 fcp_clean.py

Controls:

  • ↑/↓ - Navigate
  • SPACE - Select/Deselect
  • d - Delete current item
  • D - Delete all
  • q - Quit

Features:

  • TAB completion for paths
  • Real-time size calculation
  • Visual selection

5️⃣ Browse Mode (File Browser)

Navigate your filesystem interactively:

python3 fcp_browse.py

Controls:

  • ↑/↓ - Navigate folders
  • ENTER - Open folder
  • BACKSPACE - Go back
  • s - Scan current location
  • q - Quit

🎨 macOS Integration

For easy access, use the included .command files (just double-click):

  • 🎬_FCP_Cleaner.command - Main TUI interface
  • 🎬_FCP_Browse.command - File browser
  • 🔍_معاينة_فقط.command - Preview only (dry-run)
  • 🗑️_مسح_تلقائي.command - Auto-delete mode

Or use the shell wrapper:

./clean.sh --dry-run   # Preview
./clean.sh --auto      # Auto-delete
./clean.sh             # Interactive

📁 Project Structure

backup-cleaner/
├── fcp_common.py           # Shared utility functions (NEW!)
├── fcp_cleaner.py          # Main CLI script
├── fcp_clean.py            # TUI interface
├── fcp_browse.py           # File browser
├── clean.sh                # Shell wrapper
├── requirements.txt        # Python dependencies
├── README.md               # This file
├── CLAUDE.md               # Developer documentation
├── .gitignore              # Git ignore file
│
├── 🎬_FCP_Cleaner.command  # macOS launcher (TUI)
├── 🎬_FCP_Browse.command   # macOS launcher (Browser)
├── 🔍_معاينة_فقط.command   # macOS launcher (Dry-run)
└── 🗑️_مسح_تلقائي.command   # macOS launcher (Auto)

🔧 Advanced Usage

Command Line Arguments

python3 fcp_cleaner.py [path] [options]

Arguments:
  path              Path to scan (default: current directory)

Options:
  --dry-run         Show report only, don't delete
  --auto            Auto-delete without confirmation

Examples

# Scan current directory in dry-run mode
python3 fcp_cleaner.py --dry-run

# Scan specific folder interactively
python3 fcp_cleaner.py ~/Videos/Projects

# Auto-delete from subfolder
python3 fcp_cleaner.py 12 --auto

# TUI with path argument
python3 fcp_clean.py ~/Desktop/FCP_Projects

🧪 How It Works

  1. Scan: Recursively searches for .fcpbundle directories
  2. Identify: Finds date folders containing CurrentVersion.fcpevent
  3. Analyze: Calculates sizes of target folders:
    • Analysis Files
    • Render Files
    • Transcoded Media
  4. Report: Shows total space savings
  5. Delete: Removes selected folders with confirmation

Technical Details

  • Uses optimized os.walk() instead of rglob() for better performance
  • Handles permission errors gracefully
  • Returns detailed error messages for failed deletions
  • Supports progress callbacks for UI integration

🛡️ Safety Features

  • ✅ Dry-run mode - Preview before deleting
  • ✅ Confirmation prompts - Multiple confirmations for batch operations
  • ✅ Detailed error messages - Know exactly what went wrong
  • ✅ Targeted deletion - Only removes specific cache folders
  • ✅ Error recovery - Continues on permission errors

📊 Performance

Before Optimization

  • Used pathlib.rglob('*') - slow on large folders
  • No progress indicators
  • Generic error messages

After Optimization (v2.0)

  • Uses os.walk() - ~3x faster on large folders
  • Progress callbacks for UI updates
  • Detailed error reporting with specific failure reasons
  • Shared code in fcp_common.py - easier maintenance

Benchmarks

On a folder with 8 FCP projects (500GB total):

  • Scanning: ~5-10 seconds
  • Size calculation: ~30-60 seconds (depending on file count)
  • Deletion: ~10-30 seconds (depending on file count)

🌍 Internationalization

The project includes full bilingual support:

  • English: README.md, code comments
  • Arabic: Multiple tutorial files, UI text, documentation

Arabic documentation files:

  • اقرأني.txt - Arabic README
  • الاختصارات.txt - Shortcuts guide
  • تعليمات_الاستخدام.txt - Usage instructions
  • كيف_تستخدم.txt - How to use guide
  • ملخص_الميزات_النهائية.txt - Final features summary

🤝 Contributing

Contributions are welcome! Here's how you can help:

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

Development Setup

# Clone the repo
git clone https://github.com/YOUR_USERNAME/backup-cleaner.git
cd backup-cleaner

# (Optional) Install development dependencies
pip install -r requirements.txt

# Run tests (when available)
# pytest

# Format code
# black *.py

# Type check
# mypy *.py

📝 License

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


⚠️ Disclaimer

USE AT YOUR OWN RISK!

While this tool is designed to be safe and only deletes regenerable cache files, always:

  1. Backup your projects before using this tool
  2. Test with --dry-run first to see what will be deleted
  3. Verify you have the original media files before deleting caches

The authors are not responsible for any data loss. Final Cut Pro can regenerate all deleted files, but this takes time and processing power.


🙏 Acknowledgments

  • Built for the Arabic content creator community
  • Inspired by the need to save disk space during monthly backups
  • Uses Python's built-in libraries for maximum compatibility

📞 Support

If you encounter any issues:

  1. Check the CLAUDE.md for developer documentation
  2. Review the Arabic tutorials for detailed guidance
  3. Open an issue on GitHub with:
    • Python version (python3 --version)
    • macOS version
    • Error message
    • What you were trying to do

🗺️ Roadmap

Future improvements:

  • Add send2trash support for safer deletion
  • Web-based UI
  • Scheduled automatic cleaning
  • Integration with Final Cut Pro Library paths
  • Statistics and reporting dashboard
  • Unit tests
  • Windows/Linux support (if applicable)

🎉 Success Stories

"Freed up 60GB from my December projects folder in seconds!" - Original User

"The TUI interface is amazing - feels like using ncdu!" - Beta Tester


Made with ❤️ for video editors who value their disk space

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages