<jupyter_start><jupyter_text>Load Data to Postgres SQL<jupyter_code>!pip install psycopg2
!pip install ipython-sql
%load_ext sql
%sql $conn_string
DB_ENDPOINT = "localhost"
DB = 'Companies_Funding_DB'
DB_USER = 'postgres'
DB_PASSWORD = '<PASSWORD>'
DB_PORT = '5432'

# postgresql://username:password@host:port/database
conn_string = "postgresql://{}:{}@{}:{}/{}" \
                        .format(DB_USER, DB_PASSWORD, DB_ENDPOINT, DB_PORT, DB)

print(conn_string)
rds_connection_string = "postgres:Ilovegoogle@88@localhost:5432/Companies_Funding_DB"

engine = create_engine(f'postgresql://{rds_connection_string}')
engine.table_names()
companies_df.to_sql(name='funding', con=engine, if_exists='append', index=False)
pd.read_sql_query('select * from funding', con=engine).head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1446229913473424, 'fraction_numerical': 0.013597033374536464, 'mean_word_length': 7.1, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '432695', 'license': 'MIT', 'n_tokens_mistral': 312, 'n_tokens_neox': 296, 'n_words': 46, 'path': 'Companies_Funding.ipynb', 'repo_name': 'AbdelGhania/ETL--Startups-Funding', 'size': '813'}