def load_psql_env(pgpass_path):
    """
    Loads PSQL environment variables.

    Parameters
    ==========
    pgpass_path : str
        Local path to .pgass file.

    Returns
    =======
    env : dict
        host : str
        port : str
        dbname: str
        user: str
        password: str

    """

    with open(pgpass_path,'r') as f:
        psql_info = [line for line in f if 'cochrane' in line][0]

    host, port, dbname, user, password = psql_info.replace('\n','').split(':')

    env = {'host':host,'port':port,'dbname':dbname,'user':user,'password':password}

    return env