Ejemplo n.º 1
0
def main():
    print(
        "The program can try connecting to the TRAKT API to download data or use local data to insert instead (faster)?"
    )
    answer = input("Do you want to connect to the TRAKT API? (y/n) ")

    init_db.init_db()
    init_db.create_schema()
    if answer.lower() == "y":
        insert_genres()
        insert_shows(limit=20, max_show_count=100)
        print('Data downloaded and inserted successfully')
    else:
        execute_sql_file("data/dump_1000_shows/codecool_public_genres.sql")
        print("Genres inserted")
        execute_sql_file("data/dump_1000_shows/codecool_public_shows.sql")
        print("Shows inserted")
        execute_sql_file(
            "data/dump_1000_shows/codecool_public_show_genres.sql")
        print("Show genres inserted")
        execute_sql_file("data/dump_1000_shows/codecool_public_seasons.sql")
        print("Seasons inserted")
        execute_sql_file("data/dump_1000_shows/codecool_public_episodes.sql")
        print("Episodes inserted")
        execute_sql_file("data/dump_1000_shows/codecool_public_actors.sql")
        print("Actors inserted")
        execute_sql_file(
            "data/dump_1000_shows/codecool_public_show_characters.sql")
        print("Show characters inserted")
Ejemplo n.º 2
0
def main():
    init_db()
    create_schema()
    insert_genres()
    insert_shows(limit=20, max_show_count=100)
def main():
    init_db.init_db()
    init_db.create_schema()
    execute_script_file("db_schema/fill_db.sql")
    print("YOLO")