aboutsummaryrefslogtreecommitdiffstats
path: root/justice_build.py
blob: 9a48f55765af585156439c08a2a3e9447dc54aa8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from db_creation import create_DB
from download_files import download_data, get_valid_filenames
from update_db import update_DB
import os

def main():
    DB_name = "justice.db"
    create_DB(DB_name)
    valid_files = get_valid_filenames()
    os.makedirs("data", exist_ok=True)
    for valid_file in valid_files:
        download_data(valid_file)
    for valid_file in valid_files:
        modified_file_name = os.path.join(str(os.getcwd()), "data", valid_file + ".xml")
        update_DB(modified_file_name, DB_name)
  
main()