Last active
August 31, 2022 16:16
-
-
Save discdiver/3e18f4508ed658e16617164a83a3294f to your computer and use it in GitHub Desktop.
This file contains 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 characters
import pandas | |
import yfinance as yf | |
from datetime import timedelta | |
from prefect import flow, task | |
@task(retries=3, cache_expiration=timedelta(30)) | |
def fetch_data(ticker): | |
return yf.download(ticker) | |
@task | |
def save_data(stock_df): | |
stock_df.to_parquet() | |
@flow | |
def pipeline(ticker): | |
df = fetch_data(ticker) | |
save_data(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment