StockStalker.present - RockoonTechnologies/StockStalker GitHub Wiki

Present

The present module is what allows you to fetch live data about a stock.

To operate present simply import it: import StockStalker.present as present

Then you can use its two main functions:

  • getLiveData(ticker, format="Dict")
  • getIndex(index)

getLiveData() returns either a Dict (format="Dict"), a Panda's Dataframe (format="DataFrame") or a (munch) object (format="Object"). They all hold the same information, so its up to you!

getLiveData()returns a ample amount of information about a stock, here is a example:

{
   "Symbol":"AAPL",
   "Price":134.56,
   "Change":[
      {
         "change":-0.83,
         "percentageChange":"-0.61%"
      }
   ],
   "P/E":36.5,
   "Ranges":[
      {
         "Low":133.77,
         "High":136.39
      }
   ],
   "Open":135.9,
   "previousClose":135.39,
   "EPS":3.69,
   "marketCap":"2.259T",
   "volume":50445505.0
}

getIndex(index) can be supplied currently with 4 inputs:

  • "NASDAQ" - gets all Symbols in the NASDAQ index
  • "NASDAQ.OTHER" - gets all Symbols in the OFIN index
  • "DOW" - gets all the Symbols in the DOW index
  • "NYSE" - gets all Symbols in the NYSE

getIndex returns a list that looks like the following:

['MCD', 'TRV', 'UNH', 'WMT', 'DOW', 'JPM', 'AXP'...