Skip to main content

A safe and intelligent disk cleaning utility for macOS

Project description

Mac Cleaner 🧹

License: MIT Python 3.8+ Platform: macOS

Buy Me A Coffee

English | Español


English

A safe and intelligent disk cleaning utility for macOS that helps you reclaim disk space by identifying and removing temporary files, caches, and development artifacts.

Features

  • Smart Categorization: Organizes cleanable files into logical categories
  • Safety First: Built-in protections prevent deletion of critical system files
  • Interactive Selection: Choose exactly what to clean with an easy-to-use CLI
  • Dry-Run Mode: Preview what will be deleted before making changes
  • Multi-language Support: Automatically detects your system language (English/Spanish)
  • Developer-Friendly: Finds and cleans node_modules, Docker data, build caches, and more

What It Cleans

Mac Cleaner safely identifies and removes:

  1. Temporary Files: System and application temporary files
  2. System Logs: Log files from macOS and applications
  3. Homebrew Cache: Downloaded packages and build artifacts
  4. Browser Cache: Cache from Safari, Chrome, Firefox, Brave, Edge
  5. Node Modules: node_modules directories in your projects
  6. User Caches: Application caches (excluding Apple system caches)
  7. Development Caches: Xcode, npm, pip, yarn, CocoaPods, Cargo, Gradle
  8. Docker Data: Unused Docker images, containers, and volumes

Installation

From PyPI (when published)

pip install mac-cleaner

From Source

# Clone the repository
git clone https://github.com/yourusername/mac-cleaner.git
cd mac-cleaner

# Install in development mode
pip install -e .

# Or install normally
pip install .

Usage

Basic Usage

mac-cleaner

This will:

  1. Scan your system for cleanable files
  2. Display categories with size information
  3. Let you select what to clean
  4. Ask for confirmation before deleting

Dry-Run Mode

Preview what will be deleted without making changes:

mac-cleaner --dry-run

Examples

Clean everything:

$ mac-cleaner
Scanning categories...
Categories found:
 1) Temporary Files               2.3 GB (4 items)
 2) System Log Files              856.2 MB (3 items)
 3) Browser Cache                 1.2 GB (5 items)
 4) Node Modules                  4.5 GB (12 items)
 5) Development Cache             3.1 GB (6 items)

Select categories (e.g., 1,3,5 or all):
> all

Clean specific categories:

Select categories (e.g., 1,3,5 or all):
> 3,4,5

Safety Features

Mac Cleaner includes multiple layers of protection:

  • Whitelist approach: Only cleans known safe locations
  • Critical path protection: Prevents deletion of system directories
  • Apple file protection: Skips files starting with com.apple.
  • Permission handling: Gracefully handles permission-denied errors
  • macOS SIP protection: Respects System Integrity Protection
  • User confirmation: Always asks before deleting
  • Dry-run mode: Test before committing to changes

Requirements

  • macOS 10.13 or later
  • Python 3.8 or later
  • Optional: Docker (for Docker cleanup feature)
  • Optional: gettext (for translation compilation)

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/yourusername/mac-cleaner.git
cd mac-cleaner

# Install with dev dependencies
pip install -e ".[dev]"

Running Tests

pytest

Code Formatting

black mac_cleaner/

Type Checking

mypy mac_cleaner/

