Skip to content

Commit

Permalink
MAINT: Update black
Browse files Browse the repository at this point in the history
Update black and reformat
  • Loading branch information
bashtage committed Jul 12, 2021
1 parent 1e50626 commit 3458fda
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 47 deletions.
6 changes: 3 additions & 3 deletions pandas_datareader/av/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(

@property
def url(self):
""" API URL """
"""API URL"""
return AV_BASE_URL

@property
Expand All @@ -59,12 +59,12 @@ def params(self):

@property
def function(self):
""" Alpha Vantage endpoint function"""
"""Alpha Vantage endpoint function"""
raise NotImplementedError

@property
def data_key(self):
""" Key of data returned from Alpha Vantage """
"""Key of data returned from Alpha Vantage"""
raise NotImplementedError

def _read_lines(self, out):
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/av/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def forex(self):

@property
def output_size(self):
""" Used to limit the size of the Alpha Vantage query when
"""Used to limit the size of the Alpha Vantage query when
possible.
"""
delta = dt.datetime.now() - self.start
Expand Down
10 changes: 5 additions & 5 deletions pandas_datareader/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def read(self):
self.close()

def _read_one_data(self, url, params):
""" read one data from specified URL """
"""read one data from specified URL"""
if self._format == "string":
out = self._read_url_as_StringIO(url, params=params)
elif self._format == "json":
Expand Down Expand Up @@ -139,7 +139,7 @@ def _sanitize_response(response):
return response.content

def _get_response(self, url, params=None, headers=None):
""" send raw HTTP request to get requests.Response from the specified url
"""send raw HTTP request to get requests.Response from the specified url
Parameters
----------
url : str
Expand Down Expand Up @@ -181,7 +181,7 @@ def _get_response(self, url, params=None, headers=None):
raise RemoteDataError(msg)

def _get_crumb(self, *args):
""" To be implemented by subclass """
"""To be implemented by subclass"""
raise NotImplementedError("Subclass has not implemented method.")

def _output_error(self, out):
Expand Down Expand Up @@ -221,7 +221,7 @@ def _read_lines(self, out):


class _DailyBaseReader(_BaseReader):
""" Base class for Google / Yahoo daily reader """
"""Base class for Google / Yahoo daily reader"""

def __init__(
self,
Expand Down Expand Up @@ -302,7 +302,7 @@ def _in_chunks(seq, size):

class _OptionBaseReader(_BaseReader):
def __init__(self, symbol, session=None):
""" Instantiates options_data with a ticker saved as symbol """
"""Instantiates options_data with a ticker saved as symbol"""
self.symbol = symbol.upper()
super(_OptionBaseReader, self).__init__(symbols=symbol, session=session)

Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/econdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def url(self):
)

def read(self):
""" read one data from specified URL """
"""read one data from specified URL"""
results = self.session.get(self.url).json()["results"]
df = pd.DataFrame({"dates": []}).set_index("dates")

Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/enigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get_current_snapshot_id(self, dataset_id):

def get_dataset_metadata(self, dataset_id):
"""Get the Dataset Model of this EnigmaReader's dataset
https://docs.public.enigma.com/resources/dataset/index.html
https://docs.public.enigma.com/resources/dataset/index.html
"""
url = "datasets/{0}?row_limit=0".format(dataset_id)
response = self._get(url)
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/io/sdmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _read_sdmx_dsd(path_or_buf):


def _read_zipped_sdmx(path_or_buf):
""" Unzipp data contains SDMX-XML """
"""Unzipp data contains SDMX-XML"""
data = _read_content(path_or_buf)

zp = BytesIO()
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/oecd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def url(self):
return "{0}/{1}/all/all?".format(url, self.symbols)

def _read_lines(self, out):
""" read one data from specified URL """
"""read one data from specified URL"""
df = read_jsdmx(out)
try:
idx_name = df.index.name # hack for pandas 0.16.2
Expand Down
60 changes: 30 additions & 30 deletions pandas_datareader/tiingo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,34 @@ def get_tiingo_symbols():

class TiingoIEXHistoricalReader(_BaseReader):
"""
Historical data from Tiingo on equities, ETFs and mutual funds,
with re-sampling capability. This query is limited to the last
1,000 bars based in the endDate. So the startDate is moved if
it goes past the limit.
Parameters
----------
symbols : {str, List[str]}
String symbol or list of symbols
start : string, int, date, datetime, Timestamp
Starting date. Parses many different kind of date
representations (e.g., 'JAN-01-2010', '1/1/10', 'Jan, 1, 1980'). Defaults to
20 years before current date.
end : string, int, date, datetime, Timestamp
Ending date
retry_count : int, default 3
Number of times to retry query request.
pause : float, default 0.1
Time, in seconds, of the pause between retries.
session : Session, default None
requests.sessions.Session instance to be used
freq : {str, None}
Re-sample frequency. Format is # + (min/hour); e.g. "15min" or "4hour".
If no value is provided, defaults to 5min. The minimum value is "1min".
Units in minutes (min) and hours (hour) are accepted.
api_key : str, optional
Tiingo API key . If not provided the environmental variable
TIINGO_API_KEY is read. The API key is *required*.
Historical data from Tiingo on equities, ETFs and mutual funds,
with re-sampling capability. This query is limited to the last
1,000 bars based in the endDate. So the startDate is moved if
it goes past the limit.
Parameters
----------
symbols : {str, List[str]}
String symbol or list of symbols
start : string, int, date, datetime, Timestamp
Starting date. Parses many different kind of date
representations (e.g., 'JAN-01-2010', '1/1/10', 'Jan, 1, 1980'). Defaults to
20 years before current date.
end : string, int, date, datetime, Timestamp
Ending date
retry_count : int, default 3
Number of times to retry query request.
pause : float, default 0.1
Time, in seconds, of the pause between retries.
session : Session, default None
requests.sessions.Session instance to be used
freq : {str, None}
Re-sample frequency. Format is # + (min/hour); e.g. "15min" or "4hour".
If no value is provided, defaults to 5min. The minimum value is "1min".
Units in minutes (min) and hours (hour) are accepted.
api_key : str, optional
Tiingo API key . If not provided the environmental variable
TIINGO_API_KEY is read. The API key is *required*.
"""

def __init__(
Expand Down Expand Up @@ -105,7 +105,7 @@ def _get_crumb(self, *args):
pass

def _read_one_data(self, url, params):
""" read one data from specified URL """
"""read one data from specified URL"""
headers = {
"Content-Type": "application/json",
"Authorization": "Token " + self.api_key,
Expand Down Expand Up @@ -207,7 +207,7 @@ def _get_crumb(self, *args):
pass

def _read_one_data(self, url, params):
""" read one data from specified URL """
"""read one data from specified URL"""
headers = {
"Content-Type": "application/json",
"Authorization": "Token " + self.api_key,
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/tsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def url(self):
return "https://secure.tsp.gov/components/CORS/getSharePricesRaw.html"

def read(self):
""" read one data from specified URL """
"""read one data from specified URL"""
df = super(TSPReader, self).read()
df.columns = map(lambda x: x.strip(), df.columns)
df.drop(columns=self.all_symbols - set(self.symbols), inplace=True)
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/yahoo/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _get_params(self, symbol):
return params

def _read_one_data(self, url, params):
""" read one data from specified symbol """
"""read one data from specified symbol"""

symbol = params["symbol"]
del params["symbol"]
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/yahoo/fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def read(self):
self.close()

def _read_one_data(self, symbol):
""" read one data from specified URL """
"""read one data from specified URL"""
url = "https://query1.finance.yahoo.com/v8/finance/chart/{}=X".format(symbol)
params = self._get_params(symbol)

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==19.10b0; python_version > '3.5'
black==21.5b1; python_version > '3.5'
flake8-bugbear; python_version > '3.5'
coverage
codecov
Expand Down

0 comments on commit 3458fda

Please sign in to comment.