diff options
author | Petr Šmerkl <46304018+SveterCZE@users.noreply.github.com> | 2022-01-23 00:40:16 +0100 |
---|---|---|
committer | Petr Šmerkl <46304018+SveterCZE@users.noreply.github.com> | 2022-01-23 00:40:16 +0100 |
commit | f618eeb6f13edb4d1e272cab90aa5ee982f2e358 (patch) | |
tree | d96a737c14b894181b758835ee7c4e7a0958acf5 /justice_build.py | |
parent | 632cadaf7e460b9fa24de6cde1b5abe9b36ed4a5 (diff) | |
download | justice-f618eeb6f13edb4d1e272cab90aa5ee982f2e358.tar.gz |
add a feature to display criminal convictions
Diffstat (limited to 'justice_build.py')
-rw-r--r-- | justice_build.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/justice_build.py b/justice_build.py index 5850340..aa092f6 100644 --- a/justice_build.py +++ b/justice_build.py @@ -1,19 +1,24 @@ from db_creation import create_DB
-from download_files import download_data, get_valid_filenames
+from download_files import download_data, get_valid_filenames, download_criminal_records
from update_db import update_DB
from backup_DB import backup_DB
+from insert_criminal_records import insert_criminal_records
import os
def main():
DB_name = "justice.db"
backup_DB()
create_DB(DB_name)
+ # Download commercial register data
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:
- 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)
-
+ modified_file_name = os.path.join(str(os.getcwd()), "data", valid_file + ".xml")
+ update_DB(modified_file_name, DB_name)
+ # Download criminal records
+ download_criminal_records()
+ insert_criminal_records(DB_name)
+
main()
\ No newline at end of file |