Skip to content

Commit c2c9e05

Browse files
Merge pull request #11 from Visionary-Code-Works/dev
update some of the documentation
2 parents 3fb785d + 3ee7d5e commit c2c9e05

File tree

10 files changed

+555
-2
lines changed

10 files changed

+555
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ price_plotter.plot_closing_prices('2021-01-01', '2021-12-31')
5757

5858
For detailed documentation on each component, please refer to the `docs` directory.
5959

60+
[Workflow](./docs/Workflow.md)
61+
[Plotter](./docs/Plotter.md)
62+
[Fetcher](./docs/Fetcher.md)
63+
[Documentation](./docs/documentation.md)
64+
6065
## Contributing
6166

6267
Contributions to enhance the program are welcome. Please fork the repository and submit a pull request with your changes.

docs/Fetcher.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Fetchers
2+
3+
[Home](../README.md)
4+
[Workflow](./Workflow.md)
5+
[Plotter](./Plotter.md)
6+
[Documentation](./documentation.md)
7+
8+
## Overview
9+
10+
The `fetcher` package is designed for financial data retrieval and analysis. It includes classes for fetching financial metrics, revenue growth, stock data, and stock summaries from Yahoo Finance using the `yfinance` library. This package is suitable for investors, financial analysts, traders, and anyone interested in performing detailed stock market research and analysis.
11+
12+
### Classes
13+
14+
- `FinancialMetricsFetcher`
15+
- `RevenueGrowthFetcher`
16+
- `StockDataFetcher`
17+
- `StockSummaryFetcher`
18+
19+
---
20+
21+
| Class / Initialization | Description | Methods |
22+
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23+
| FinancialMetricsFetcher </br> `FinancialMetricsFetcher(tickers)` | Retrieves important financial metrics for a list of stock tickers, including:<br> market capitalization, P/E ratio, forward P/E, price to book ratio, and profit margins.<br> Ideal for financial analysis and comparisons across different stocks. | **`fetch_financial_metrics`**: Fetches and compiles financial metrics for each ticker in the list.<br>&nbsp;&nbsp;&nbsp;&nbsp;**Returns**<br>&nbsp;&nbsp;&nbsp;&nbsp;- `pandas.DataFrame`: A DataFrame containing the financial metrics for each ticker. |
24+
| RevenueGrowthFetcher </br> `RevenueGrowthFetcher(tickers)` | Fetches and calculates the year-over-year revenue growth for a list of stock tickers.<br> Utilizes historical financial data to assess company performance over time. | **`fetch_revenue_growth`**: Calculates the most recent year-over-year revenue growth for each ticker.<br>&nbsp;&nbsp;&nbsp;&nbsp;**Returns**<br>&nbsp;&nbsp;&nbsp;&nbsp;- `dict`: A dictionary with tickers as keys and their respective year-over-year revenue growth percentages as values. |
25+
| StockDataFetcher </br> `StockDataFetcher(ticker)` | Fetches various types of stock data, including: historical data, moving averages,<br> average trading volume, and key financial metrics. | **`fetch_historical_data`**: Retrieves historical stock data for the specified period.<br>&nbsp;&nbsp;&nbsp;&nbsp;**Parameters**<br>&nbsp;&nbsp;&nbsp;&nbsp;- `period` (str, optional): The time period for which to fetch the data. Defaults to '1y'.<br>&nbsp;&nbsp;&nbsp;&nbsp;**Returns**<br>&nbsp;&nbsp;&nbsp;&nbsp;- `pandas.DataFrame`: Historical stock data.<br><br>**`calculate_moving_averages`**: Calculates moving averages for given window sizes.<br><br>**`get_average_volume`**: Calculates the average trading volume.<br><br>**`get_financial_metrics`**: Fetches and returns key financial metrics. |
26+
| StockSummaryFetcher </br> `StockSummaryFetcher(tickers)` | Fetches and provides summary information for a list of stock tickers, including:<br> company name, sector, industry, and key financial metrics. | **`fetch_summary`**: Fetches summary information for a given stock ticker.<br>&nbsp;&nbsp;&nbsp;&nbsp;**Parameters**<br>&nbsp;&nbsp;&nbsp;&nbsp;- `ticker` (str): The stock ticker.<br>&nbsp;&nbsp;&nbsp;&nbsp;**Returns**<br>&nbsp;&nbsp;&nbsp;&nbsp;- `dict`: Summary information of the stock.<br><br>**`get_summaries`**: Retrieves stock summaries for all tickers specified during initialization.<br>&nbsp;&nbsp;&nbsp;&nbsp;**Returns**<br>&nbsp;&nbsp;&nbsp;&nbsp;- `list of dict`: Summaries for each stock ticker. |
27+
28+
---
29+
30+
## FinancialMetricsFetcher
31+
32+
### Description
33+
34+
Retrieves important financial metrics for a list of stock tickers, including market capitalization, P/E ratio, forward P/E, price to book ratio, and profit margins. Ideal for financial analysis and comparisons across different stocks.
35+
36+
### Initialization
37+
38+
```python
39+
FinancialMetricsFetcher(tickers)
40+
```
41+
42+
#### Parameters
43+
44+
- `tickers` (list of str): A list of stock ticker symbols (e.g., `['AAPL', 'MSFT']`) for which financial metrics are to be fetched.
45+
46+
### Methods
47+
48+
#### fetch_financial_metrics
49+
50+
Fetches and compiles financial metrics for each ticker in the list.
51+
52+
##### Returns
53+
54+
- `pandas.DataFrame`: A DataFrame containing the financial metrics for each ticker.
55+
56+
---
57+
58+
## RevenueGrowthFetcher
59+
60+
### Description
61+
62+
Fetches and calculates the year-over-year revenue growth for a list of stock tickers. Utilizes historical financial data to assess company performance over time.
63+
64+
### Initialization
65+
66+
```python
67+
RevenueGrowthFetcher(tickers)
68+
```
69+
70+
#### Parameters
71+
72+
- `tickers` (list of str): Stock tickers to fetch the revenue growth for.
73+
74+
### Methods
75+
76+
`fetch_revenue_growth`: Calculates the most recent year-over-year revenue growth for each ticker.
77+
78+
Returns
79+
80+
- `dict`: A dictionary with tickers as keys and their respective year-over-year revenue growth percentages as values.
81+
82+
---
83+
84+
## StockDataFetcher
85+
86+
### Description
87+
88+
Fetches various types of stock data, including historical data, moving averages, average trading volume, and key financial metrics.
89+
90+
### Initialization
91+
92+
```python
93+
StockDataFetcher(ticker)
94+
```
95+
96+
#### Parameters
97+
98+
- `ticker` (str): The stock ticker symbol for which the data is to be fetched.
99+
100+
### Methods
101+
102+
#### fetch_historical_data
103+
104+
Retrieves historical stock data for the specified period.
105+
106+
##### Parameters
107+
108+
- `period` (str, optional): The time period for which to fetch the data. Defaults to '1y'.
109+
110+
##### Returns
111+
112+
- `pandas.DataFrame`: Historical stock data.
113+
114+
#### calculate_moving_averages
115+
116+
Calculates moving averages for given window sizes.
117+
118+
##### Parameters
119+
120+
- `data` (pandas.DataFrame): The historical stock data.
121+
- `window_sizes` (list of int, optional): Window sizes for calculating moving averages. Defaults to `[20, 50, 200]`.
122+
123+
##### Returns
124+
125+
- `dict`: Moving averages for each window size.
126+
127+
#### get_average_volume
128+
129+
Calculates the average trading volume.
130+
131+
##### Parameters
132+
133+
- `data` (pandas.DataFrame): The historical stock data.
134+
135+
##### Returns
136+
137+
- `float`: Average trading volume.
138+
139+
#### get_financial_metrics
140+
141+
Fetches and returns key financial metrics for the stock.
142+
143+
##### Returns
144+
145+
- `dict`: Key financial metrics.
146+
147+
---
148+
149+
## StockSummaryFetcher
150+
151+
### Description
152+
153+
Fetches and provides summary information for a list of stock tickers, including company name, sector, industry, and key financial metrics.
154+
155+
### Initialization
156+
157+
```python
158+
StockSummaryFetcher(tickers)
159+
```
160+
161+
#### Parameters
162+
163+
- `tickers` (str or list of str): The stock ticker(s) for which the summary information is to be fetched.
164+
165+
### Methods
166+
167+
#### fetch_summary
168+
169+
Fetches summary information for a given stock ticker.
170+
171+
##### Parameters
172+
173+
- `ticker` (str): The stock ticker.
174+
175+
##### Returns
176+
177+
- `dict`: Summary information of the stock.
178+
179+
#### get_summaries
180+
181+
Retrieves stock summaries for all tickers specified during initialization.
182+
183+
##### Returns
184+
185+
- `list of dict`: Summaries for each stock ticker.

