Skip to content

Commit c8e7fae

Browse files
Merge pull request #17 from Visionary-Code-Works/dev
Dev
2 parents d020a12 + 5082cfe commit c8e7fae

File tree

6 files changed

+36
-28
lines changed

6 files changed

+36
-28
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,4 @@ $RECYCLE.BIN/
224224
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
225225

226226
.vscode/
227+
archive/

docs/documentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
[![Upload Python Package](https://github.com/Visionary-Code-Works/stock-analysis-program/actions/workflows/python_publish.yml/badge.svg)](https://github.com/Visionary-Code-Works/stock-analysis-program/actions/workflows/python_publish.yml)
44

55
- [Home](../README.md)
6-
- [Workflow](./Workflow.md)
7-
- [Plotter](./Plotter.md)
86
- [Fetcher](./Fetcher.md)
7+
- [Plotter](./Plotter.md)
8+
- [Workflow](./Workflow.md)
99

1010
## Overview
1111

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
plotting capabilities for stocks and financial indices.
1010
"""
1111

12-
from .__init__ import (
12+
from src.stock_analysis_program import (
1313
StockDataFetcher,
1414
StockSummaryFetcher,
1515
FinancialMetricsFetcher,
@@ -219,18 +219,20 @@ def main():
219219
visualization. The script runs in a loop until the user chooses to exit.
220220
"""
221221
while True:
222-
print("\nStock Data Analysis Menu")
223-
print("1. Use Stock Data Fetcher")
224-
print("2. Use Stock Summary Fetcher")
225-
print("3. Use Financial Metrics Fetcher")
226-
print("4. Use Revenue Growth Fetcher")
227-
print("5. Use Stock Price Plotter")
228-
print("6. Use Financial Metrics Plotter")
229-
print("7. Use Revenue Growth Plotter")
230-
print("8. Use Stock Volatility Plotter")
231-
print("9. Use Stock Exchange Performance Plotter")
232-
print("10. Use Current Prices Ticker Display")
233-
print("0. Exit")
222+
print(
223+
"\nStock Data Analysis Menu\n",
224+
"1. Use Stock Data Fetcher\n",
225+
"2. Use Stock Summary Fetcher\n",
226+
"3. Use Financial Metrics Fetcher\n",
227+
"4. Use Revenue Growth Fetcher\n",
228+
"5. Use Stock Price Plotter\n",
229+
"6. Use Financial Metrics Plotter\n",
230+
"7. Use Revenue Growth Plotter\n",
231+
"8. Use Stock Volatility Plotter\n",
232+
"9. Use Stock Exchange Performance Plotter\n",
233+
"10. Use Current Prices Ticker Display\n",
234+
"0. Exit\n"
235+
)
234236

235237
choice = input("Enter your choice: ")
236238

src/__init__.py

Whitespace-only changes.

src/data/finance_apis.csv

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
API Name,Website,Unique Feature,Pricing
2-
Alpha Vantage,https://www.alphavantage.co,Wide range of data services; technical indicators,Free/Paid
3-
IEX Cloud,https://iexcloud.io,Wide array of financial data; tiered pricing model with a free tier,Free/Paid
4-
Quandl,https://www.quandl.com,"Financial, economic, and alternative data; free datasets available for academic use",Free/Paid
5-
Financial Modeling Prep,https://financialmodelingprep.com,Broad set of financial data APIs; includes stock market data and financial statements,Free/Paid
6-
World Trading Data,https://www.worldtradingdata.com,Real-time and historical stock data; free tier available,Free/Paid
7-
MarketStack,https://marketstack.com,REST API interface to obtain stock market data from around the world; free tier with limited access,Free/Paid
8-
Finnhub,https://finnhub.io,"Free APIs for stock data, forex, and crypto; both real-time and historical data",Free/Paid
9-
Twelve Data,https://twelvedata.com,"Financial data including real-time and historical stock data, forex, and cryptocurrencies; free plan with limited access",Free/Paid
1+
API Name, Website, Unique Feature, Pricing
2+
Alpha Vantage, https://www.alphavantage.co, Wide range of data services; technical indicators, Free/Paid
3+
Financial Modeling Prep, https://financialmodelingprep.com, Broad set of financial data APIs; includes stock market data and financial statements, Free
4+
Finnhub, https://finnhub.io, "Free APIs for stock data, forex, and crypto; both real-time and historical data", Free/Paid
5+
IEX Cloud, https://iexcloud.io, Wide array of financial data; tiered pricing model with a free tier, Free/Paid
6+
MarketStack, https://marketstack.com, REST API interface to obtain stock market data from around the world; free tier with limited access, Free/Paid
7+
Quandl, https://www.quandl.com, "Financial, economic, and alternative data; free datasets available for academic use", Free/Paid
8+
Twelve Data, https://twelvedata.com, "Financial data including real-time and historical stock data, forex, and cryptocurrencies; free plan with limited access", Free/Paid
9+
World Trading Data, https://www.worldtradingdata.com, Real-time and historical stock data; free tier available, Free/Paid

src/stock_analysis_program/fetcher/revenue_growth_fetcher.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import yfinance as yf
1414

15+
1516
class RevenueGrowthFetcher:
1617
"""
1718
Fetches year-over-year revenue growth for a list of stock tickers.
@@ -43,10 +44,14 @@ def fetch_revenue_growth(self):
4344
for ticker in self.tickers:
4445
company = yf.Ticker(ticker)
4546
income_statement = company.financials
46-
if 'Total Revenue' in income_statement.index:
47-
revenue = income_statement.loc['Total Revenue']
48-
revenue_growth = revenue.pct_change(periods=-1) # Negative periods for year-over-year growth
49-
growth_data[ticker] = revenue_growth.dropna().iloc[0] # Most recent growth value
47+
if "Total Revenue" in income_statement.index:
48+
revenue = income_statement.loc["Total Revenue"]
49+
revenue_growth = revenue.pct_change(
50+
periods=-1
51+
) # Negative periods for year-over-year growth
52+
growth_data[ticker] = revenue_growth.dropna().iloc[
53+
0
54+
] # Most recent growth value
5055
else:
5156
growth_data[ticker] = None
5257
return growth_data

0 commit comments

Comments
 (0)