hongtaocai / googlefinance

Python module to get real-time stock data from Google Finance API
MIT License
713 stars 170 forks source link

[Feature Request] Can you simplify the codes a little bit more? #33

Open ghost opened 7 years ago

ghost commented 7 years ago

Your project is a life saver for me to fetch the real-time data but can you simplify a little bit more.

For example

>>> from googlefinance import getQuotes
>>> import json
>>> print json.dumps(getQuotes('AAPL'), indent=2)
[
  {
    "Index": "NASDAQ", 
    "LastTradeWithCurrency": "129.09", 
    "LastTradeDateTime": "2015-03-02T16:04:29Z", 
    "LastTradePrice": "129.09", 
    "Yield": "1.46", 
    "LastTradeTime": "4:04PM EST", 
    "LastTradeDateTimeLong": "Mar 2, 4:04PM EST", 
    "Dividend": "0.47", 
    "StockSymbol": "AAPL", 
    "ID": "22144"
  }
]

I need something like this

from googlefinance import getQuotes
getQuotes('AAPL') #for fetcing all values
getQuotes('AAPL',params=['lastprice','symbol','Time',etc])
dretta commented 7 years ago

https://github.com/dretta/googlefinance/pull/1