docs/Plotter.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# Plotter
2+
3+
[Home](../README.md)
4+
[Workflow](./Workflow.md)
5+
[Fetcher](./Fetcher.md)
6+
[Documentation](./documentation.md)
7+
8+
## Overview
9+
10+
The `plotter` package facilitates the visualization of financial and stock market data. It is designed to assist traders, investors, financial analysts, and anyone interested in market trends, financial performance, and risk assessment through graphical representations.
11+
12+
### Classes
13+
14+
- `CurrentPricesTickerDisplay`
15+
- `FinancialMetricsPlotter`
16+
- `RevenueGrowthPlotter`
17+
- `StockExchangePerformancePlotter`
18+
- `StockPricePlotter`
19+
- `StockVolatilityPlotter`
20+
21+
---
22+
23+
## CurrentPricesTickerDisplay
24+
25+
### Description
26+
27+
Displays current stock prices in a ticker-like format for real-time monitoring.
28+
29+
### Initialization
30+
31+
```python
32+
CurrentPricesTickerDisplay(tickers, interval=10)
33+
```
34+
35+
#### Parameters
36+
37+
- `tickers` (list of str): List of stock ticker symbols.
38+
- `interval` (int, optional): Update interval in seconds. Default is 10 seconds.
39+
40+
### Methods
41+
42+
#### fetch_current_prices
43+
44+
Fetches current prices for the stock tickers.
45+
46+
##### Returns
47+
48+
- `dict`: Current prices of the tickers.
49+
50+
#### display_ticker
51+
52+
Displays the current prices in a rolling ticker format.
53+
54+
---
55+
56+
## FinancialMetricsPlotter
57+
58+
### Description
59+
60+
Plots financial metrics of stocks in a histogram format for comparison.
61+
62+
### Initialization
63+
64+
```python
65+
FinancialMetricsPlotter(tickers)
66+
```
67+
68+
#### Parameters
69+
70+
- `tickers` (list of str): Stock tickers for financial metrics plotting.
71+
72+
### Methods
73+
74+
#### plot_metrics
75+
76+
Plots histograms of various financial metrics.
77+
78+
---
79+
80+
## RevenueGrowthPlotter
81+
82+
### Description
83+
84+
Visualizes year-over-year revenue growth of stocks in a bar chart format.
85+
86+
### Initialization
87+
88+
```python
89+
RevenueGrowthPlotter(tickers)
90+
```
91+
92+
#### Parameters
93+
94+
- `tickers` (list of str): Stock tickers for revenue growth plotting.
95+
96+
### Methods
97+
98+
#### plot_revenue_growth
99+
100+
Plots year-over-year revenue growth.
101+
102+
---
103+
104+
## StockExchangePerformancePlotter
105+
106+
### Description
107+
108+
Compares and visualizes the performance of different stock indices over time.
109+
110+
### Initialization
111+
112+
```python
113+
StockExchangePerformancePlotter(indices)
114+
```
115+
116+
#### Parameters
117+
118+
- `indices` (list of str): Stock index symbols for performance comparison.
119+
120+
### Methods
121+
122+
#### plot_performance
123+
124+
Plots normalized closing prices of the indices for comparison.
125+
126+
---
127+
128+
## StockPricePlotter
129+
130+
### Description
131+
132+
Visualizes stock prices and their moving averages over a selected period.
133+
134+
### Initialization
135+
136+
```python
137+
StockPricePlotter(tickers)
138+
```
139+
140+
#### Parameters
141+
142+
- `tickers` (list of str): Stock tickers for price visualization.
143+
144+
### Methods
145+
146+
#### plot_closing_prices
147+
148+
Plots the closing prices of the stocks.
149+
150+
#### plot_moving_averages
151+
152+
Plots moving averages along with closing prices.
153+
154+
---
155+
156+
## StockVolatilityPlotter
157+
158+
### Description
159+
160+
Calculates and visualizes the rolling volatility of stock prices.
161+
162+
### Initialization
163+
164+
```python
165+
StockVolatilityPlotter(tickers)
166+
```
167+
168+
#### Parameters
169+
170+
- `tickers` (list of str): Stock tickers for volatility analysis.
171+
172+
### Methods
173+
174+
#### plot_volatility
175+
176+
Calculates and plots rolling volatility.

0 commit comments

Comments
 (0)