Skip to main content

A simple utility to clean your mac of old stuff

Project description

cleanmymac

A simple command line tool to clean old stuff from your mac

documentation

http://cleanmymac.readthedocs.org/en/latest/

usage

$ cleanmymac -h
usage: cleanmymac [-h] [-u] [-d] [-q] [-l] [-s] [-c CONFIG] [-t TARGETS_PATH]
                  [TARGETS [TARGETS ...]]

cleanmymac v0.1.8, a simple utility designed to help clean your mac from
old/unwanted stuff

positional arguments:
  TARGETS               the list of targets to execute. Execute all if not
                        specified.

optional arguments:
  -h, --help            show this help message and exit
  -u, --update          update the target if applicable
  -d, --dry_run         describe the actions to be performed, do not execute
                        them
  -q, --quiet           run in quiet mode
  -l, --list            list registered cleanup targets
  -s, --stop_on_error   stop execution when first error is detected
  -c CONFIG, --config CONFIG
                        specify the configuration path
  -t TARGETS_PATH, --targets_path TARGETS_PATH
                        specify extra yaml defined targets path

a typical usage pattern is:

$ cleanmymac

installation

install from pypi:

$ pip install cleanmymac

clone the repository locally and issue

$ python setup.py install

configuration

the cleanmymac utility accepts a configuration file by specifying the -c option. If not specified the file is assumed to be at the following location ~/.cleanmymac.yaml

the global configuration can be used (for now) to pass specific env vars to shell commands, for example assume that anaconda is not in the main path:

cleanmymac: {
  targets_path: ['.']
}
anaconda: {
  env: {
    PATH: '~/anaconda/bin',
  },
}

extensibility

one can add more cleanup targets either by installing them as python classes registered to the following entry-point: cleanmymac.target like this (in setup.py):

entry_points={
    # ....
    'cleanmymac.target': [
        'my_target_name = my.python.package.MyTargetClass'
    ]
    # ...
}

alternatively for shell based commands simply create yaml files with the following schema:

type: 'cmd'
spec: {
  update_commands: [
    'brew update',
    'brew outdated | brew upgrade'
  ],
  clean_commands: [
    'brew cleanup'
  ]
}

or for cleaning up directories (removing all but the latest version):

type: 'dir'
spec: {
    update_message: 'Get the latest MacTex version from https://www.tug.org/mactex/',
    entries: [
        {
            dir: '/usr/local/texlive/',
            pattern: '\d+'
        },
    ]
}

note: see the cleanmymac.builtins module for more details

and point cleanmymac to the folder where the yaml files reside with the -t command line option

builtin targets

to see a list of builtin targets run:

$ cleanmymac -l
currently the following are supported:
  • homebrew

  • java jdk

  • mactex

  • anaconda

  • trash

disclaimer

I created this utility in the hope that others may find it useful, as I found it annoying to always remember how and what to clean from my mac. This is work in progress, so use at your own risk!

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

cleanmymac-0.1.9.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

cleanmymac-0.1.9-py2-none-any.whl (21.4 kB view details)

Uploaded Python 2

File details

Details for the file cleanmymac-0.1.9.tar.gz.

File metadata

  • Download URL: cleanmymac-0.1.9.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cleanmymac-0.1.9.tar.gz
Algorithm Hash digest
SHA256 a9c248bd2d3ee8d4b7cdfa31be746a2a9c9bb3f5f64e9f90e781af2950647473
MD5 b2709aba16e0a51829a3f18b0d155d5c
BLAKE2b-256 451869e7bcb4254f39b00f45845fcd4079c2f2696a270c866bad7d958b1f6793

See more details on using hashes here.

File details

Details for the file cleanmymac-0.1.9-py2-none-any.whl.

File metadata

File hashes

Hashes for cleanmymac-0.1.9-py2-none-any.whl
Algorithm Hash digest
SHA256 7b9e3babc0705b7f26a58f885898f114e3a43cd8e423a98e2e410c87743c91dd
MD5 fc52aec3e1a4418515dc8b422c31a44b
BLAKE2b-256 15c5c5eb5967c0f5dbfd4151fa7468caaa2f93444cb694cc23a87d367c76b9db

See more details on using hashes here.

Supported by

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