Package: pricefetch
Price-Fetch: Real time Stock and Option toolsPrice-Fetch is a Python 3 library for monitoring and analyzing real time Stock and
Option data. Quotes are provided from the Yahoo Finance API and Google Finance API.
Price-Fetch requires minimal input from the user, it uses available online data to
calculate option greeks and even scrapes the US Treasury website to get the current risk free rate.AuthorsRutuvi Narang   -rutuvinarang@gmail.comDevesh Todarwal -todarwal.devesh@gmail.comUsageStocks:frompricefetchimportStock,Call,Put>>>s=Stock('MSFT')>>>s.price326.48>>>s.change-0.35>>>s.last_trade'20 Oct 2021 13:32:12'Options:>>>a=Call('AAPL',d=10,m=10,y=2021,strike=700)>>>a.price19.60>>>a.implied_volatility()0.49222968442691889>>>a.delta()0.56522039722040063>>>a.vega()0.685034827159825>>>a.underlying.price149.59Alternative construction:>>>g=Call('GOOG',d=20,m=10,y=2021)>>>gCall(ticker=GOOG,expiration='12-20-2021')>>>g.strikes(580,610,620,630,640,650,660,670,680,690,697.5,700,702.5,707.5,710,712.5,715,720,...)>>>g.set_strike(712.5)>>>gCall(ticker=GOOG,expiration='12-20-2021',strike=712.5)Download historical data (requires pandas)s=Stock('BTC-USD')>>>df=s.historical(days_back=30,frequency='d')>>>dfDateOpenHighLowCloseAdjCloseVolumeDateOpenHighLowCloseAdjCloseVolume02021-10-0549174.96093851839.98437549072.83984451514.81250051514.8125003587390423612021-10-0651486.66406355568.46484450488.19140655361.44921955361.4492194903473016822021-10-0755338.62500055338.62500053525.46875053805.98437553805.9843753680786041332021-10-0853802.14453155922.98046953688.05468853967.84765653967.8476563480087392442021-10-0953929.78125055397.94531353735.14453154968.22265654968.2226563249121141452021-10-1054952.82031356401.30468854264.25781354771.57812554771.5781253952779236462021-10-1154734.12500057793.03906354519.76562557484.78906357484.7890634263733169872021-10-1257526.83203157627.87890654477.97265656041.05859456041.0585944108375894982021-10-1356038.25781357688.66015654370.97265657401.09765657401.0976564168425278392021-10-1457372.83203158478.73437556957.07421957321.52343857321.52343836615791366102021-10-1557345.90234462757.12890656868.14453161593.94921961593.94921951780081801112021-10-1661609.52734462274.47656360206.12109460892.17968860892.17968834250964237122021-10-1760887.65234461645.52343859164.46875061553.61718861553.61718829032367511132021-10-1861548.80468862614.66015660012.75781362026.07812562026.07812538055562075142021-10-1962043.16406364434.53515661622.93359464261.99218864261.99218840471196346152021-10-2064284.58593866930.39062563610.67578165992.83593865992.83593840788955582162021-10-2166002.23437566600.54687562117.41015662210.17187562210.17187545908121370172021-10-2262237.89062563715.02343860122.79687560692.26562560692.26562538434082775182021-10-2360694.62890661743.87890659826.52343861393.61718861393.61718826882546034192021-10-2461368.34375061505.80468859643.34375060930.83593860930.83593827316183882202021-10-2560893.92578163729.32421960691.80078163039.82421963039.82421931064911614212021-10-2663032.76171963229.02734459991.16015660363.79296960363.79296934878965587222021-10-2760352.00000061435.18359458208.18750058482.38671958482.38671943657076893232021-10-2858470.73046962128.63281358206.91796960622.13671960622.13671945257083247242021-10-2960624.87109462927.60937560329.96484462227.96484462227.96484436856881767252021-10-3062239.36328162330.14453160918.38671961888.83203161888.83203132157938616262021-10-3161850.48828162406.17187560074.32812561318.95703161318.95703132241199927272021-11-0161320.44921962419.00390659695.18359461004.40625061004.40625036150572843282021-11-0260963.25390664242.79296960673.05468863226.40234463226.40234437746665647292021-11-0363254.33593863516.93750061184.23828162970.04687562970.04687536124731509302021-11-0462898.69140663088.77343861446.25781361863.87890661863.87890635562352640Installation$pipinstallpricefetchAPI AttributesStock Attributestickerpriceidexchangelast_tradechange   (change in currency)cp   (percentage change)Option Attributes and Methodsstrikeexpirationunderlying  (underlying stock object)tickerbidaskprice (option price)idexchangechange  (in currency)cp  (percentage change)volumeopen_interestcodeexpirations (list of possible expiration dates for option chain)strikes (list of possible strike prices)set_strike()implied_volatility()delta()gamma()vega()theta()rho()