def parse_filename(args, start_date):
    """Parse filename from args and start_date

    Arguments:
        args: the arguments provided to the script

    Returns:
        filename: the filename to use for the csv data
    """
    if args.filename:
        filename = args.filename
    # depending on date args either append the month or the start_date
    elif args.last_month:
        filename = (__file__.replace('.py', '_{}.csv').format(start_date.strftime('%B')))
    else:
        filename = __file__.replace('.py', '_{}.csv').format(start_date)
    return filename