You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FieldDownloader/new_db.py

45 lines
1.0 KiB

import sqlite3
import os
def create_database():
db_path = os.path.join(os.getcwd(), 'data_sets.db')
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
create_category_table(cursor)
create_datasets_table(cursor)
conn.commit()
conn.close()
def create_category_table(cursor):
cursor.execute('''
CREATE TABLE IF NOT EXISTS category (
name TEXT,
base_url TEXT,
category_id TEXT,
region TEXT,
universe TEXT,
delay TEXT,
downloaded TEXT
)
''')
def create_datasets_table(cursor):
cursor.execute('''
CREATE TABLE IF NOT EXISTS data_sets (
name TEXT,
description TEXT,
dataset_id TEXT,
dataset_name TEXT,
category_id TEXT,
category_name TEXT,
region TEXT,
delay TEXT,
universe TEXT,
type TEXT
)
''')
if __name__ == "__main__":
create_database()