text_plain_output_1.png
import pandas as pd

db = 'new_db'
user = 'postgres'
passwd = '1234'
port = 5432
host = 'ec2-44-201-58-213.compute-1.amazonaws.com'
credentials = 'postgresql://{}:{}@{}:{}/{}'.format(user, passwd, host, port, db)
credentials

def schemaGen(dataframe, schemaName):
    localSchema = pd.io.sql.get_schema(dataframe, schemaName)
    localSchema = localSchema.replace('TEXT', 'VARCHAR(255)').replace('INTEGER', 'NUMERIC').replace('\n', '').replace('"', '')
    return ''.join(localSchema)

def getSchema(tableName, credentials):
    schema = pd.read_sql("SELECT * FROM information_schema.columns where table_name='{}'".format(tableName), con=credentials)
    return schema

def queryCreate(query):
    try:
        requiredTable = pd.read_sql(query, con=credentials)
    except Exception as e:

def queryBase(query):
    requiredTable = pd.read_sql(query, con=credentials)
    return requiredTable

table_list = "select *\nfrom information_schema.tables\nwhere table_schema = 'public'\n"
queryBase(table_list)