ADD drop table at start
This commit is contained in:
parent
f435f32bba
commit
301e80afa7
124
afu/.post_code
124
afu/.post_code
@ -1,27 +1,121 @@
|
||||
2221 Groß Schweinbarth|Matzner Straße 31#Groß-Schweinbarth#Matznerstraße 31
|
||||
2000 Stockerau|Grillparzerstraße#Stockerau#Grillparzergasse
|
||||
2000 Stockerau|Grillparzergasse
|
||||
2136 Laa/Thaya|Teichgasse#Laa an der Thaya
|
||||
2221 Groß Schweinbarth|Matzner Straße#Groß-Schweinbarth#Matznerstraße
|
||||
2345 Brunn/Gebirge#Brunn am Gebirge
|
||||
2431 Kleinneusiedl
|
||||
2560 Berndorf
|
||||
3813 Dietmanns
|
||||
3871 Nagelberg|Alt-Nagelberg#Alt-Nagelberg
|
||||
4020 Linz|Humboldtstraße
|
||||
4871 Pfaffing|Tiefenbach 6
|
||||
4871 Pfaffing|Tiefenbach
|
||||
## https://www.statistik.at/verzeichnis/strassenliste/gemplzstr_5.pdf
|
||||
## https://www.statistik.at/verzeichnis/strassenliste/gemplzstr_5.xls
|
||||
5020 Salzburg|Alexander Girardistraße#Salzburg#Alexander-Girardi-Straße
|
||||
5020 Salzburg|Alpenstraße 83
|
||||
5020 Salzburg|Berchtesgadnerstraße#Salzburg#Berchtesgadner Straße
|
||||
5020 Salzburg|Bergstraße
|
||||
5020 Salzburg|Bruendlweg#Salzburg#Bründlweg
|
||||
5020 Salzburg|Duerlingerstraße#Salzburg#Dürlingerstraße
|
||||
5020 Salzburg|Elisabethstraße
|
||||
5020 Salzburg|Erich-Fried-Straße
|
||||
5020 Salzburg|Erlenstraße
|
||||
5020 Salzburg|Goethestraße
|
||||
5020 Salzburg|Haunspergstraße
|
||||
5020 Salzburg|Innsbrucker Bundesstraße
|
||||
5020 Salzburg|Julius-Haagn-Straße
|
||||
5020 Salzburg|Kaiserschützenstraße
|
||||
5020 Salzburg|Kendlerstaße#Salzburg#Kendlerstraße
|
||||
5020 Salzburg|Kuno-Brandauer-Straße
|
||||
5020 Salzburg|Landsturmstraße
|
||||
5020 Salzburg|Linzer Bundesstraße 11
|
||||
5020 Salzburg|Moosstraße 86B
|
||||
5020 Salzburg|Neutorstraße
|
||||
5020 Salzburg|Peter-Pfenninger-Straße
|
||||
5020 Salzburg|Pfeifferhofstraße
|
||||
5020 Salzburg|Prinzingerstraße#Salzburg#Prinzingerstraße
|
||||
5020 Salzburg|Roseggerstraße
|
||||
5020 Salzburg|Scherzhauserfeldstraße 36
|
||||
5020 Salzburg|Scherzhauserfeldstr#Salzburg#Scherzhauserfeldstraße 36
|
||||
5020 Salzburg|Schieszstattstraße#Salzburg#Schießstattstraße
|
||||
5020 Salzburg|Schumacherstraße
|
||||
5020 Salzburg|Sigmund-Haffner-Gasse
|
||||
5020 Salzburg|Strubergasse
|
||||
5020 Salzburg|Tenglinggasse
|
||||
5020 Salzburg|Tiefenbachhofstraße
|
||||
5020 Salzburg.|Pillweinstraße#Salzburg
|
||||
5023 Salzburg|Langmoosweg 5
|
||||
5023 Salzburg|Parscherstraße#Salzburg#Parscher Straße
|
||||
5026 Salzburg-Aigen|Glaserstraße#Salzburg
|
||||
5026 Salzburg|Ziegelstadelstraße
|
||||
5026 Salzburg|Habeggutstraße#Salzburg#Habeggut-Straße
|
||||
5061 Elsbethen
|
||||
5071 Wals B.Salzbg.#Wals bei Salzburg
|
||||
5071 Wals Bei Salzburg|Walser Straße#Wals bei Salzburg#Walserstraße
|
||||
5082 Groedig#Grödig
|
||||
5101 Bergheim
|
||||
5300 Hallwang|Bäckerweg 7
|
||||
5582 St.Michael Lun|Nr.94#Sankt Michael im Lungau#Markt 94
|
||||
6393 St Ulrich|Dorfstr 13#St. Ulrich am Pillersee#Dorfstraße 13%JN67gm86ut
|
||||
5110 Oberndorf Sbg.|#Oberndorf bei Salzburg
|
||||
5201 Seekirchen|Moedlham#Seekirchen am Wallersee#Mödlham
|
||||
5201 Seekirchen#Seekirchen am Wallersee
|
||||
5202 Neumarkt A W|Sighartsteinerstraße#Neumarkt am Wallersee#Sighartsteiner Straße
|
||||
5203 Koestendorf#Köstendorf
|
||||
5300 Hallwang|Bäckerweg#Esch
|
||||
5300 Hallwang|Bergstraße
|
||||
5300 Salzburg|Hallwang Zilling 101#Hallwang#Zilling 101
|
||||
5300 Hallwang|Zweigstraße#Esch
|
||||
5300 Bergheim B.Sbg.|Bogenstraße#Esch
|
||||
5302 Henndorf|Peterhauerweg#Henndorf am Wallersee#Peterbauerweg
|
||||
5302 Henndorf#Henndorf am Wallersee
|
||||
5321 Koppl|Lerchenweg#Habach
|
||||
5340 St.Gilgen|Winkl#Winkl#Winkl
|
||||
5400 Hallein/Rief|Ahornweg#Taxach
|
||||
5541 Altenmarkt/Pg#Altenmarkt im Pongau
|
||||
5570 Mauterndorf|Hnr.31#Mauterndorf#Markt 31 (Hubertusheim)
|
||||
5570 Mauterndorf
|
||||
5582 St.Michael Lun|Nr.94#Sankt Michael im Lungau#Marktstraße 94
|
||||
5582 St.Martin|Hnr.142#Sankt Martin im Lungau#Gerlgasse 144
|
||||
5582 St.Michael/Lg.|Wieden 244#Sankt Michael im Lungau#St. Egidiweg 244
|
||||
5582 St.Michael Im Lungau#Sankt Michael im Lungau
|
||||
5600 St.Johann/Pong#St. Johann im Pongau
|
||||
5621 St.Veit/Pongau#St. Veit im Pongau
|
||||
5640 Badgastein|Goethehof#Bad Gastein
|
||||
5640 Badgastein|Koetschachtal#Bad Gastein#Kötschachtal
|
||||
5661 Hoher Sonnblick|Rauris#Rauris#Hoher Sonnblick
|
||||
5661 Rauris, Observatoriu|Hoher Sonnblick#Rauris#Hoher Sonnblick, Observatorium
|
||||
5753 Saalbach
|
||||
5760 Saalfelden#Saalfelden am Steinernen Meer
|
||||
5760 Saalfelden S.M#Saalfelden am Steinernen Meer
|
||||
6393 St Ulrich|Dorfstr#St. Ulrich am Pillersee
|
||||
6751 Braz#Braz bei Bludenz
|
||||
6767 Warth
|
||||
6800 Feldkirch-Altenstadt
|
||||
6800 Feldkirch-Gisingen|Schufla#Feldkirch-Gisingen#Schufla
|
||||
6800 Feldkirch-Tosters|Hubstraße#Feldkirch-Tosters
|
||||
6833 Klaus
|
||||
6835 Sulz-Röthis|Bündt 19, Muntlix#Muntlix#Bündt 19
|
||||
6840 Götzis|Major Ellensohn Straße#Götzis#Major-Ellensohn-Straße
|
||||
6840 Goetzis|Schloesslweg#Götzis#Schlößleweg
|
||||
6840 Goetzis|Sonderberg#Götzis
|
||||
6971 Hard,Vorarlbg.|Muehlestraße#Hard#Mühlestraße
|
||||
7323 Ritzing
|
||||
8051 Graz|Wienerstrasse 256/41
|
||||
8054 Graz|Dr.Lemisch-Strasse 19#Graz#Doktor-Lemisch-Straße 19
|
||||
8430 Leibnitz|Kittenberg 7
|
||||
8438 Mayrhofen|Hochsteeg 589#Mayrhofen#Hochsteg 589
|
||||
8054 Graz|Dr.Lemisch-Straße#Graz#Doktor-Lemisch-Straße
|
||||
8430 Leibnitz|Kittenberg
|
||||
8438 Mayrhofen|Hochsteeg#Mayrhofen#Hochsteg
|
||||
8453 St.Johann I.S.#Sankt Johann im Saggautal
|
||||
8561 Söding|Steinstraße 10
|
||||
8682 Muerzzuschlag|Gutenbrunngasse 7#Mürzzuschlag
|
||||
8682 Muerzzuschlag|Gutenbrunngasse 10#Mürzzuschlag
|
||||
8682 Muerzzuschlag|Gutenbrunngasse 56#Mürzzuschlag
|
||||
8561 Söding|Steinstraße
|
||||
8682 Muerzzuschlag|Gutenbrunngasse#Mürzzuschlag
|
||||
8972 Ramsau Am Dachstein#Ramsau am Dachstein
|
||||
9020 Klagenfurt|Feldhofg 75#Klagenfurt#Feldhofgasse 75
|
||||
9500 Villach|Kiesweg 4/2
|
||||
9580 Drobollach#Drobollach#Raimund-Kalcher-Straße 4
|
||||
9020 Klagenfurt|12.Novemberstraße#Klagenfurt#12.-November-Straße
|
||||
9020 Klagenfurt|Feldhofg#Klagenfurt#Feldhofgasse
|
||||
9100 Völkermarkt|Nibelungenstraße#Völkermarkt#Nibelungenstraße
|
||||
9322 Micheldorf/Ktn|Ringstraße#Micheldorf
|
||||
9500 Villach|Brandenburgweg 14
|
||||
9500 Villach|Ernst Pliwa-Gasse#Villach#Ernst-Pliwa-Gasse
|
||||
9500 Villach|Kiesweg
|
||||
9500 Villach|Teichweg
|
||||
9500 Villach|Widmanng#Villach#Widmanngasse
|
||||
9580 Drobollach|Kalcherstraße#Drobollach#Raimund-Kalcher-Straße
|
||||
9800 Spittal/Drau|Baldersdorf#Spittal an der Drau
|
||||
9800 Spittal/Drau#Spittal an der Drau
|
||||
83457 Bayerisch Gmain
|
@ -1,5 +1,8 @@
|
||||
-- Initialize the tables for the callbook program
|
||||
|
||||
DROP TABLE IF EXISTS `callbook_user`;
|
||||
DROP TABLE IF EXISTS `callbook_address`;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `callbook_user`(
|
||||
`id` SERIAL,
|
||||
`user_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
|
@ -338,7 +338,8 @@ def isinteger(s):
|
||||
def call_change_city(location, address, verbose):
|
||||
post_file = '.post_code'
|
||||
path = get_active_path(post_file)
|
||||
if os.path.exists(path) and not call_change_city.lines:
|
||||
if not call_change_city.lines:
|
||||
if os.path.exists(path):
|
||||
try:
|
||||
with open(path, 'r') as file:
|
||||
call_change_city.lines = file.readlines()
|
||||
@ -357,33 +358,46 @@ def call_change_city(location, address, verbose):
|
||||
|
||||
postal_code = 0
|
||||
city = location
|
||||
street = address
|
||||
addr = corr_street(address)
|
||||
street = addr
|
||||
|
||||
for line in call_change_city.lines:
|
||||
line = line.rstrip() # remove the \n
|
||||
locpart = line.split(' ',1)
|
||||
if len(locpart) < 2:
|
||||
continue
|
||||
citypart = locpart[1].split('|',1)
|
||||
exchange = locpart[1].split('#')
|
||||
citypart = exchange[0].split('|',1)
|
||||
if (citypart[0] != location): # A hit? Else...
|
||||
continue
|
||||
postal_code = locpart[0]
|
||||
city = citypart[0]
|
||||
print(f'PLZ: {postal_code}, City: {city}')
|
||||
if len(citypart) > 0:
|
||||
street = citypart[1].rstrip()
|
||||
exchange = citypart[1].split('#')
|
||||
#city = exchange[0]
|
||||
if exchange[0].rstrip() != address:
|
||||
if len(citypart) > 1:
|
||||
# addr = address[0:len(citypart[1])]
|
||||
if (citypart[1] != addr[0:len(citypart[1])]):
|
||||
continue
|
||||
postal_code = locpart[0]
|
||||
if len(exchange) > 1:
|
||||
city = exchange[1].rstrip()
|
||||
if len(exchange) > 2:
|
||||
street = exchange[2].rstrip()
|
||||
city = exchange[1]
|
||||
if len(exchange) > 2 and len(citypart) > 1:
|
||||
street = addr.replace(citypart[1],exchange[2])
|
||||
# print(f'PLZ: {postal_code}, City: {city}')
|
||||
break
|
||||
print(f'postal_code: {postal_code}, city: {city}, street: {street}')
|
||||
if verbose > 0:
|
||||
if postal_code != 0:
|
||||
if address == addr:
|
||||
print(f'location/address: {location}|{addr} => {postal_code} {city}|{street}')
|
||||
else:
|
||||
print(f'location/address: {location}|({address}){addr} => {postal_code} {city}|{street}')
|
||||
else:
|
||||
call_change_city.cnt += 1
|
||||
if address == addr:
|
||||
print(f'[{call_change_city.cnt}] loc/addr: {location}|{addr} => {postal_code} {city}|{street}')
|
||||
else:
|
||||
print(f'[{call_change_city.cnt}] loc/addr: {location}|({address}){addr} => {postal_code} {city}|{street}')
|
||||
|
||||
return postal_code, city, street
|
||||
|
||||
call_change_city.lines = None
|
||||
call_change_city.cnt = 0
|
||||
|
||||
def corr_street(street):
|
||||
street = street.replace('strasse','straße')
|
||||
@ -391,7 +405,6 @@ def corr_street(street):
|
||||
street = street.replace('str ','straße ')
|
||||
street = street.replace('Str ','Straße ') # Brünner Str 221/4/5
|
||||
street = street.replace('str.','straße')
|
||||
street = street.replace('Str.','Straße') # Brünner Str. 106/43
|
||||
street = street.replace('Stg. ','Stiege ')
|
||||
street = street.replace('g. ','gasse ')
|
||||
street = street.replace('-G ','-Gasse ')
|
||||
@ -400,6 +413,8 @@ def corr_street(street):
|
||||
# Special, stupid fixes
|
||||
street = street.replace('Str.1','Straße 1') # Peter-Berner-Str.10/1/10
|
||||
street = street.replace('Str.5','Straße 5') # Wagramer Str.59/14/2
|
||||
street = street.replace('Str.6','Straße 6')
|
||||
street = street.replace('Str.','Straße') # Brünner Str. 106/43
|
||||
street = street.replace('Str7','Straße 7') # Hetzendorfer Str79/2/14
|
||||
street = street.replace('Str8','Straße 8') # Theodor-Kramer-Str8/274
|
||||
street = street.replace('Markhofg.13-15/','Markhofgasse 13-15/5/14') # Mautner-Markhofg.13-15/ (OE1JJB)
|
||||
@ -426,42 +441,59 @@ def corr_street(street):
|
||||
street = street.replace('Langsulzg ','Langsulzgasse ')
|
||||
street = street.replace('Lavantg ','Lavantgasse')
|
||||
street = street.replace('Leiteng ','Leitengasse ')
|
||||
street = street.replace('Mommseng','Mommsengasse')
|
||||
street = street.replace('Othellog ','Othellogasse ')
|
||||
street = street.replace('Pehamg ','Pehamgasse ')
|
||||
street = street.replace('Pfeilg ','Pfeilgasse ')
|
||||
street = street.replace('Pfenniggeldg ','Pfenniggeldgasse ')
|
||||
street = street.replace('Pohlg ','Pohlgasse ')
|
||||
street = street.replace('Rötzerg ','Rötzergasse ')
|
||||
street = street.replace('Ruzickag ','Ruzickagasse ')
|
||||
street = street.replace('Schützpl ','Schützplatz ')
|
||||
street = street.replace('Schiffmühlenst ','Schiffmühlenstraße ')
|
||||
street = street.replace('Schirrmanng ','Schirrmanngasse ')
|
||||
street = street.replace('Sigmund-Haffnerg ','Sigmund-Haffner-Gasse ')
|
||||
street = street.replace('Sillerg ','Sillergasse ')
|
||||
street = street.replace('Zanaschkag ','Zanaschkagasse ')
|
||||
street = street.replace('aße1','aße 1')
|
||||
street = street.replace('aße2','aße 2') #Ziegelhofstrasse29/16
|
||||
street = street.replace('aße3','aße 3')
|
||||
street = street.replace('aße5','aße 5') #Josefstädterstraße56/2
|
||||
street = street.replace('aße6','aße 6')
|
||||
street = street.replace(' (Klg Am Am', ' (Klg Am Ameisbach)')
|
||||
# Typos
|
||||
street = street.replace('A Baumgartnerstraße ','Anton-Baumgartner-Straße ')
|
||||
street = street.replace('A. Baumgartnerstraße ','Anton-Baumgartner-Straße ')
|
||||
street = street.replace('Achtungvierzigerplatz ','Achtundvierzigerplatz ')
|
||||
street = street.replace('Arsenal Objet ','Arsenal Objekt ')
|
||||
street = street.replace('Brigitt.-L148-154/12/17','Brigittenauer Lände 148-154/12/17')
|
||||
street = street.replace('Schliessmanngasse ','Schließmanngasse ')
|
||||
street = street.replace('Sturbergasse','Strubergasse') # Sturbergasse 60, Salzburg
|
||||
street = street.replace('Hernalser Hptstraße2','Hernalser Hauptstraße 2') # Hernalser Hptstr.230/14
|
||||
# Spelling
|
||||
street = street.replace('Alser-Straße','Alser Straße')
|
||||
street = street.replace('Andreas Urteil Weg','Andreas-Urteil-Weg')
|
||||
street = street.replace('Atzgersdorferstraße','Atzgersdorfer Straße')
|
||||
street = street.replace('Breitenleerstraße','Breitenleer Straße')
|
||||
street = street.replace('Dr.-Eugen Zehme Straße','Dr. Eugen Zehme Straße') # 5111 Bürmoos
|
||||
street = street.replace('Erich Friedstraße','Erich-Fried-Straße')
|
||||
street = street.replace('Ernst Mach Straße','Ernst-Mach-Straße')
|
||||
street = street.replace('F-Asenbauer-Gasse','Franz-Asenbauer-Gasse')
|
||||
street = street.replace('Friedr.Kaiser-Gasse','Friedrich-Kaiser-Gasse')
|
||||
street = street.replace('Friedrich Schmidt Platz','Friedrich-Schmidt-Platz')
|
||||
street = street.replace('Heiligenstaedter Straße','Heiligenstädter Straße')
|
||||
street = street.replace('Herzmanovsky Orlandogasse','Herzmanovsky-Orlando-Gasse')
|
||||
street = street.replace('J.Haagnstraße','Julius-Haagn-Straße')
|
||||
street = street.replace('Kaiserebersdorferstraße','Kaiserebersdorfer Straße')
|
||||
street = street.replace('Kaiserschuetzenstraße','Kaiserschützenstraße')
|
||||
street = street.replace('K.Billerhartstraße','Karl-Billerhart-Straße')
|
||||
street = street.replace('Kuno-Brandauerstraße','Kuno-Brandauer-Straße')
|
||||
street = street.replace('Laaer Berg Straße','Laaer-Berg-Straße')
|
||||
street = street.replace('Langenzersdorferstraße','Langenzersdorfer Straße')
|
||||
street = street.replace('Nußdorferstraße','Nußdorfer Straße')
|
||||
street = street.replace('Ottakringerstraße','Ottakringer Straße')
|
||||
street = street.replace('Peter Altenberg-Gasse','Peter-Altenberg-Gasse')
|
||||
street = street.replace('Peter Pfenningerstraße','Peter-Pfenninger-Straße')
|
||||
street = street.replace('Schuettelstraße','Schüttelstraße')
|
||||
street = street.replace('Tuerkenstraße','Türkenstraße')
|
||||
street = street.replace('Vösendorferstraße','Vösendorfer Straße')
|
||||
@ -476,11 +508,12 @@ def call_postal_code(location, address, verbose):
|
||||
if isinteger(p[0]) and int(p[0]) > 1000 and int(p[0]) < 10000:
|
||||
postal_code = p[0]
|
||||
city = p[1]
|
||||
street = address
|
||||
street = corr_street(address)
|
||||
|
||||
else:
|
||||
postal_code, city, street = call_change_city(location, address, verbose)
|
||||
|
||||
street = corr_street(street)
|
||||
# street = corr_street(street)
|
||||
# add city and street to the database
|
||||
return postal_code, city, street
|
||||
|
||||
|
5
afu/todo.md
Normal file
5
afu/todo.md
Normal file
@ -0,0 +1,5 @@
|
||||
# This is a list of TODOs for the callbook script
|
||||
# 2024-07-01
|
||||
OE2OL Ing. Johann Hörl, mit der Adresse Hallwang, Zilling 101, unbekannter Adresse, vermutlich frühere Wohnadresse mit Haus Nr. 101
|
||||
OE2PHO, DI Peter Hauber ist mit einer deutschen Adresse eingetragen: Bayerisch Gmain, Großgmainer Straße 5C -> Postleitzahl: D-83457
|
||||
OE2WAP Waldauf Alexander Salzburg Scherzhauserfeldstr, vermutlich die Nr. 36 (OE2YMO Waldauf Maria)
|
Loading…
Reference in New Issue
Block a user