You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
EINService/example_from_excel.py

36 lines
1.1 KiB

from EINService import EINTaxIDService, dataframe_to_eins
import pandas as pd
# Instatiate an EINService object
# This is what will be used to do all of our searches
einService = EINTaxIDService()
# Here we pull in the data from excel
einData = pd.read_excel("SampleData.xlsx")
# Extract the eins column as a list of strings
einList = einData["Lessee Tax-ID"].to_list()
# The service will return a list EINData objects
# if no match what found all data members besides ein will be None
searchResults = einService.search_eins(einList)
print(searchResults)
# Can also convert a dataframe into a list of EINData
# The requires that our dataframe has all of the nessary columns.
# The defaults for these columns are:
# "Lessee Tax-ID",
# "NAME",
# "ADDRESS"
# "CITY"
# "STATE"
# "ZIP"
# "PHONE"
#
# You can also specify your own column names as paramaters.
einDataList = dataframe_to_eins(einData)
print(einData)
# This allows us to compare our search results to our 'local data'
for i, localData in enumerate(einDataList):
comparisonDict = localData.compare(searchResults[i])
print(comparisonDict)