import sys

import nbformat


with open(sys.argv[1]) as fp:
    nb = nbformat.read(fp, as_version=nbformat.NO_CONVERT)

for cell in nb.cells:
    if 'execution_count' in cell:
        cell['execution_count'] = None

    if 'outputs' in cell:
        cell['outputs'] = []


with open(sys.argv[2], 'w') as fp:
    nbformat.write(nb, fp)
