Package: pystockwatch
pystockwatchThis package has been created to provide a very simple interface for checking movements in stock prices in comparison to the market. This is implemented by accessing public data from Yahoo Finance by selecting a ticker of the stock, range of start and end dates and benchmark for comparison, such asSP500orNASDAQ. As a result of data processing with pystockwatch package, users will be able to generate two plots: one with two lines showing percentage change in profit since the start date and volumes of trading and another related to daily change in the volume of stock trades as shown at examples belowFunctions descriptionThis package is built with following four functions:percent_changeCalculation of profit percentage change of a stock for a given period of time based on data extracted from Yahoo finance.profit_vizVisualization of profit percentage change trend of a stock against market benchmark for a given period of time. Note that during weekends and public holidays, stock market has no data available, this is handled in plotting as wellvolume_changeCalculation of daily trading volume change of a stock, whether it is increasing or decreasing. This data is used in  next function for color mapping of bar plot.volume_vizVisualization of trading volume as bar plots colored by changes in volume in comparison with previous day. This plot is overlayed with line plots created with the second function. . Note that during weekends and public holidays, stock market has no data available, this is handled in plotting as wellMore information about those functions can be found in docstrings of/src/pystockwatch/pystockwatch.py.Comparison with similar packagesThere are many packages written for analysis of stock data. One of the most popular Python package in this category ispyti, which gives a lot of manipulations with time series data, such as creating moving averages of stock price or calculating hundreds of parameters for technical analysis. Power ofpystockwatchis in its simplicity, so users are not overwhelmed with all extra features and just have a simple view with key comparisons for a stock of interest.Installation$pipinstallpystockwatchUsageAfter the sucessful installation of this package user will be required to input four parameters:stock_ticker,start_date,end_dateandbenchmark_ticker. Output results will be in form of an interactive plot based on "plotly" and "altair" package.pystockwatchcan be used to find the profit percent of stock prices in comparison to the market and check the trend in volume change of stocks and plot results as follows:Import the functions from package with following commands:frompystockwatch.pystockwatchimportpercent_changefrompystockwatch.pystockwatchimportprofit_vizfrompystockwatch.pystockwatchimportvolume_changefrompystockwatch.pystockwatchimportvolume_vizTo check the Profit percentpercent_change('AAPL', '2017-01-01', '2017-01-10')To Visualize the profit percentage change trend of a stock against market benchmarkfig = profit_viz('AAPL', '2015-01-01', '2021-12-31', 'SPY')
fig.show()To check daily trading volume change of a stockvolume_change('AAPL', '2021-01-01', '2022-01-01')To Visualize the volume change trend of a stockvol = volume_viz('AAPL', '2021-01-01', '2022-01-01')
vol.show()DocumentationThe documentation of this package is hosted on Read the Docs:hereContributorsAffrin SultanaHelin WangPavel LevchenkoShi Yan WangContributingAre you interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.DependenciesBefore the installation of this package please install the following packages:python = "^3.9"pandas = "^1.3.5"altair = "^4.2.0"altair_viewer = "^0.4.0"pandas-datareader = "^0.10.0"Licensepystockwatchwas created by Affrin Sultana, Helin Wang, Pavel Levchenko, Shi Yan Wang.It is licensed under the terms of the MIT license.Creditspystockwatchwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.