1313from pandas_datareader .google .daily import GoogleDailyReader
1414from pandas_datareader .google .options import Options as GoogleOptions
1515from pandas_datareader .google .quotes import GoogleQuotesReader
16- from pandas_datareader .iex .market import MarketReader as IEXMarkets
17- from pandas_datareader .iex .ref import SymbolsReader as IEXSymbols
18- from pandas_datareader .iex .stats import DailySummaryReader as IEXHistorical
19- from pandas_datareader .iex .stats import MonthlySummaryReader as IEXMonthSummary
2016from pandas_datareader .iex .deep import Deep as IEXDeep
21- from pandas_datareader .iex .stats import RecentReader as IEXRecents
22- from pandas_datareader .iex .stats import RecordsReader as IEXRecords
2317from pandas_datareader .iex .tops import LastReader as IEXLasts
2418from pandas_datareader .iex .tops import TopsReader as IEXTops
2519from pandas_datareader .moex import MoexReader
3832 'get_data_fred' , 'get_data_google' , 'get_data_moex' ,
3933 'get_data_quandl' , 'get_data_yahoo' , 'get_data_yahoo_actions' ,
4034 'get_nasdaq_symbols' , 'get_quote_google' , 'get_quote_yahoo' ,
35+ 'get_tops_iex' , 'get_summary_iex' , 'get_records_iex' ,
36+ 'get_recent_iex' , 'get_markets_iex' , 'get_last_iex' ,
37+ 'get_iex_symbols' , 'get_iex_book' , 'get_dailysummary_iex' ,
4138 'get_data_stooq' , 'DataReader' ]
4239
4340
@@ -80,9 +77,11 @@ def get_data_quandl(*args, **kwargs):
8077def get_data_moex (* args , ** kwargs ):
8178 return MoexReader (* args , ** kwargs ).read ()
8279
80+
8381def get_data_stooq (* args , ** kwargs ):
8482 return StooqDailyReader (* args , ** kwargs ).read ()
8583
84+
8685def get_tops_iex (* args , ** kwargs ):
8786 return IEXTops (* args , ** kwargs ).read ()
8887
@@ -92,31 +91,118 @@ def get_last_iex(*args, **kwargs):
9291
9392
9493def get_markets_iex (* args , ** kwargs ):
95- return IEXMarkets (* args , ** kwargs ).read ()
94+ """
95+ Returns near-real time volume data across markets segregated by tape
96+ and including a percentage of overall volume during the session
97+
98+ This endpoint does not accept any parameters.
99+
100+ Reference: https://www.iextrading.com/developer/docs/#markets
101+
102+ :return: DataFrame
103+ """
104+ from pandas_datareader .iex .market import MarketReader
105+ return MarketReader (* args , ** kwargs ).read ()
96106
97107
98- def get_data_iex (* args , ** kwargs ):
99- return IEXHistorical (* args , ** kwargs ).read ()
108+ def get_dailysummary_iex (* args , ** kwargs ):
109+ """
110+ Returns a summary of daily market volume statistics. Without parameters,
111+ this will return the most recent trading session by default.
112+
113+ :param start:
114+ A datetime object - the beginning of the date range.
115+ :param end:
116+ A datetime object - the end of the date range.
117+
118+ Reference: https://www.iextrading.com/developer/docs/#historical-daily
119+
120+ :return: DataFrame
121+ """
122+ from pandas_datareader .iex .stats import DailySummaryReader
123+ return DailySummaryReader (* args , ** kwargs ).read ()
100124
101125
102126def get_summary_iex (* args , ** kwargs ):
103- return IEXMonthSummary (* args , ** kwargs ).read ()
127+ """
128+ Returns an aggregated monthly summary of market volume and a variety of
129+ related metrics for trades by lot size, security market cap, and venue.
130+ In the absence of parameters, this will return month-to-date statistics.
131+ For ranges spanning multiple months, this will return one row per month.
132+
133+ :param start:
134+ A datetime object - the beginning of the date range.
135+ :param end:
136+ A datetime object - the end of the date range.
137+
138+ :return: DataFrame
139+ """
140+ from pandas_datareader .iex .stats import MonthlySummaryReader
141+ return MonthlySummaryReader (* args , ** kwargs ).read ()
104142
105143
106144def get_records_iex (* args , ** kwargs ):
107- return IEXRecords (* args , ** kwargs ).read ()
145+ """
146+ Returns the record value, record date, recent value, and 30-day average for
147+ market volume, # of symbols traded, # of routed trades and notional value.
148+ This function accepts no additional parameters.
149+
150+ Reference: https://www.iextrading.com/developer/docs/#records
151+
152+ :return: DataFrame
153+ """
154+ from pandas_datareader .iex .stats import RecordsReader
155+ return RecordsReader (* args , ** kwargs ).read ()
108156
109157
110158def get_recent_iex (* args , ** kwargs ):
111- return IEXRecents (* args , ** kwargs ).read ()
159+ """
160+ Returns market volume and trade routing statistics for recent sessions.
161+ Also reports IEX's relative market share, lit share volume and a boolean
162+ halfday indicator.
163+
164+ Reference: https://www.iextrading.com/developer/docs/#recent
165+
166+ :return: DataFrame
167+ """
168+ from pandas_datareader .iex .stats import RecentReader
169+ return RecentReader (* args , ** kwargs ).read ()
112170
113171
114172def get_iex_symbols (* args , ** kwargs ):
115- return IEXSymbols (* args , ** kwargs ).read ()
173+ """
174+ Returns a list of all equity symbols available for trading on IEX. Accepts
175+ no additional parameters.
176+
177+ Reference: https://www.iextrading.com/developer/docs/#symbols
178+
179+ :return: DataFrame
180+ """
181+ from pandas_datareader .iex .ref import SymbolsReader
182+ return SymbolsReader (* args , ** kwargs ).read ()
116183
117184
118185def get_iex_book (* args , ** kwargs ):
119- return IEXDeep (* args , ** kwargs ).read ()
186+ """
187+ Returns an array of dictionaries with depth of book data from IEX for up to
188+ 10 securities at a time. Returns a dictionary of the bid and ask books.
189+
190+ :param symbols:
191+ A string or list of strings of valid tickers
192+ :param service:
193+ 'book': Live depth of book data
194+ 'op-halt-status': Checks to see if the exchange has instituted a halt
195+ 'security-event': Denotes individual security related event
196+ 'ssr-status': Short Sale Price Test restrictions, per reg 201 of SHO
197+ 'system-event': Relays current feed status (i.e. market open)
198+ 'trades': Retrieves recent executions, trade size/price and flags
199+ 'trade-breaks': Lists execution breaks for the current trading session
200+ 'trading-status': Returns status and cause codes for securities
201+
202+ :return: Object
203+ """
204+ from pandas_datareader .iex .deep import Deep
205+ return Deep (* args , ** kwargs ).read ()
120206
121207
122208def DataReader (name , data_source = None , start = None , end = None ,
@@ -146,7 +232,9 @@ def DataReader(name, data_source=None, start=None, end=None,
146232 single value given for symbol, represents the pause between retries.
147233 session : Session, default None
148234 requests.sessions.Session instance to be used
149-
235+ access_key : (str, None)
236+ Optional parameter to specify an API key for certain data sources.
237+
150238 Examples
151239 ----------
152240
@@ -159,7 +247,14 @@ def DataReader(name, data_source=None, start=None, end=None,
159247
160248 # Data from Google Finance
161249 aapl = DataReader("AAPL", "google")
162-
250+
251+ # Price and volume data from IEX
252+ tops = DataReader(["GS", "AAPL"], "iex-tops")
253+ # Top of book executions from IEX
254+ gs = DataReader("GS", "iex-last")
255+ # Real-time depth of book data from IEX
256+ gs = DataReader("GS", "iex-book")
257+
163258 # Data from FRED
164259 vix = DataReader("VIXCLS", "fred")
165260
@@ -183,6 +278,7 @@ def DataReader(name, data_source=None, start=None, end=None,
183278 return YahooActionReader (symbols = name , start = start , end = end ,
184279 retry_count = retry_count , pause = pause ,
185280 session = session ).read ()
281+
186282 elif data_source == "yahoo-dividends" :
187283 return YahooDivReader (symbols = name , start = start , end = end ,
188284 adjust_price = False , chunksize = 25 ,
0 commit comments