diff --git a/README.md b/README.md index 628fb28..4a8c52f 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,13 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 Noor Ahmed + + + Khushi260 +
+ Khushi Jha +
+ muratonuryildirim @@ -122,21 +129,14 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Vallabh Chugh
- + + Abbhiishek
Abhishek Kushwaha
- - - - - Khushi260 -
- Khushi Jha -
@@ -339,13 +339,20 @@ Thanks a lot for spending your time helping! Keep rocking 🍻 - - tolgakurtuluss + + smeax
Null
+ + + tolgakurtuluss +
+ Null +
+ srinjoy-26 @@ -380,6 +387,14 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Aditya Tiwari
+ + + + + Asmita-Dutta +
+ Null +
@@ -387,8 +402,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Vedant Jolly
- - + Hemant2801 @@ -416,7 +430,8 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Parinthapat P.
- + + iamrahul8 @@ -430,8 +445,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Riya Roy
- - + royninja @@ -459,7 +473,8 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Yash Indane
- + + ambushneupane @@ -473,8 +488,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Aswin Shailajan
- - + jrafaaael @@ -502,7 +516,8 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Aiman Aisha
- + + akashJainAJ11 @@ -516,8 +531,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Arijit Ghosh
- - + Yaswanth820 @@ -545,7 +559,8 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Heshanthaka
- + + Gokul-Ks @@ -559,8 +574,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
KUMAR SANTOSH
- - + Manice18 @@ -588,7 +602,8 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Raj Saha
- + + ramonsaraiva @@ -602,8 +617,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Riya Jaiswal
- - + sarthakroy2002 @@ -631,7 +645,8 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Anjali Chauhan
- + + anshrusia200 @@ -645,8 +660,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Arpit Bhardwaj
- - + artemis-i-guess @@ -674,6 +688,14 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Yash Nilesh Brid
+ + + + + mclmza +
+ Michele Mazza +
@@ -688,8 +710,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Mubeen Ahmad
- - + neocollege @@ -710,7 +731,8 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
Sameer Sahu
- + + shatanikmahanty diff --git a/scripts/StockVisualizer/README.md b/scripts/StockVisualizer/README.md new file mode 100644 index 0000000..79949c8 --- /dev/null +++ b/scripts/StockVisualizer/README.md @@ -0,0 +1,10 @@ +# Stock Visualizer + +## About +A stock visualizer, that uses the Yahoo Finance library to create a customizable graph for the user to see. +It will ask the user for input, specifically for the stock symbol, and the start and end dates in the form (YYYY-MM-DD). +Then, it will output a graph with those specifications. +### Input Queried from User +![](assets/input.png) +### Output Graph Generated +![](assets/output.png) diff --git a/scripts/StockVisualizer/assets/input.png b/scripts/StockVisualizer/assets/input.png new file mode 100644 index 0000000..36bacbf Binary files /dev/null and b/scripts/StockVisualizer/assets/input.png differ diff --git a/scripts/StockVisualizer/assets/output.png b/scripts/StockVisualizer/assets/output.png new file mode 100644 index 0000000..58a5177 Binary files /dev/null and b/scripts/StockVisualizer/assets/output.png differ diff --git a/scripts/StockVisualizer/stock.py b/scripts/StockVisualizer/stock.py new file mode 100644 index 0000000..9988c76 --- /dev/null +++ b/scripts/StockVisualizer/stock.py @@ -0,0 +1,33 @@ +import pandas as pd +import yfinance as yf +import matplotlib.pyplot as plt + +def get_df(ticker, start_date, end_date): + stock = yf.Ticker(ticker) + df = stock.history(start=start_date, end=end_date) + return df + +def plot(df, ticker): + plt.figure(figsize=(14, 8)) + plt.plot(df['Close']) + plt.title(f'{ticker} Stock Price') + plt.xlabel('Date') + plt.ylabel('Price (USD)') + plt.grid() + plt.show() + +def user_input(): + ticker = input('Stock Symbol: ') + start_date = input('Start Date (YYYY-MM-DD): ') + end_date = input('End Date (YYYY-MM-DD): ') + return ticker, start_date, end_date + +def stock_visualizer(): + ticker, start_date, end_date = user_input() + df = get_df(ticker, start_date, end_date) + plot(df, ticker) + + + + + diff --git a/scripts/StockVisualizer/tests/tests.py b/scripts/StockVisualizer/tests/tests.py new file mode 100644 index 0000000..0c8a1e4 --- /dev/null +++ b/scripts/StockVisualizer/tests/tests.py @@ -0,0 +1,18 @@ +import yfinance as yf +from stock import ( + get_df, + plot, + user_input, + stock_visualizer +) + +def test_df(): + stock = yf.Ticker("MSFT") + assert (get_df(stock, "2023-01-01", "2023-02-01") != None) + +def test_plot(): + stock = yf.Ticker("MSFT") + df = get_df(stock, "2023-01-01", "2023-02-01") + assert(plot(df, stock) != None) + +