A little python script to identify homebrew “standalone” formulas…

#! /usr/bin/python

import sys, os

aloneList = []

def brewStandAlone(formula):
    print("Checking status of: "+formula)
    cmd = "brew uses "+formula.rstrip()+" --installed"
    useTest = os.popen(cmd).readlines()
    if len(useTest) == 0:
        aloneList.append(formula.rstrip())

if len(sys.argv) <= 1:
    formulae = os.popen("brew list").readlines()
    for f in formulae:
        f.rstrip()
        brewStandAlone(f)

else:
    brewStandAlone(sys.argv[1])

print("Standalone formula(e) (empty = none):")
print(aloneList)