Module Import alias Import alias Import alias TryExcept body ImportFrom alias alias handlers ExceptHandler type NameLoad body ImportFrom alias alias Assign NameStore Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Str attr ListComp NameLoad comprehension NameStore NameLoad Return BinOpAdd Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Return BinOpAdd BinOpAdd Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Str Str attr Assign NameStore SubscriptLoad NameLoad Slice Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Print Str NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad Assign NameStore SubscriptLoad NameLoad Index Str For NameStore NameLoad body For NameStore NameLoad body If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Global identifier Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Dict For NameStore NameLoad body If CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareEq Call NameLoad NameLoad Call NameLoad Str body Assign NameStore ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad decorator_list If CompareEq NameLoad Str body TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num handlers ExceptHandler body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str Print Call AttributeLoad NameLoad attr Call NameLoad Str keyword Num Print Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword Num
N/A N/A json N/A sys N/A demjson N/A N/A urllib.request Request urlopen N/A N/A N/A ImportError N/A urllib2 Request urlopen N/A __author__ Hongtao Cai N/A googleFinanceKeyToFullName N/A id t e l l_cur ltt lt_dts lt div yld s c c el el_cur elt ec ecp pcls_fix ID StockSymbol Index LastTradePrice LastTradeWithCurrency LastTradeTime LastTradeDateTime LastTradeDateTimeLong Dividend Yield LastTradeSize Change ChangePercent ExtHrsLastTradePrice ExtHrsLastTradeWithCurrency ExtHrsLastTradeDateTimeLong ExtHrsChange ExtHrsChangePercent PreviousClosePrice buildUrl N/A N/A symbols N/A N/A N/A symbol_list N/A N/A , join N/A symbol N/A symbol symbols N/A N/A http://finance.google.com/finance/info?client=ig&q= symbol_list N/A buildNewsUrl N/A N/A symbol qs N/A &start=0&num=1000 N/A N/A N/A N/A http://www.google.com/finance/company_news?output=json&q= symbol qs N/A request N/A N/A symbols N/A N/A N/A url N/A buildUrl symbols N/A req N/A Request url N/A resp N/A urlopen req N/A content N/A N/A N/A N/A N/A N/A resp read decode ascii ignore strip N/A content N/A content N/A 3 N/A content N/A requestNews N/A N/A symbol N/A N/A N/A url N/A buildNewsUrl symbol N/A url:  url N/A req N/A Request url N/A resp N/A urlopen req N/A content N/A N/A resp read N/A content_json N/A N/A demjson decode content N/A article_json N/A N/A news_json N/A content_json N/A clusters N/A cluster news_json N/A N/A article cluster N/A N/A N/A article a N/A N/A N/A N/A article_json extend N/A cluster N/A article N/A article_json N/A replaceKeys N/A N/A quotes N/A N/A N/A googleFinanceKeyToFullName N/A quotesWithReadableKey N/A N/A q quotes N/A N/A qReadableKey N/A N/A k googleFinanceKeyToFullName N/A N/A N/A k q N/A N/A N/A qReadableKey N/A N/A googleFinanceKeyToFullName N/A k N/A q N/A k N/A N/A N/A quotesWithReadableKey append qReadableKey N/A quotesWithReadableKey N/A getQuotes N/A N/A symbols N/A N/A N/A 
    get real-time quotes (index, last trade price, last trade time, etc) for stocks, using google api: http://finance.google.com/finance/info?client=ig&q=symbols

    Unlike python package 'yahoo-finance' (15 min delay), There is no delay for NYSE and NASDAQ stocks in 'googlefinance' package.

    example:
    quotes = getQuotes('AAPL')
    return:
    [{u'Index': u'NASDAQ', u'LastTradeWithCurrency': u'129.09', u'LastTradeDateTime': u'2015-03-02T16:04:29Z', u'LastTradePrice': u'129.09', u'Yield': u'1.46', u'LastTradeTime': u'4:04PM EST', u'LastTradeDateTimeLong': u'Mar 2, 4:04PM EST', u'Dividend': u'0.47', u'StockSymbol': u'AAPL', u'ID': u'22144'}]

    quotes = getQuotes(['AAPL', 'GOOG'])
    return:
    [{u'Index': u'NASDAQ', u'LastTradeWithCurrency': u'129.09', u'LastTradeDateTime': u'2015-03-02T16:04:29Z', u'LastTradePrice': u'129.09', u'Yield': u'1.46', u'LastTradeTime': u'4:04PM EST', u'LastTradeDateTimeLong': u'Mar 2, 4:04PM EST', u'Dividend': u'0.47', u'StockSymbol': u'AAPL', u'ID': u'22144'}, {u'Index': u'NASDAQ', u'LastTradeWithCurrency': u'571.34', u'LastTradeDateTime': u'2015-03-02T16:04:29Z', u'LastTradePrice': u'571.34', u'Yield': u'', u'LastTradeTime': u'4:04PM EST', u'LastTradeDateTimeLong': u'Mar 2, 4:04PM EST', u'Dividend': u'', u'StockSymbol': u'GOOG', u'ID': u'304466804484872'}]

    :param symbols: a single symbol or a list of stock symbols
    :return: real-time quotes list
     N/A N/A N/A type symbols N/A type str N/A N/A symbols N/A symbols N/A content N/A N/A json loads N/A request symbols N/A N/A replaceKeys content N/A getNews N/A N/A symbol N/A N/A N/A N/A requestNews symbol N/A N/A N/A __name__ __main__ N/A N/A N/A N/A symbols N/A N/A sys argv N/A 1 N/A N/A N/A N/A symbols GOOG,AAPL N/A symbols N/A N/A symbols split , N/A N/A N/A json dumps N/A getNews GOOG indent 2 N/A N/A N/A json dumps N/A getQuotes symbols indent 2