Skip to content

Commit 3065237

Browse files
author
Kevin Sheppard
committed
MAINT: Black and isort
1 parent 7f3be73 commit 3065237

File tree

15 files changed

+78
-34
lines changed

15 files changed

+78
-34
lines changed

docs/source/conf.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16-
import sys
1716
import os
17+
import sys
18+
19+
# Add any Sphinx extension module names here, as strings. They can be
20+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
21+
# ones.
22+
import IPython
23+
1824
import pandas_datareader as pdr
1925
import sphinx_rtd_theme
2026

@@ -33,10 +39,6 @@
3339
#
3440
# needs_sphinx = '1.0'
3541

36-
# Add any Sphinx extension module names here, as strings. They can be
37-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
38-
# ones.
39-
import IPython
4042

4143
extensions = [
4244
"sphinx.ext.autodoc",

pandas_datareader/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import datetime
22
import time
3+
from urllib.parse import urlencode
34
import warnings
45

56
import numpy as np
67
from pandas import DataFrame, concat, read_csv
7-
from urllib.parse import urlencode
88
import requests
99

1010
from pandas_datareader._utils import (

pandas_datareader/data.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,36 @@
1616
from pandas_datareader.econdb import EcondbReader
1717
from pandas_datareader.enigma import EnigmaReader
1818
from pandas_datareader.eurostat import EurostatReader
19-
from pandas_datareader.exceptions import DEP_ERROR_MSG, ImmediateDeprecationError
19+
from pandas_datareader.exceptions import (
20+
DEP_ERROR_MSG,
21+
ImmediateDeprecationError,
22+
)
2023
from pandas_datareader.famafrench import FamaFrenchReader
2124
from pandas_datareader.fred import FredReader
2225
from pandas_datareader.iex.daily import IEXDailyReader
2326
from pandas_datareader.iex.deep import Deep as IEXDeep
24-
from pandas_datareader.iex.tops import LastReader as IEXLasts, TopsReader as IEXTops
27+
from pandas_datareader.iex.tops import (
28+
LastReader as IEXLasts,
29+
TopsReader as IEXTops,
30+
)
2531
from pandas_datareader.moex import MoexReader
2632
from pandas_datareader.nasdaq_trader import get_nasdaq_symbols
2733
from pandas_datareader.oecd import OECDReader
2834
from pandas_datareader.quandl import QuandlReader
29-
from pandas_datareader.robinhood import RobinhoodHistoricalReader, RobinhoodQuoteReader
35+
from pandas_datareader.robinhood import (
36+
RobinhoodHistoricalReader,
37+
RobinhoodQuoteReader,
38+
)
3039
from pandas_datareader.stooq import StooqDailyReader
3140
from pandas_datareader.tiingo import (
3241
TiingoDailyReader,
3342
TiingoIEXHistoricalReader,
3443
TiingoQuoteReader,
3544
)
3645
from pandas_datareader.yahoo.actions import YahooActionReader, YahooDivReader
37-
from pandas_datareader.yahoo.components import _get_data as get_components_yahoo
46+
from pandas_datareader.yahoo.components import (
47+
_get_data as get_components_yahoo,
48+
)
3849
from pandas_datareader.yahoo.daily import YahooDailyReader
3950
from pandas_datareader.yahoo.options import Options as YahooOptions
4051
from pandas_datareader.yahoo.quotes import YahooQuotesReader

pandas_datareader/econdb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pandas as pd
2+
23
from pandas_datareader.base import _BaseReader
34

45

@@ -27,12 +28,12 @@ def read(self):
2728
if self._show == "labels":
2829

2930
def show_func(x):
30-
return x[x.find(':')+1:]
31+
return x[x.find(":") + 1 :]
3132

3233
elif self._show == "codes":
3334

3435
def show_func(x):
35-
return x[:x.find(':')]
36+
return x[: x.find(":")]
3637

3738
for entry in results:
3839
series = pd.DataFrame(entry["data"])[["dates", "values"]].set_index("dates")
@@ -44,8 +45,7 @@ def show_func(x):
4445
names=[show_func(x) for x in head.keys()],
4546
)
4647
else:
47-
series.rename(
48-
columns={"values": entry['ticker']}, inplace=True)
48+
series.rename(columns={"values": entry["ticker"]}, inplace=True)
4949

5050
if not df.empty:
5151
df = df.merge(series, how="outer", left_index=True, right_index=True)

pandas_datareader/iex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
2+
from urllib.parse import urlencode
23

34
import pandas as pd
4-
from urllib.parse import urlencode
55

66
from pandas_datareader.base import _BaseReader
77

pandas_datareader/moex.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
import pandas as pd
44

55
from pandas_datareader.base import _DailyBaseReader
6-
from pandas_datareader.compat import StringIO, binary_type, concat, is_list_like
6+
from pandas_datareader.compat import (
7+
StringIO,
8+
binary_type,
9+
concat,
10+
is_list_like,
11+
)
712

813

914
class MoexReader(_DailyBaseReader):

pandas_datareader/robinhood.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import pandas as pd
22

33
from pandas_datareader.base import _BaseReader
4-
from pandas_datareader.exceptions import DEP_ERROR_MSG, ImmediateDeprecationError
4+
from pandas_datareader.exceptions import (
5+
DEP_ERROR_MSG,
6+
ImmediateDeprecationError,
7+
)
58

69

710
class RobinhoodQuoteReader(_BaseReader):

pandas_datareader/tests/test_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime as dt
2+
23
import pytest
34
import requests
45

pandas_datareader/tests/test_econdb.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def test_get_tourism(self):
5050
)
5151
index = pd.date_range("2008-01-01", "2012-01-01", freq="AS", name="TIME_PERIOD")
5252

