#!/usr/bin/env python

"""Helper script for EchoPlot. Run echoplot.py for details."""

# Author: Alexandre Passant - apassant.net
# Licensed: MIT - see LICENSE.txt

import argparse

from echoplot import EchoPlot

if __name__ == '__main__':
    # Arguments parser
    parser = argparse.ArgumentParser(description='Plot loudness of a song using the EchoNest API.')
    # mandatory
    parser.add_argument('artist', help="the song's artist, e.g. 'The Clash'")
    parser.add_argument('title', help="the song's title, e.g. 'London Calling'")
    # Optional
    parser.add_argument('-s', '--start', help='start analysis at a given time (seconds)')
    parser.add_argument('-e', '--end', help='end analysis at a given time (seconds)')
    # Go
    args = parser.parse_args()
    EchoPlot(args.artist, args.title, args.start, args.end).plot()

