This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import shutil | |
import boto3 | |
import json | |
import os | |
def lambda_handler(event, context): | |
#Parameters ============================= | |
pipPackage = "requests" | |
packageVersion = "2.26.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Line Service ID | ServiceProviderID | Date of Service | PurchaserDOB | PurchaseAmount | Document | |
---|---|---|---|---|---|---|
20394822 | 1938472929 | 10/09/2021 | 7/4/1776 | $103.20 | AJ3fLN32jS1SK2 | |
20428284 | 1293018083 | 10/07/2021 | 12/30/1899 | $120.12 | J2sjldw3nSk4S2l | |
19428292 | 9420410832 | 10/08/2021 | 1/26/1980 | $84.23 | 2Pn28dh1lsdD0Q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OutputColumn | InputColumn | InputSource | MaxLength | ColumnPosition | DataType | Format | Active | Description | Required | |
---|---|---|---|---|---|---|---|---|---|---|
Date of Service | ServiceDate | Internal_Import_Format1 | 10 | 1 | Date | mm-dd-yyyy | Yes | Date of services rendered | Y | |
PurchaserDOB | ClientDOB | Internal_Import_Format1 | 10 | 2 | Date | mm-dd-yyyy | Yes | Client's date of birth | Y | |
ServiceProviderID | ProviderID | Internal_Import_Format1 | 10 | 3 | String | ########## | Yes | Service providers ID | Y | |
PurchaseAmount | PurchaseAmount | Internal_Import_Format1 | 20 | 4 | String | $dd.cc | Yes | Client's purchase | Y | |
Line Service ID | ServiceLineID | Internal_Table_Format1 | 8 | 5 | String | ######## | Yes | Service providers ID | Y | |
Document | DocumentID | Internal_Import_Format2 | 10 | 6 | String | NaN | Yes | DocumentID | N |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
airMap.findMappingView("Project A - Client Summary").viewMap() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Internal_Import_Format1 = pd.read_csv("Internal_Import_Format1.csv",dtype=str) | |
Internal_Import_Format2 = pd.read_csv("Internal_Import_Format2.csv",dtype=str) | |
Internal_Table_Format1 = pd.read_csv("Internal_Table_Format1.csv",dtype=str) | |
data = {'Internal_Import_Format1' : Internal_Import_Format1, | |
'Internal_Import_Format2' : Internal_Import_Format2, | |
'Internal_Table_Format1' : Internal_Table_Format1 } | |
airMap = airtableDataMapper(base_key,airAPI_key) | |
airMap.findMappingView("Project A - Client Summary").mapData(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import requests | |
import pickle | |
import base64 | |
import getpass | |
import boto3 | |
import json | |
def get_access_token(): | |
user_successful_login = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql_statement = """ | |
SELECT column_name, data_type | |
FROM information_schema.columns | |
WHERE table_name = 'ey_test_table' | |
; | |
""" | |
query_df = pgres.query(db='database_name', query=sql_statement) | |
query_df | |
#returns the results of an sql statement as a pandas dataframe. | |
#This example returns the column names and data types of table 'ey_test_table'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pgres.tables(db='database_name',schema='schema_name') | |
#returns the number of tables and all table names within the specified schema as a pandas dataframe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pgres.schemas(db='database_name') | |
#returns the number of schemas and all schema names within the specified database as a pandas dataframe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p_host = '0.0.0.0' | |
p_port = 5432 | |
db = 'database_name' | |
ssh = True | |
ssh_user = 'ssh_user' | |
ssh_host = 'ip address or web address' | |
ssh_pkey = '/path/to/user_authentication.pem' | |
pgres = Postgresql_connect(pgres_host=p_host, pgres_port=p_port, db=db, ssh=ssh, ssh_user=ssh_user, ssh_host=ssh_host, ssh_pkey=ssh_pkey) | |
#initiates a connection to the PostgreSQL database. In this instance we use ssh and must specify our ssh credentials. |
NewerOlder