Fixed as_series() method and simplified compare() logic

master
Griffiths Lott 3 years ago
parent 78a6599d82
commit bd79683d46
  1. 18
      EINService.py

@ -56,13 +56,14 @@ class EINData:
""" """
try: try:
compareDict = { compareDict = {
# Tenary operator used ot concisley assign values # Checks wether these two data points match
# If they match then true, else false # Thanks to the standardiztion provided by EINData's init
"buinessName" : True if self.buinessName == otherEIN.buinessName else False, # there should be few matching issues
"address" : True if self.address1 == otherEIN.address1 else False, "buinessName" : self.buinessName == otherEIN.buinessName,
"city": True if self.city == otherEIN.city else False, "address" : self.address1 == otherEIN.address1,
"state": True if self.state == otherEIN.state else False, "city": self.city == otherEIN.city,
"zip" : True if self.zip == otherEIN.zip else False "state": self.state == otherEIN.state,
"zip" :self.zip == otherEIN.zip
} }
except Exception as e: except Exception as e:
error(f"""Exception:\n{e}\nSelf:{self}\nOther: {otherEIN}\n""") error(f"""Exception:\n{e}\nSelf:{self}\nOther: {otherEIN}\n""")
@ -85,7 +86,7 @@ class EINData:
""" """
Converts object into a pandas Series Converts object into a pandas Series
""" """
return Series(self.to_dict()) return Series(self.as_dict())
@ -243,6 +244,7 @@ class EINTaxIDService(__EINService):
addressPieces = address.split(',') addressPieces = address.split(',')
address1 = addressPieces[0].strip() address1 = addressPieces[0].strip()
city = addressPieces[1].strip() city = addressPieces[1].strip()
# State and Zip are only seperated by a space not a ','
state = addressPieces[2].strip().split(" ")[0].strip() state = addressPieces[2].strip().split(" ")[0].strip()
zip = addressPieces[2].strip().split(" ")[1].strip() zip = addressPieces[2].strip().split(" ")[1].strip()
else: else:

Loading…
Cancel
Save