From 89be62109992e7646195bf37f4e598b254f9dd8e Mon Sep 17 00:00:00 2001 From: Griffiths Lott Date: Sun, 18 Dec 2022 18:49:11 +0100 Subject: [PATCH] Update 'Usage Guide' --- Usage-Guide.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Usage-Guide.md diff --git a/Usage-Guide.md b/Usage-Guide.md new file mode 100644 index 0000000..a9f7328 --- /dev/null +++ b/Usage-Guide.md @@ -0,0 +1,62 @@ +# Sample Basic Usage +Import the EIN service you plan to use and search for an EIN: +``` +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 +``` + +# Using with Excel/pandas +You can also process lists of EINs or entire sets of EINData Objects. There is also a function to convert a dataframe into a list of EINData for easy comparison with search results: +``` +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) +``` + +*Note: this library has built-in logging with debug, warning and error information. Include --logging-level=DEBUG to access this infromation.* \ No newline at end of file