import argparse

from config import app_config as cfg

from libraries.database_init import DataBase
from libraries.tweetimporter import TweetImporter
from libraries.twitterclient import TwitterClient

# Twitter API configuration
consumer_key = cfg.twitter["consumer_key"]
consumer_secret = cfg.twitter["consumer_secret"]

access_token = cfg.twitter["access_token"]
access_token_secret = cfg.twitter["access_token_secret"]

# Command line options
parser = argparse.ArgumentParser(description='provide additional information to run the bot detection')
parser.add_argument('specified_user', action="store", help='load tweets from the specified user')
parser.add_argument('--followers', action="store_true", help="load tweets from user's followers")

args = parser.parse_args()

# Start
database = DataBase(cfg.database["name"], cfg.database["tweet_table"])
client = TwitterClient(consumer_key, consumer_secret, access_token, access_token_secret)
importer = TweetImporter(client, database)

database.create_table()

importer.fromUser(args.specified_user, 20)
if args.followers:
    importer.fromFollowers(args.specified_user, 20)


@@ -738,16 +738,129 @@
 lowers%22)
+%0Aparser.add_argument('--create-db', action=%22store_true%22, help='create or drop the database if it already exists')
 %0A%0Aargs =
@@ -1093,16 +1093,39 @@
 abase)%0A%0A
+if args.create_db:%0A    
 database

Add option to create/drop the database