1- """Tasks for managing the stock data."""
2-
31import pandas as pd
42
53from lennart_epp .config import BLD , SRC
@@ -11,7 +9,18 @@ def task_download_apple_data(
119 script = SRC / "data_management" / "download_apple.py" ,
1210 produces = SRC / "data" / "apple_data.csv" ,
1311):
14- """Download AAPL stock data."""
12+ """Download and save historical Apple stock data.
13+
14+ Args:
15+ script (Path, optional): Path to the script handling the download.
16+ produces (Path, optional): Path where the downloaded CSV file is stored.
17+
18+ Returns:
19+ None
20+
21+ Raises:
22+ AssertionError: If the file was not successfully created.
23+ """
1524 download_apple_data ()
1625 assert produces .exists (), f"Failed to produce { produces } "
1726
@@ -21,7 +30,19 @@ def task_clean_apple_data(
2130 data = SRC / "data" / "apple_data.csv" ,
2231 produces = BLD / "data" / "cleaned_apple_data.pkl" ,
2332):
24- """Clean the stock data."""
33+ """Load, clean, and store Apple stock data.
34+
35+ Args:
36+ script (Path, optional): Path to the script handling data cleaning.
37+ data (Path, optional): Path to the raw stock data CSV file.
38+ produces (Path, optional): Path where the cleaned data is stored.
39+
40+ Returns:
41+ None
42+
43+ Raises:
44+ AssertionError: If the cleaned data file was not successfully created.
45+ """
2546 df = pd .read_csv (data , skiprows = 2 )
2647 df .columns = ["Date" , "Close" , "High" , "Low" , "Open" , "Volume" ]
2748 df = clean_apple_data (df )
0 commit comments