imsciences 1.1.10__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- imsciences/__init__.py +1 -1
- imsciences/pull.py +7 -4
- {imsciences-1.1.10.dist-info → imsciences-1.2.0.dist-info}/METADATA +1 -1
- imsciences-1.2.0.dist-info/RECORD +13 -0
- {imsciences-1.1.10.dist-info → imsciences-1.2.0.dist-info}/WHEEL +1 -1
- imsciences/pull-IMS-24Ltp-3.py +0 -3132
- imsciences-1.1.10.dist-info/RECORD +0 -14
- {imsciences-1.1.10.dist-info → imsciences-1.2.0.dist-info}/PKG-INFO-IMS-24Ltp-3 +0 -0
- {imsciences-1.1.10.dist-info → imsciences-1.2.0.dist-info}/PKG-INFO-TomG-HP-290722 +0 -0
- {imsciences-1.1.10.dist-info → imsciences-1.2.0.dist-info}/licenses/LICENSE.txt +0 -0
- {imsciences-1.1.10.dist-info → imsciences-1.2.0.dist-info}/top_level.txt +0 -0
imsciences/__init__.py
CHANGED
imsciences/pull.py
CHANGED
|
@@ -1939,9 +1939,11 @@ class datapull:
|
|
|
1939
1939
|
We'll then do a weekly aggregator that yields avg_rain_sum, avg_snow_sum.
|
|
1940
1940
|
"""
|
|
1941
1941
|
weather_data_list = []
|
|
1942
|
-
geolocator = Nominatim(user_agent="
|
|
1942
|
+
geolocator = Nominatim(user_agent="imsciences_weather_data_puller/1.1 (contact:daniel.corral@im-sciences.com)")
|
|
1943
1943
|
|
|
1944
1944
|
for city in cities:
|
|
1945
|
+
# Add a small delay between requests to avoid rate limiting
|
|
1946
|
+
time.sleep(1)
|
|
1945
1947
|
loc = geolocator.geocode(city)
|
|
1946
1948
|
if not loc:
|
|
1947
1949
|
print(f"Could not find location for {city}, skipping.")
|
|
@@ -2627,7 +2629,7 @@ class datapull:
|
|
|
2627
2629
|
print("No data successfully fetched or processed.")
|
|
2628
2630
|
return pd.DataFrame()
|
|
2629
2631
|
|
|
2630
|
-
def pull_yfinance(self, tickers=None, week_start_day="mon"):
|
|
2632
|
+
def pull_yfinance(self, tickers=None, week_start_day="mon", start_date="2000-01-01"):
|
|
2631
2633
|
"""
|
|
2632
2634
|
Fetches stock data for multiple tickers from Yahoo Finance, converts it to daily frequency,
|
|
2633
2635
|
aggregates it to weekly averages, and renames variables.
|
|
@@ -2636,6 +2638,7 @@ class datapull:
|
|
|
2636
2638
|
----------
|
|
2637
2639
|
tickers (list): A list of additional stock tickers to fetch (e.g., ['AAPL', 'MSFT']). Defaults to None.
|
|
2638
2640
|
week_start_day (str): The day the week starts on (e.g., 'Monday', 'Sunday').
|
|
2641
|
+
start_date (str): The start date for fetching data in 'YYYY-MM-DD' format. Defaults to "2000-01-01".
|
|
2639
2642
|
|
|
2640
2643
|
Returns
|
|
2641
2644
|
-------
|
|
@@ -2670,8 +2673,8 @@ class datapull:
|
|
|
2670
2673
|
)
|
|
2671
2674
|
week_start = days_map[week_start_day]
|
|
2672
2675
|
|
|
2673
|
-
# Fetch data for all tickers
|
|
2674
|
-
data = yf.download(tickers, end=end_date, group_by="ticker", auto_adjust=True)
|
|
2676
|
+
# Fetch data for all tickers from the specified start date
|
|
2677
|
+
data = yf.download(tickers, start=start_date, end=end_date, group_by="ticker", auto_adjust=True)
|
|
2675
2678
|
|
|
2676
2679
|
# Process the data
|
|
2677
2680
|
combined_df = pd.DataFrame()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
imsciences/__init__.py,sha256=6YYK-2mrUHThI0M13GJ2wprc7-3Rc9UdshoZxWpIfQc,144
|
|
2
|
+
imsciences/geo.py,sha256=eLMuLUP8uUmz824qKSWaUR15ou-Kktt56QVxY8ZWIZw,16247
|
|
3
|
+
imsciences/mmm.py,sha256=nQ_XyBRBXkn43h8-4SiGVZmG1Z9Q2iQIIHToknqtX2A,87485
|
|
4
|
+
imsciences/oecd_pull.py,sha256=lzoFL8mulPvHmyubUd5R6sCUF3tRuQN6-6EXJpIS1Sc,15290
|
|
5
|
+
imsciences/pull.py,sha256=xVoRx9I7YQEPsEQKkTtUTfGVqKTYBPr4LTVsXwaBiug,122416
|
|
6
|
+
imsciences/vis.py,sha256=ybMrDU-OiXDY_FlTkZqmnMDoU044AZMuQefMwye2wj4,27684
|
|
7
|
+
imsciences-1.2.0.dist-info/licenses/LICENSE.txt,sha256=lVq2QwcExPX4Kl2DHeEkRrikuItcDB1Pr7yF7FQ8_z8,1108
|
|
8
|
+
imsciences-1.2.0.dist-info/METADATA,sha256=A-I-ntbPQDrGAIR8r8DSTKlaNpQtna9HKoWyYi-6c4w,19074
|
|
9
|
+
imsciences-1.2.0.dist-info/PKG-INFO-IMS-24Ltp-3,sha256=sCtHHqNZQIJopK03Mz3AJjBw-VY1gCgFQiFOmX0Wn4I,18872
|
|
10
|
+
imsciences-1.2.0.dist-info/PKG-INFO-TomG-HP-290722,sha256=RMcthCSyWmU6IBsXGL-nYqw0RP06pzjPKK3dzOQcU-8,18846
|
|
11
|
+
imsciences-1.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
imsciences-1.2.0.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
|
|
13
|
+
imsciences-1.2.0.dist-info/RECORD,,
|