Skip to content

Instantly share code, notes, and snippets.

@blakesanie
Last active March 13, 2021 18:30
Show Gist options
  • Save blakesanie/c3ac2c37d063497f8fc726f89172e11c to your computer and use it in GitHub Desktop.
Save blakesanie/c3ac2c37d063497f8fc726f89172e11c to your computer and use it in GitHub Desktop.
import yfinance as yf
import sys
if len(sys.argv) != 2:
raise Exception("please provide ticker")
symbol = sys.argv[1].upper()
ticker = yf.Ticker(symbol)
hist = ticker.history(period="10y", interval="1d",
auto_adjust=True, threads=True)
hist.to_csv("./prices/{}.csv".format(symbol))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment