2323 from uszipcode .pkg .atomicwrites import atomic_write
2424 from uszipcode .pkg .sqlalchemy_mate import engine_creator
2525
26+ SIMPLE_DB_FILE_DOWNOAD_URL = "https://datahub.io/machu-gwu/uszipcode-0.2.0-simple_db/r/simple_db.sqlite"
27+ DB_FILE_DOWNOAD_URL = "https://datahub.io/machu-gwu/uszipcode-0.2.0-db/r/db.sqlite"
2628
2729def get_simple_db_file_path (db_file_dir ):
2830 return Path (db_file_dir , "simple_db.sqlite" )
@@ -58,8 +60,8 @@ def connect_to_zipcode_db(db_file_dir):
5860 path = get_db_file_path (db_file_dir ).abspath )
5961
6062
61- def download_simple_db_file (db_file_dir ):
62- simple_db_file_download_url = "https://datahub.io/machu-gwu/uszipcode-0.2.0-simple_db/r/simple_db.sqlite"
63+ def download_simple_db_file (db_file_dir , download_url = None ):
64+ simple_db_file_download_url = download_url if download_url else SIMPLE_DB_FILE_DOWNOAD_URL
6365
6466 if not is_simple_db_file_exists (db_file_dir ):
6567 print ("Start downloading data for simple zipcode database, total size 9MB ..." )
@@ -77,8 +79,9 @@ def download_simple_db_file(db_file_dir):
7779 print (" Complete!" )
7880
7981
80- def download_db_file (db_file_dir ):
81- db_file_download_url = "https://datahub.io/machu-gwu/uszipcode-0.2.0-db/r/db.sqlite"
82+ def download_db_file (db_file_dir , download_url = None ):
83+ db_file_download_url = download_url if download_url else DB_FILE_DOWNOAD_URL
84+
8285 if not is_db_file_exists (db_file_dir ):
8386 print (
8487 "Start downloading data for rich info zipcode database, total size 450+MB ..." )
0 commit comments