Delete all your collections

The following Python script provides an easy way to delete all your collections.
Notes
Caution: Deletes every collection in your SeedMe account
Sleeps for 30 seconds between consecutive deletions, so consider running this for a long uninterrupted period if you have several collections

#!/usr/bin/env python

"""delete-all-collections.py: Deletes all collections for your account.
Note: The script sleeps for 30 seconds between consecutive deletions, so consider running this for a long uninterrupted period if you have several collections.

Usage
1. seedme module must be installed or seedme.py should be in same folder
2. % python delete-all-collection.py
"""

import json
import time
import sys

try:
    import seedme
except ImportError:
    print 'Error: seedme module not found'
    print 'Install seedme with % pip install seedme'
    print 'OR'
    print 'Use self contained SeedMe module from here ' +\
          'https://www.seedme.org/downloads'
    print 'Move this file into the unzipped SeedMe module directory'
    raise



# @see http://code.activestate.com/recipes/577058/
def query_yes_no(question, default="yes"):
    """Ask a yes/no question via raw_input() and return their answer.

    "question" is a string that is presented to the user.
    "default" is the presumed answer if the user just hits .
        It must be "yes" (the default), "no" or None (meaning
        an answer is required of the user).

    The "answer" return value is one of "yes" or "no".
    """
    valid = {"yes":"yes",   "y":"yes",  "ye":"yes",
             "no":"no",     "n":"no"}
    if default == None:
        prompt = " [y/n] "
    elif default == "yes":
        prompt = " [Y/n] "
    elif default == "no":
        prompt = " [y/N] "
    else:
        raise ValueError("invalid default answer: '%s'" % default)

    while 1:
        sys.stdout.write(question + prompt)
        choice = raw_input().lower()
        if default is not None and choice == '':
            return default
        elif choice in valid.keys():
            return valid[choice]
        else:
            sys.stdout.write("Please respond with 'yes' or 'no' "\
                             "(or 'y' or 'n').\n")

# Sanity checks
check = query_yes_no('Delete all your collections?')
if 'no' in check:
    exit(1)

check_again = query_yes_no('Are you sure you want to delete all your collections?')
if 'no' in check_again:
    exit(1)

# Create an object from SeedMe class
obj = seedme.SeedMe()

# Fetch list of all collections
response = obj.query()
json_object = json.loads(response)
del obj

# Grab all collections in a list
collections = []
for c in json_object['results']:
    collections.append(c['collection_id'])


if not collections:
    print ('Nothing to delete as no collections were found for your accout')
    exit(1)

# Now lets delete all collections
# Pause 30 seconds between deletion to avoid DDOS
n = 30
for i, x in enumerate(collections, 1):
    obj = seedme.SeedMe()
    obj.delete(x)
    del obj
    print 'Deleted ' + str(i) + ' of ' + str(len(collections)) + '; ID: ' + x
    if i != len(collections):
        print 'Sleeping for ' + str(n) + ' seconds'
        time.sleep(n)  # Delay for 1 minute (60 seconds)

print 'Deleted all your collections'