Skip to content

Commit

Permalink
Fix some minor issues and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
n1rna committed Oct 13, 2019
1 parent e7de01c commit b18f358
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tiingo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _invalid_frequency(self, frequency):
is_valid = self._is_eod_frequency(frequency) or re.match(self._frequency_pattern, frequency)
return not is_valid

def _get_price_url(self, ticker, frequency):
def _get_url(self, ticker, frequency):
"""
Return url based on frequency. Daily, weekly, or yearly use Tiingo
EOD api; anything less than daily uses the iex intraday api.
Expand Down Expand Up @@ -178,7 +178,7 @@ def get_ticker_price(self, ticker,
fmt (string): 'csv' or 'json'
frequency (string): Resample frequency
"""
url = self._get_price_url(ticker, frequency)
url = self._get_url(ticker, frequency)
params = {
'format': fmt if fmt != "object" else 'json', # conversion local
'resampleFreq': frequency
Expand Down Expand Up @@ -245,7 +245,7 @@ def get_dataframe(self, tickers,
if pandas_is_installed:
if type(tickers) is str:
stock = tickers
url = self._get_price_url(stock, frequency)
url = self._get_url(stock, frequency)
response = self._request('GET', url, params=params)
df = pd.DataFrame(response.json())
if metric_name is not None:
Expand All @@ -258,7 +258,7 @@ def get_dataframe(self, tickers,
else:
prices = pd.DataFrame()
for stock in tickers:
url = self._get_price_url(stock, frequency)
url = self._get_url(stock, frequency)
response = self._request('GET', url, params=params)
df = pd.DataFrame(response.json())
df.index = df['date']
Expand Down Expand Up @@ -372,7 +372,7 @@ def get_crypto_price_history(self, tickers=[], baseCurrency=None,
if consolidateBaseCurrency is True:
params['consolidateBaseCurrency'] = ','.join(consolidateBaseCurrency)
if includeRawExchangeData is True:
params['includeRawExchangeData'] = ','.join(includeRawExchangeData)
params['includeRawExchangeData'] = includeRawExchangeData
if resampleFreq:
params['resampleFreq'] = resampleFreq
if convertCurrency:
Expand All @@ -381,7 +381,7 @@ def get_crypto_price_history(self, tickers=[], baseCurrency=None,
response = self._request('GET', url, params=params)
return response.json()

def get_crypto_meta_data(self, tickers=[], fmt='json'):
def get_crypto_metadata(self, tickers=[], fmt='json'):
url = 'https://api.tiingo.com/tiingo/crypto'

params = {
Expand Down

0 comments on commit b18f358

Please sign in to comment.