diff --git a/README b/README index 456d26b..39229ea 100644 --- a/README +++ b/README @@ -50,31 +50,27 @@ Usage example "ID": "22144" } ] - >>> print json.dumps(getQuotes(['AAPL', 'GOOG']), indent=2) + >>> print json.dumps(getQuotes(['AAPL', 'VIE:BKS']), 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", + "LastTradeWithCurrency": "129.36", + "LastTradeDateTime": "2015-03-03T16:02:36Z", + "LastTradePrice": "129.36", + "LastTradeTime": "4:02PM EST", + "LastTradeDateTimeLong": "Mar 3, 4:02PM EST", "StockSymbol": "AAPL", "ID": "22144" }, { - "Index": "NASDAQ", - "LastTradeWithCurrency": "571.34", - "LastTradeDateTime": "2015-03-02T16:04:29Z", - "LastTradePrice": "571.34", - "Yield": "", - "LastTradeTime": "4:04PM EST", - "LastTradeDateTimeLong": "Mar 2, 4:04PM EST", - "Dividend": "", - "StockSymbol": "GOOG", - "ID": "304466804484872" + "Index": "VIE", + "LastTradeWithCurrency": "17.10", + "LastTradeDateTime": "2015-03-03T13:30:30Z", + "LastTradePrice": "17.10", + "LastTradeTime": "1:30PM GMT+1", + "LastTradeDateTimeLong": "Mar 3, 1:30PM GMT+1", + "StockSymbol": "BKS", + "ID": "978541942832888" } ] diff --git a/README.md b/README.md index f2aaad8..f675f61 100644 --- a/README.md +++ b/README.md @@ -35,30 +35,26 @@ From development repo (requires git) "ID": "22144" } ] - >>> print json.dumps(getQuotes(['AAPL', 'GOOG']), indent=2) + >>> print json.dumps(getQuotes(['AAPL', 'VIE:BKS']), 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", + "LastTradeWithCurrency": "129.36", + "LastTradeDateTime": "2015-03-03T16:02:36Z", + "LastTradePrice": "129.36", + "LastTradeTime": "4:02PM EST", + "LastTradeDateTimeLong": "Mar 3, 4:02PM EST", "StockSymbol": "AAPL", "ID": "22144" }, { - "Index": "NASDAQ", - "LastTradeWithCurrency": "571.34", - "LastTradeDateTime": "2015-03-02T16:04:29Z", - "LastTradePrice": "571.34", - "Yield": "", - "LastTradeTime": "4:04PM EST", - "LastTradeDateTimeLong": "Mar 2, 4:04PM EST", - "Dividend": "", - "StockSymbol": "GOOG", - "ID": "304466804484872" + "Index": "VIE", + "LastTradeWithCurrency": "17.10", + "LastTradeDateTime": "2015-03-03T13:30:30Z", + "LastTradePrice": "17.10", + "LastTradeTime": "1:30PM GMT+1", + "LastTradeDateTimeLong": "Mar 3, 1:30PM GMT+1", + "StockSymbol": "BKS", + "ID": "978541942832888" } ] diff --git a/googlefinance/__init__.py b/googlefinance/__init__.py index b2c39b4..17e0f17 100644 --- a/googlefinance/__init__.py +++ b/googlefinance/__init__.py @@ -27,7 +27,8 @@ def request(symbols): url = buildUrl(symbols) req = Request(url) resp = urlopen(req) - content = resp.read().decode().strip() + # remove special symbols such as the pound symbol + content = resp.read().decode('ascii', 'ignore').strip() content = content[3:] return content diff --git a/setup.py b/setup.py index a06b5fb..43c3200 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,12 @@ from distutils.core import setup setup( name = 'googlefinance', packages = ['googlefinance'], # this must be the same as the name above - version = '0.4', + version = '0.5', description = 'Python module to get real-time (no delay) stock data from Google Finance API', author = 'Hongtao Cai', author_email = 'caiht.ht@gmail.com', url = 'https://github.com/hongtaocai/googlefinance', # use the URL to the github repo download_url = 'https://github.com/hongtaocai/googlefinance/tarball/0.4', # I'll explain this in a second - keywords = ['googlefinance', 'stock', 'price' , 'finance', 'google'], # arbitrary keywords + keywords = ['googlefinance', 'stock', 'price' , 'finance', 'google', 'real-time'], # arbitrary keywords classifiers = [], )