3
3
from pandas_datareader .iex import IEX
4
4
5
5
# Data provided for free by IEX
6
- # Data is furnished in compliance with the guidelines promulgated in the IEX API terms of service and manual
7
- # See https://iextrading.com/api-exhibit-a/ for additional information and conditions of use
6
+ # Data is furnished in compliance with the guidelines promulgated in the IEX
7
+ # API terms of service and manual
8
+ # See https://iextrading.com/api-exhibit-a/ for additional information
9
+ # and conditions of use
8
10
9
11
10
12
class DailySummaryReader (IEX ):
11
13
def __init__ (self , symbols = None , start = None , end = None , retry_count = 3 ,
12
14
pause = 0.001 , session = None ):
13
15
self .curr_date = start
14
16
super (DailySummaryReader , self ).__init__ (symbols = symbols ,
15
- start = start , end = end ,
16
- retry_count = retry_count ,
17
- pause = pause , session = session )
17
+ start = start , end = end ,
18
+ retry_count = retry_count ,
19
+ pause = pause , session = session )
18
20
19
21
@property
20
22
def service (self ):
@@ -29,9 +31,10 @@ def _get_params(self, symbols):
29
31
return p
30
32
31
33
def read (self ):
32
- """Unfortunately, IEX's API can only retrieve data one day or one month at a time. Rather than specifying a date
33
- range, we will have to run the read function for each date provided.
34
-
34
+ """Unfortunately, IEX's API can only retrieve data one day or one month
35
+ at a time. Rather than specifying a date range, we will have to run
36
+ the read function for each date provided.
37
+
35
38
:return: DataFrame
36
39
"""
37
40
tlen = self .end - self .start
@@ -50,9 +53,10 @@ def __init__(self, symbols=None, start=None, end=None, retry_count=3,
50
53
self .date_format = '%Y%m'
51
54
52
55
super (MonthlySummaryReader , self ).__init__ (symbols = symbols ,
53
- start = start , end = end ,
54
- retry_count = retry_count ,
55
- pause = pause , session = session )
56
+ start = start , end = end ,
57
+ retry_count = retry_count ,
58
+ pause = pause ,
59
+ session = session )
56
60
57
61
@property
58
62
def service (self ):
@@ -67,16 +71,18 @@ def _get_params(self, symbols):
67
71
return p
68
72
69
73
def read (self ):
70
- """Unfortunately, IEX's API can only retrieve data one day or one month at a time. Rather than specifying a date
71
- range, we will have to run the read function for each date provided.
72
-
74
+ """Unfortunately, IEX's API can only retrieve data one day or one month
75
+ at a time. Rather than specifying a date range, we will have to run
76
+ the read function for each date provided.
77
+
73
78
:return: DataFrame
74
79
"""
75
80
tlen = self .end - self .start
76
81
dfs = []
77
82
78
83
# Build list of all dates within the given range
79
- lrange = [x for x in (self .start + timedelta (n ) for n in range (tlen .days ))]
84
+ lrange = [x for x in (self .start + timedelta (n )
85
+ for n in range (tlen .days ))]
80
86
81
87
mrange = []
82
88
for dt in lrange :
@@ -101,9 +107,9 @@ class RecordsReader(IEX):
101
107
def __init__ (self , symbols = None , start = None , end = None , retry_count = 3 ,
102
108
pause = 0.001 , session = None ):
103
109
super (RecordsReader , self ).__init__ (symbols = symbols ,
104
- start = start , end = end ,
105
- retry_count = retry_count ,
106
- pause = pause , session = session )
110
+ start = start , end = end ,
111
+ retry_count = retry_count ,
112
+ pause = pause , session = session )
107
113
108
114
@property
109
115
def service (self ):
@@ -118,9 +124,9 @@ class RecentReader(IEX):
118
124
def __init__ (self , symbols = None , start = None , end = None , retry_count = 3 ,
119
125
pause = 0.001 , session = None ):
120
126
super (RecentReader , self ).__init__ (symbols = symbols ,
121
- start = start , end = end ,
122
- retry_count = retry_count ,
123
- pause = pause , session = session )
127
+ start = start , end = end ,
128
+ retry_count = retry_count ,
129
+ pause = pause , session = session )
124
130
125
131
@property
126
132
def service (self ):
0 commit comments