From 13579a117b3bc484a1537eeb569f7512a2a15ef0 Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Sun, 1 Sep 2019 20:46:09 -0400 Subject: [PATCH 1/2] [feature] Rename internal sources URL parameter to source --- tests/fixtures/news.yaml | 2 +- tests/test_tiingo.py | 2 +- tiingo/api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/fixtures/news.yaml b/tests/fixtures/news.yaml index e1d6464..a18c772 100644 --- a/tests/fixtures/news.yaml +++ b/tests/fixtures/news.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: [application/json] User-Agent: [tiingo-python-client 0.3.2] method: GET - uri: https://api.tiingo.com/tiingo/news?limit=1&offset=0&sortBy=publishedDate&tickers=aapl&tickers=googl&sources=washingtonpost.com&sources=altcointoday.com&tags=Technology&tags=Bitcoin&startDate=2016-01-01&endDate=2017-08-31 + uri: https://api.tiingo.com/tiingo/news?limit=1&offset=0&sortBy=publishedDate&tickers=aapl&tickers=googl&source=cnbc.com,altcointoday.com&tags=Technology&tags=Bitcoin&startDate=2016-01-01&endDate=2017-08-31 response: body: {string: '[{ "publishedDate": "2016-01-11T23:13:00Z", diff --git a/tests/test_tiingo.py b/tests/test_tiingo.py index 9d920c2..c92997a 100644 --- a/tests/test_tiingo.py +++ b/tests/test_tiingo.py @@ -155,7 +155,7 @@ class TestNews(TestCase): "tags": ["Technology", "Bitcoin"], "startDate": "2016-01-01", "endDate": "2017-08-31", - "sources": ['washingtonpost.com', 'altcointoday.com'], + "sources": ['cnbc.com', 'altcointoday.com'], "limit": self.num_articles } diff --git a/tiingo/api.py b/tiingo/api.py index b8b3467..0cf9fbb 100644 --- a/tiingo/api.py +++ b/tiingo/api.py @@ -299,7 +299,7 @@ class TiingoClient(RestClient): 'offset': offset, 'sortBy': sortBy, 'tickers': tickers, - 'sources': sources, + 'source': (",").join(sources), 'tags': tags, 'startDate': startDate, 'endDate': endDate From e66fc36c3ff8e9a9dacaec20ff5707282d8ab868 Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Sun, 1 Sep 2019 20:58:20 -0400 Subject: [PATCH 2/2] [documentation] Update changelog --- HISTORY.rst | 4 ++-- tests/fixtures/news.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 1c12996..68291c2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,9 +2,9 @@ History ======= -0.11.x (2019-XX-XX) +0.11.x (2019-09-XX) -------------------- -* Update me as new features are added +* [/news] Internally rename sources parameter to "source", ensure lists are passed as comma separated values 0.10.x (2019-05-11) -------------------- diff --git a/tests/fixtures/news.yaml b/tests/fixtures/news.yaml index a18c772..6181501 100644 --- a/tests/fixtures/news.yaml +++ b/tests/fixtures/news.yaml @@ -7,7 +7,7 @@ interactions: Authorization: [Token 0000000000000000000000000000000000000000] Connection: [keep-alive] Content-Type: [application/json] - User-Agent: [tiingo-python-client 0.3.2] + User-Agent: [tiingo-python-client 0.11.0] method: GET uri: https://api.tiingo.com/tiingo/news?limit=1&offset=0&sortBy=publishedDate&tickers=aapl&tickers=googl&source=cnbc.com,altcointoday.com&tags=Technology&tags=Bitcoin&startDate=2016-01-01&endDate=2017-08-31 response: