#!/usr/bin/env python
import argparse
import time

from gcounter.utils import load_database
import lib.sqlite



start = time.clock()


def get_arguments():
    parser = argparse.ArgumentParser()
    parser.add_argument('source_data')
    parser.add_argument('data_type')
    parser.add_argument('db_location')
    args = parser.parse_args()
    return args


if __name__ == '__main__':
    args = get_arguments()
    with lib.sqlite.connect(args.db_location) as conn:
        load_database(args, conn)
    print(args.data_type, time.clock() - start)
