parent
2b6c71598b
commit
1488442612
@ -0,0 +1,14 @@ |
||||
# Usage Guide Available |
||||
For information on how to set up and utilize this library please view: *https://git.glott.me/LEAF/EINService/wiki/Usage-Guide* |
||||
|
||||
# Information: |
||||
- Currently only EINTaxIDService is available. This uses https://eintaxid.com to fetch information about a company. |
||||
- The EINData object utilized by this library consists of the following data: EIN, Company Name, Address, City, State, Zip Code, Phone |
||||
|
||||
# Upcoming functionality |
||||
Future versions will hopefully provide the following capabilities: |
||||
- Option to use other EIN search services |
||||
- Automatically format EINData lists into dataframes |
||||
- Compare 'EINData dataframes' adding the compare dict as an extra column |
||||
|
||||
A GUI application is also planned for release, but will be located in a seperate repo |
||||
@ -0,0 +1,15 @@ |
||||
from EINService import EINTaxIDService |
||||
|
||||
# Instatiate an EINService object |
||||
# This is what will be used to do all of our searches |
||||
einService = EINTaxIDService() |
||||
|
||||
# Advanced Micro Devices Inc's EIN identifier: |
||||
# This is the ein we will be searching. |
||||
AMD_EIN = "94-1692300" |
||||
# The return will be an EINData object |
||||
# If the search was unsuccessful data members other than EIN will be None |
||||
searchResult = einService.search_ein(AMD_EIN) |
||||
|
||||
print(searchResult) |
||||
# EIN: 941692300 | Name: advanced micro devices inc | Address: 2485 augustine drive | City: santa clara | State: ca | Phone: 408 7494000 |
||||
@ -0,0 +1,36 @@ |
||||
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) |
||||
@ -1,31 +0,0 @@ |
||||
import EINService as es |
||||
import pandas as pd |
||||
|
||||
data = pd.read_excel("ExampleCSP.xlsx") |
||||
einService = es.EINTaxIDService() |
||||
|
||||
scores = [] |
||||
for _, deal in data.iterrows(): |
||||
try: |
||||
leafEIN = es.EINData( |
||||
str(deal["Lessee Tax-ID"]), |
||||
deal["NAME"], |
||||
deal["ADDRESS"], |
||||
deal["CITY"], |
||||
deal["STATE"], |
||||
str(deal["ZIP"]), |
||||
str(deal["PHONE"]), |
||||
) |
||||
except: |
||||
print(f"Failed to create EINData (LEAF): {deal['Lessee Tax-ID']}") |
||||
continue |
||||
|
||||
try: |
||||
external = einService.search_ein(leafEIN.get_ein()) |
||||
if external == None: continue |
||||
except: |
||||
print(f"Failed to create EINData (EXTERNAL): {deal['Lessee Tax-ID']}") |
||||
continue |
||||
scores.append(leafEIN.compare(external)) |
||||
|
||||
print(f"Scores:\n{scores}") |
||||
Loading…
Reference in new issue