GoekenDataScience 0.1.13__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.

Potentially problematic release.


This version of GoekenDataScience might be problematic. Click here for more details.

@@ -0,0 +1,3 @@
1
+ from .goekendatascience import TickerDataFetch, DataManipulation
2
+
3
+ __all__ = ["TickerDataFetch", "DataManipulation"]
@@ -0,0 +1,72 @@
1
+ import os
2
+ import pandas as pd
3
+ import requests
4
+ import datetime
5
+ from datetime import date
6
+
7
+ class TickerDataFetch:
8
+
9
+ def __init__(self):
10
+ self.todays_date = str(date.today())
11
+ self.script_dir = os.path.dirname(os.path.abspath(__file__))
12
+ self.output_folder = os.path.join(self.script_dir, "Historical Data")
13
+
14
+ def folder_scan(self):
15
+ os.makedirs(self.output_folder, exist_ok=True)
16
+ self.List = os.listdir(self.output_folder)
17
+ self.namelist = {}
18
+ for item in self.List:
19
+ ticker_name = item.split('.')[0].split()[0]
20
+ ticker_date = item.split('.')[0].split()[1]
21
+ self.namelist[ticker_name] = ticker_date
22
+
23
+ def fetch_historical_data(self, ticker, AV_key):
24
+ url = f'https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol={ticker}&outputsize=full&apikey={AV_key}'
25
+ r = requests.get(url)
26
+ data = r.json()
27
+ try:
28
+ historical_data = pd.DataFrame(data[list(data.keys())[1]]).transpose()
29
+ except:
30
+ print("Invalid ticker or Alpha Vantage Key")
31
+ historical_data.columns = ['O', 'H', 'L', 'C', 'V']
32
+ os.makedirs(self.output_folder, exist_ok=True)
33
+ csv_path = os.path.join(self.output_folder, f"{ticker} {self.todays_date}.csv")
34
+ historical_data.to_csv(csv_path, index=True)
35
+ print(f"Saved CSV to: {csv_path}")
36
+
37
+ def update_tickers (self,tickers,AV_key):
38
+ self.folder_scan()
39
+ for ticker in tickers:
40
+ if ticker in self.namelist:
41
+ if self.namelist[ticker] == self.todays_date:
42
+ print(ticker,"data found for",self.todays_date)
43
+ else:
44
+ os.remove(os.path.join(self.output_folder, f"{ticker} {self.namelist[ticker]}.csv"))
45
+ self.fetch_historical_data(ticker,AV_key)
46
+ print(ticker,"data found for",self.namelist[ticker],". Updating data for",self.todays_date)
47
+ else:
48
+ self.fetch_historical_data(ticker,AV_key)
49
+ print(ticker,"data not found",{ticker},". Updating data for",self.todays_date)
50
+ for ticker in self.namelist:
51
+ if ticker in tickers:
52
+ pass
53
+ else:
54
+ os.remove(os.path.join(self.output_folder, f"{ticker} {self.namelist[ticker]}.csv"))
55
+ print("Removed",ticker,".")
56
+ self.folder_scan()
57
+
58
+ def import_tickers(self):
59
+ ticker_data = {}
60
+ self.folder_scan()
61
+ for ticker in self.namelist:
62
+ data = pd.read_csv(os.path.join(self.output_folder, f"{ticker} {self.namelist[ticker]}.csv"))
63
+ print(data.columns[0])
64
+ ticker_data[ticker] = data
65
+ return ticker_data
66
+
67
+ class DataManipulation:
68
+ def __init__(self):
69
+ pass
70
+
71
+ def shift_cells(self):
72
+ pass
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: GoekenDataScience
3
+ Version: 0.1.13
4
+ Summary: Python package for Goeken Data Science
5
+ Author-email: Ryan Goeken <your@email.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/yourusername/GoekenStats
8
+ Requires-Python: >=3.7
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE.txt
11
+ Requires-Dist: pandas>=2.0
12
+ Requires-Dist: numpy<2.0,>=1.26
13
+ Requires-Dist: requests>=2.32
14
+ Dynamic: license-file
15
+
16
+ # TickerDataFetcher
17
+
18
+ A simple Python package for fetching and updating historical stock data from Alpha Vantage.
19
+
20
+ ## Installation
21
+ ```bash
22
+ pip install GoekenDataScience
@@ -0,0 +1,7 @@
1
+ goekendatascience/__init__.py,sha256=j_tBPRvfa1A9Sm1ks-ukFR9pYkW5Tmk02ct6SiCqfe4,117
2
+ goekendatascience/goekendatascience.py,sha256=GGGHfkKF0UR5R8AIfg99I1kehKE9zhgOzx-zbbC0dFQ,2920
3
+ goekendatascience-0.1.13.dist-info/licenses/LICENSE.txt,sha256=_1SdDE0mGZEIDtOGHP7Kgo-Bf9c27L5rQUwvU4mscCY,1089
4
+ goekendatascience-0.1.13.dist-info/METADATA,sha256=f2cdSnS4Om4X6IfpaWabZQEGv85sIcyjBSvVFp93LN4,624
5
+ goekendatascience-0.1.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ goekendatascience-0.1.13.dist-info/top_level.txt,sha256=F-jZq2o9_m8Tk-sCJsB6PC6sMyNYAy1m-UduxikdyhU,18
7
+ goekendatascience-0.1.13.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ryan Goeken
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ goekendatascience