53-
5453
# check the values coming back are equal
5554
np.testing.assert_array_equal(df.values[:, 0], jp)
5655
np.testing.assert_array_equal(df.values[:, 1], us)
@@ -62,7 +61,9 @@ def test_get_tourism(self):
6261
values, index=index, name="Total international arrivals"
6362
)
6463
tm.assert_series_equal(
65-
df[label]['Tourism demand surveys']["Total international arrivals"], expected)
64+
df[label]["Tourism demand surveys"]["Total international arrivals"],
65+
expected,
66+
)
6667

6768
def test_bls(self):
6869
# BLS
@@ -76,13 +77,19 @@ def test_bls(self):
7677

7778
assert df.loc["2010-05-01"][0] == 217.3
7879

79-
8080
def test_australia_gdp(self):
8181

8282
df = web.DataReader(
83-
'dataset=ABS_GDP&to=2019-09-01&from=1959-09-01&h=TIME&v=Indicator',
84-
'econdb')
85-
assert df.loc[
86-
'2017-10-01',
87-
('GDP per capita: Current prices - National Accounts',
88-
'Seasonally Adjusted', 'AUD')] == 18329
83+
"dataset=ABS_GDP&to=2019-09-01&from=1959-09-01&h=TIME&v=Indicator", "econdb"
84+
)
85+
assert (
86+
df.loc[
87+
"2017-10-01",
88+
(
89+
"GDP per capita: Current prices - National Accounts",
90+
"Seasonally Adjusted",
91+
"AUD",
92+
),
93+
]
94+
== 18329
95+
)

pandas_datareader/tests/test_robinhood.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
import pandas as pd
33
import pytest
44

5-
from pandas_datareader.robinhood import RobinhoodHistoricalReader, RobinhoodQuoteReader
5+
from pandas_datareader.robinhood import (
6+
RobinhoodHistoricalReader,
7+
RobinhoodQuoteReader,
8+
)
69

710
syms = ["GOOG", ["GOOG", "AAPL"]]
811
ids = list(map(str, syms))

0 commit comments

Comments
 (0)