From c8623403ddc9fb1e9bc97aa24b494c1797d37578 Mon Sep 17 00:00:00 2001 From: Daniel E Cook Date: Tue, 31 Jul 2018 12:07:30 +0100 Subject: [PATCH 1/5] Update class/objects --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8ee5ae7..d0c54ef 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,7 @@ __Fetch all stock symbols__ ``` python from iex import reference -ref = reference() -ref.symbols() # Returns a Pandas Dataframe of all stock symbols, names, and more. +reference.symbols() # Returns a Pandas Dataframe of all stock symbols, names, and more. ``` ``` symbol date iexId isEnabled \ @@ -62,8 +61,8 @@ ref.symbols() # Returns a Pandas Dataframe of all stock symbols, names, and more __Get a stock price__ ``` python -from iex import stock -stock("F").price() +from iex import Stock +Stock("F").price() ``` ``` 11.4 @@ -71,8 +70,8 @@ stock("F").price() __Get a stocks price for the last year__ ``` python -from iex import stock -stock("F").chart_table(range="1y") +from iex import Stock +Stock("F").chart_table(range="1y") ``` ``` change changeOverTime changePercent close date high \ From c6c1a7610a2466cb925ab4f4b08064950973ca81 Mon Sep 17 00:00:00 2001 From: Daniel Cook Date: Thu, 23 Aug 2018 13:14:30 -0500 Subject: [PATCH 2/5] remove print statements --- iex/iex_market.py | 5 ++--- iex/stocks.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/iex/iex_market.py b/iex/iex_market.py index 5c276f0..f5cc5ab 100644 --- a/iex/iex_market.py +++ b/iex/iex_market.py @@ -21,14 +21,13 @@ class feed_handler(SocketIONamespace): def on_connect(self): - print("connected") + pass def on_disconnect(self): - print("disconnected") + pass def on_message(self, msg): data = json.loads(msg) - print(data) diff --git a/iex/stocks.py b/iex/stocks.py index 8d031e0..1a2dc5a 100644 --- a/iex/stocks.py +++ b/iex/stocks.py @@ -26,7 +26,6 @@ def __init__(self, symbol, date_format='timestamp'): def _get(self, url, params={}): request_url =f"{BASE_URL}/stock/{self.symbol}/{url}" response = requests.get(request_url, params=params) - print(response.url) if response.status_code != 200: raise Exception(f"{response.status_code}: {response.content.decode('utf-8')}") result = response.json() From 0be652c3de96a9264d285c12cdce9a001f3d4527 Mon Sep 17 00:00:00 2001 From: Daniel Cook Date: Thu, 23 Aug 2018 13:16:15 -0500 Subject: [PATCH 3/5] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b45bc4f..73ce6be 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ ] setuptools.setup(name='iex-api-python', - version="0.0.5", + version="0.0.6", description='Fetch data from the IEX API', long_description=open('README.md').read().strip(), author='Daniel E. Cook', From f44e6eea2f8dde24b355a2d0c7335f3c472aeb2f Mon Sep 17 00:00:00 2001 From: Daniel Cook Date: Tue, 16 Oct 2018 08:58:32 +0100 Subject: [PATCH 4/5] Fix dividends return --- iex/stocks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iex/stocks.py b/iex/stocks.py index 1a2dc5a..4ad5d8c 100644 --- a/iex/stocks.py +++ b/iex/stocks.py @@ -127,7 +127,7 @@ def dividends(self, range='1m'): 'DIVIDEND_RANGES' has possible values in addition to a date. """ validate_range_set(range, RANGES) - return self._get(f"chart/{range}") + return self._get(f"dividends/{range}") def dividends_table(self, range='1m'): dividends_data = self.dividends(range) From 5aa930f190251dba8f41ccb9d634b515c80dcc5a Mon Sep 17 00:00:00 2001 From: Daniel Cook Date: Tue, 16 Oct 2018 09:03:11 +0100 Subject: [PATCH 5/5] Update stock test --- tests/unit/test_stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_stock.py b/tests/unit/test_stock.py index c1f9dcb..83178a6 100644 --- a/tests/unit/test_stock.py +++ b/tests/unit/test_stock.py @@ -60,7 +60,7 @@ def test_earnings(): def test_tables(): - ibm = Stock("IBM") + ibm = Stock("GM") assert ibm.chart_table().empty == False assert ibm.dividends_table().empty == False assert ibm.effective_spread_table().empty == False