Move away from Python Interop for better stability

This commit is contained in:
2026-03-09 17:11:59 -07:00
parent 52c5062d6e
commit ac67be137c
8 changed files with 134 additions and 60 deletions
+4 -4
View File
@@ -15,7 +15,6 @@ def pull():
# Scrape the data
all_data = []
for i, symbol in enumerate(tickers):
print(f"Processing: {i} of {len(tickers)}")
df = yf.download(symbol, period="max", auto_adjust=True)
if not df.empty:
# Remove the ticker column
@@ -24,10 +23,11 @@ def pull():
all_data.append(df)
# Concatinate into a combined list and cache
print("Processing data")
final_df = pd.concat(all_data)
# Save to file
print("Writing data to file")
final_df.to_parquet(os.path.join(DATA_DIR, "stocks.parquet"))
final_df.head(200).to_csv(os.path.join(DATA_DIR, "stocks.preview.csv"))
final_df.head(200).to_csv(os.path.join(DATA_DIR, "stocks.preview.csv"))
if __name__ == "__main__":
pull()