Skip to content

Commit

Permalink
get balancsheet method added
Browse files Browse the repository at this point in the history
  • Loading branch information
josuebrunel committed Jul 8, 2015
1 parent 1b8301d commit cd6613d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion myql/contrib/finance/stockscraper/stockretriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def get_current_info(self, symbolList, columns=None):
"""get_current_info() uses the yahoo.finance.quotes datatable to get all of the stock information presented in the main table on a typical stock page
and a bunch of data from the key statistics page.
"""
#symbolList = symbolList if not isinstance(symbolList, str) else (symbolList,)
response = self.select('yahoo.finance.quotes',columns).where(['symbol','in',symbolList])
return response

Expand Down Expand Up @@ -86,6 +85,12 @@ def get_dividendhistory(self, symbol, startDate, endDate, items=None):
response = self.select('yahoo.finance.dividendhistory', items).where(['symbol', '=', symbol], ['startDate', '=', startDate], ['endDate', '=', endDate])
return response

def get_balancesheet(self, symbol):
"""Retrieves balance sheet
"""
response = self.select('yahoo.finance.balancesheet').where(['symbol', '=', symbol])
return response

def get_symbols(self, name):
"""Retrieves all symbols belonging to a company
"""
Expand Down
5 changes: 5 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ def test_get_dividendhistory(self,):
logging.debug(pretty_json(data.content))
self.assertEqual(data.status_code, 200)

def test_get_balancesheet(self,):
data = self.stock.get_balancesheet('YHOO')
logging.debug(pretty_json(data.content))
self.assertEqual(data.status_code, 200)


class TestTable(unittest.TestCase):

Expand Down

0 comments on commit cd6613d

Please sign in to comment.