mirror of
https://github.com/hydrosquall/tiingo-python.git
synced 2025-12-18 04:14:20 +01:00
Deprecate documentation + tests + code for mutual funds metrics
This commit is contained in:
@@ -26,7 +26,6 @@ Tiingo Python
|
||||
Tiingo is a financial data platform that makes high quality financial tools available to all. They have a RESTful and Real-Time Data API. Presently, the API includes support for the following endpoints:
|
||||
|
||||
* Stock Market Ticker Closing Prices + Metadata. Data includes full distribution details and is validated using a proprietary EOD Price Engine.
|
||||
* Mutual Funds Metadata + Metrics updated daily. Supports over 26,500 Mutual Funds and ETFs.
|
||||
* (Coming Soon): Curated news from top financial news sources + curated blogs. Stories are tagged by Tiingo's algorithms.
|
||||
|
||||
|
||||
@@ -77,13 +76,6 @@ Now you can use ``TiingoClient`` to make your API calls. (Other parameters are a
|
||||
# Get latest prices, based on 3+ sources, as CSV or JSON, sampled weekly
|
||||
ticker_price = client.get_ticker_price("GOOGL", frequency="weekly")
|
||||
|
||||
# WARNING: These will only work if your account has access to the
|
||||
# Mutual Funds portion of the API.
|
||||
# Get mutual fund metadata
|
||||
fund_metadata = client.get_fund_metadata("VFINX")
|
||||
# Get mutual fund Expenses and Shareholder Fee Data for June 2017
|
||||
fund_metrics = client.get_fund_metrics("VFINX", "2017-06-01", "2017-06-30")
|
||||
|
||||
# Get news articles about given tickers or search terms from given domains
|
||||
# Coming soon!
|
||||
|
||||
@@ -98,6 +90,7 @@ Features
|
||||
--------
|
||||
|
||||
* Easy programmatic access to Tiingo API
|
||||
# Ability to reuse session across API calls for better performance
|
||||
* Coming soon:
|
||||
* Client-side validation of tickers, to save your API calls!
|
||||
* Data validation of returned responses
|
||||
|
||||
@@ -37,7 +37,6 @@ Contents:
|
||||
Tiingo is a financial data platform that makes high quality financial tools available to all. They have a RESTful and Real-Time Data API. Presently, the API includes support for the following endpoints:
|
||||
|
||||
* Stock Market Ticker Closing Prices + Metadata. Data includes full distribution details and is validated using a proprietary EOD Price Engine.
|
||||
* Mutual Funds Metadata + Metrics updated daily. Supports over 26,500 Mutual Funds and ETFs.
|
||||
* (Coming Soon): Curated news from top financial news sources + curated blogs. Stories are tagged by Tiingo's algorithms.
|
||||
|
||||
|
||||
|
||||
@@ -43,13 +43,6 @@ Now you can use ``TiingoClient`` to make your API calls. (Other parameters are a
|
||||
# Get latest prices, based on 3+ sources, as CSV or JSON, sampled weekly
|
||||
ticker_price = client.get_ticker_price("GOOGL", frequency="weekly")
|
||||
|
||||
# WARNING: These will only work if your account has access to the
|
||||
# Mutual Funds portion of the API.
|
||||
# Get mutual fund metadata
|
||||
fund_metadata = client.get_fund_metadata("VFINX")
|
||||
# Get mutual fund Expenses and Shareholder Fee Data for June 2017
|
||||
fund_metrics = client.get_fund_metrics("VFINX", "2017-06-01", "2017-06-30")
|
||||
|
||||
# Get news articles about given tickers or search terms from given domains
|
||||
# Coming soon!
|
||||
|
||||
|
||||
@@ -20,20 +20,6 @@ from tiingo.restclient import RestClientError
|
||||
# Expand test coverage
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def fund_metadata_response():
|
||||
"""Test /tiingo/<ticker> endpoint"""
|
||||
t = TiingoClient()
|
||||
return t.get_fund_metadata("vfinx")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def fund_metrics_response():
|
||||
"""Test /tiingo/<ticker> endpoint"""
|
||||
t = TiingoClient()
|
||||
return t.get_fund_metrics("VFINX")
|
||||
|
||||
|
||||
def test_client_repr():
|
||||
"""Test representation of client when logged to console"""
|
||||
client = TiingoClient()
|
||||
@@ -84,35 +70,6 @@ class TestTickerPrices(TestCase):
|
||||
response = self._client.list_tickers()
|
||||
assert not response
|
||||
|
||||
|
||||
# FUND ENDPOINTS
|
||||
# tiingo/funds
|
||||
# Try to get a working API key from Tiingo development for testing purposes
|
||||
|
||||
class TestMutualFunds(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self._client = TiingoClient()
|
||||
self._metadata_response = self._client.get_fund_metrics('VFINX')
|
||||
self._metrics_response = \
|
||||
self._client.get_fund_metrics('VFINX',
|
||||
startDate="2012-1-1",
|
||||
endDate="2016-1-1")
|
||||
|
||||
@pytest.mark.skip(reason="My API key doesn't have access to mutual funds API")
|
||||
def test_fund_metadata(self, fund_metadata_response):
|
||||
"""Refactor this with python data schemavalidation"""
|
||||
assert fund_metadata_response.get('ticker') == "vfinx"
|
||||
assert fund_metadata_response.get("shareClass", startDate="2012-1-1",
|
||||
endDate="2016-1-1")
|
||||
|
||||
@pytest.mark.skip(reason="My API key doesn't have access to mutual funds API")
|
||||
def test_fund_metrics(self, fund_metrics_response):
|
||||
"""Test Fund Level Metrics"""
|
||||
assert len(fund_metrics_response) > 0
|
||||
assert fund_metrics_response[0].get('managementFee')
|
||||
|
||||
|
||||
# News Feed
|
||||
# tiingo/news
|
||||
class TestNews(TestCase):
|
||||
|
||||
@@ -87,38 +87,6 @@ class TiingoClient(RestClient):
|
||||
else:
|
||||
return response.content.decode("utf-8")
|
||||
|
||||
# FUND DATA (From over 26,000 mutual funds)
|
||||
# https://api.tiingo.com/docs/tiingo/funds
|
||||
# TODO: Validate the models returned by the fund
|
||||
def get_fund_metadata(self, fund):
|
||||
"""Return metadata for 1 mutual fund / ETF
|
||||
|
||||
Args:
|
||||
fund (string): Unique identifier for fund/ETF
|
||||
"""
|
||||
url = "tiingo/funds/{}".format(fund)
|
||||
response = self._request('GET', url)
|
||||
return response.json()
|
||||
|
||||
def get_fund_metrics(self, fund, startDate=None, endDate=None):
|
||||
"""Return metrics about a fund. If no date provided,
|
||||
return latest metrics.
|
||||
Args:
|
||||
fund (string): Unique identifier for fund/ETF
|
||||
startDate (string): Start of fund range in YYYY-MM-DD format
|
||||
endDate (string): End of fund range in YYYY-MM-DD format
|
||||
"""
|
||||
url = "tiingo/funds/{}/metrics".format(fund)
|
||||
params = {}
|
||||
|
||||
if startDate:
|
||||
params['startDate'] = startDate
|
||||
if endDate:
|
||||
params['endDate'] = endDate
|
||||
|
||||
response = self._request('GET', url, params=params)
|
||||
return response.json()
|
||||
|
||||
# NEWS FEEDS
|
||||
# tiingo/news
|
||||
def get_news(self, tickers=[], tags=[], sources=[], startDate=None,
|
||||
|
||||
Reference in New Issue
Block a user