""" Extract peaks from an MP3 file. """ import click @click.command() @click.option('-i', '--input', 'fp_in', required=True, help='Input file') @click.pass_context def cli(ctx, fp_in): """Extract peaks from an audio file. """ from app.peaks import extract_peaks peaks = extract_peaks(fp_in) with open(os.path.join(app_cfg.DIR_DATA_STORE, 'peaks/peaks.json'), 'w') as fp_out: json.dump(peaks, fp_out, separators=(',', ':')) print("Wrote peaks.json")