Updating Translations

  1. Edit .po files in mac_cleaner/locales/*/LC_MESSAGES/
  2. Compile translations:
    python compile_translations.py
    

Contributing

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

License

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

Disclaimer

While Mac Cleaner is designed with safety in mind, always ensure you have backups of important data. The authors are not responsible for any data loss.


Español

Una utilidad segura e inteligente de limpieza de disco para macOS que te ayuda a recuperar espacio eliminando archivos temporales, cachés y artefactos de desarrollo.

Características

  • Categorización Inteligente: Organiza archivos limpiables en categorías lógicas
  • Seguridad Primero: Protecciones integradas previenen la eliminación de archivos críticos del sistema
  • Selección Interactiva: Elige exactamente qué limpiar con una CLI fácil de usar
  • Modo Simulación: Previsualiza qué se eliminará antes de hacer cambios
  • Soporte Multi-idioma: Detecta automáticamente el idioma de tu sistema (Inglés/Español)
  • Amigable para Desarrolladores: Encuentra y limpia node_modules, datos de Docker, cachés de compilación, y más

Qué Limpia

Mac Cleaner identifica y elimina de forma segura:

  1. Archivos Temporales: Archivos temporales del sistema y aplicaciones
  2. Logs del Sistema: Archivos de log de macOS y aplicaciones
  3. Caché de Homebrew: Paquetes descargados y artefactos de compilación
  4. Caché de Navegadores: Caché de Safari, Chrome, Firefox, Brave, Edge
  5. Node Modules: Directorios node_modules en tus proyectos
  6. Cachés de Usuario: Cachés de aplicaciones (excluyendo cachés del sistema de Apple)
  7. Cachés de Desarrollo: Xcode, npm, pip, yarn, CocoaPods, Cargo, Gradle
  8. Datos de Docker: Imágenes, contenedores y volúmenes de Docker no usados

Instalación

Desde PyPI (cuando se publique)

pip install mac-cleaner

Desde el Código Fuente

# Clonar el repositorio
git clone https://github.com/yourusername/mac-cleaner.git
cd mac-cleaner

# Instalar en modo desarrollo
pip install -e .

# O instalar normalmente
pip install .

Uso

Uso Básico

mac-cleaner

Esto:

  1. Escanea tu sistema buscando archivos limpiables
  2. Muestra categorías con información de tamaño
  3. Te permite seleccionar qué limpiar
  4. Pide confirmación antes de eliminar

Modo Simulación

Previsualiza qué se eliminará sin hacer cambios:

mac-cleaner --dry-run

Ejemplos

Limpiar todo:

$ mac-cleaner
Escaneando categorías...
Categorías encontradas:
 1) Archivos Temporales          2.3 GB (4 items)
 2) Archivos de Log del Sistema  856.2 MB (3 items)
 3) Caché de Navegadores         1.2 GB (5 items)
 4) Node Modules                 4.5 GB (12 items)
 5) Caché de Desarrollo          3.1 GB (6 items)

Selecciona categorías (ej: 1,3,5 o all):
> all

Limpiar categorías específicas:

Selecciona categorías (ej: 1,3,5 o all):
> 3,4,5

Características de Seguridad

Mac Cleaner incluye múltiples capas de protección:

  • Enfoque de lista blanca: Solo limpia ubicaciones conocidas y seguras
  • Protección de rutas críticas: Previene la eliminación de directorios del sistema
  • Protección de archivos Apple: Omite archivos que comienzan con com.apple.
  • Manejo de permisos: Maneja errores de permisos denegados de forma elegante
  • Protección SIP de macOS: Respeta la Protección de Integridad del Sistema
  • Confirmación del usuario: Siempre pide confirmación antes de eliminar
  • Modo simulación: Prueba antes de comprometerte con los cambios

Requisitos

  • macOS 10.13 o posterior
  • Python 3.8 o posterior
  • Opcional: Docker (para la función de limpieza de Docker)
  • Opcional: gettext (para compilar traducciones)

Desarrollo

Configurar Entorno de Desarrollo

# Clonar el repositorio
git clone https://github.com/yourusername/mac-cleaner.git
cd mac-cleaner

# Instalar con dependencias de desarrollo
pip install -e ".[dev]"

Ejecutar Tests

pytest

Formateo de Código

black mac_cleaner/

Verificación de Tipos

mypy mac_cleaner/

Actualizar Traducciones

  1. Edita los archivos .po en mac_cleaner/locales/*/LC_MESSAGES/
  2. Compila las traducciones:
    python compile_translations.py
    

Contribuir

¡Las contribuciones son bienvenidas! No dudes en enviar un Pull Request.

Licencia

Este proyecto está licenciado bajo la Licencia MIT - consulta el archivo LICENSE para más detalles.

Descargo de Responsabilidad

Aunque Mac Cleaner está diseñado pensando en la seguridad, asegúrate siempre de tener copias de seguridad de datos importantes. Los autores no son responsables de ninguna pérdida de datos.

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

mac_cleaner-1.1.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

mac_cleaner-1.1.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file mac_cleaner-1.1.0.tar.gz.

File metadata

  • Download URL: mac_cleaner-1.1.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mac_cleaner-1.1.0.tar.gz
Algorithm Hash digest
SHA256 793c9656db6d95927f25639910d8dd77c46062b747293ce54a469831ca855a84
MD5 c4131f3aa4ac001c662c75f231216621
BLAKE2b-256 a07dc296c9a76c84e1065539e38945643734a3431e8b0e26ec8dfc97750b2461

See more details on using hashes here.

Provenance

The following attestation bundles were made for mac_cleaner-1.1.0.tar.gz:

Publisher: python-publish.yml on nmlemus/mac-cleaner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mac_cleaner-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: mac_cleaner-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mac_cleaner-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0a18011f7fee4634d403b259dbc7d0bdb003d3e2b32eaa3af323d3078d4ad78
MD5 42b3fb2401de5d2216f6a339e406c703
BLAKE2b-256 3595030a593c724df398f3c6a885451edce98408e7b069641b07b027103e3c20

See more details on using hashes here.

Provenance

The following attestation bundles were made for mac_cleaner-1.1.0-py3-none-any.whl:

Publisher: python-publish.yml on nmlemus/mac-cleaner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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