Created
January 16, 2024 17:45
Revisions
-
xescuder created this gist
Jan 16, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ import os from pathlib import Path from sqlalchemy import create_engine import pandas as pd from trading_data_pipeline.config import AppConfig config = AppConfig(os.environ) connection_url = config.get_postgres_uri() db = create_engine(connection_url) conn = db.connect() csv_path = os.path.join(str(Path(__file__).parent.parent), 'resources', 'sectors_etfs.csv') data = pd.read_csv(csv_path) data['type'] = 'SECTOR_ETF' data.to_sql('instruments', conn, if_exists='append', index=False)