diff --git a/example_conn.cfg b/example_conn.cfg index 87ab86fadb96b19221b892d2bb339ac4bac2092a..6eed2b7e48644e07b50cb74e4bc38de6515f7c82 100644 --- a/example_conn.cfg +++ b/example_conn.cfg @@ -3,4 +3,5 @@ host=host-ip port=port dbname=database name user=username -pwd=password \ No newline at end of file +pwd=password +url=API url \ No newline at end of file diff --git a/geocoder_script.py b/geocoder_script.py index 4017447a43f19e07d39a7d783720bf868c840984..ebb2a1db3c6fe61fd73c5769f497cdea5fbdd6e7 100644 --- a/geocoder_script.py +++ b/geocoder_script.py @@ -16,7 +16,7 @@ if __name__ == '__main__': user={conn_config['connection']['user']} password={conn_config['connection']['pwd']}""" - url = r"https://chat.gdi-sh.de/aregapi/" + url = conn_config['connection']['url'] # logfile = r"geocoder.log" my_db = DBTools(conn_str) @@ -50,12 +50,12 @@ if __name__ == '__main__': if areg_response_key[0] == "ERROR": errorfeatures += 1 - print( - areg_response_key[0] + ": " + - areg_response[areg_response_key[0]] + - f""" | betroffene schule: [{item[0]}]\t{adresse['hnr']}; - {adresse['stn']}; {adresse['plz']}; {adresse['ort']}""" - ) + progress_msg = f"""\ +{areg_response_key[0]} : {areg_response[areg_response_key[0]]} | betroffene \ +schule: [{item[0]}]\t{adresse['hnr']}; {adresse['stn']};{adresse['plz']}; \ +{adresse['ort']}""" + + print(progress_msg) my_db.closecursor() @@ -65,7 +65,9 @@ if __name__ == '__main__': # out.write(item) percentage = round((numfeatures * 100) / maxfeatures, 2) - print(f"""\nstatistics:\n {numfeatures} from {maxfeatures} geocoded >> - {percentage}%\n {missinfeatures} features with missing attributes\n - {errorfeatures} features with errors\n""") + statistics = f""" +statistics:\n {numfeatures} from {maxfeatures} geocoded >> \ +{percentage}%\n {missinfeatures} features with missing attributes\n \ +{errorfeatures} features with errors\n""" + print(statistics) print("geocoding dataset finished, closing programm")