@@ -137,54 +137,7 @@ def get_quote_yahoo(symbols):
137
137
138
138
139
139
def get_quote_google (symbols ):
140
- """
141
- Get current yahoo quote
142
-
143
- Returns a DataFrame
144
- """
145
- if isinstance (symbols , str ):
146
- sym_list = symbols
147
- elif not isinstance (symbols , Series ):
148
- symbols = Series (symbols )
149
- sym_list = str .join ('+' , symbols )
150
- else :
151
- sym_list = str .join ('+' , symbols )
152
-
153
- # for codes see: http://www.gummy-stuff.org/Yahoo-data.htm
154
- codes = {'symbol' : 's' , 'last' : 'l1' , 'change_pct' : 'p2' , 'PE' : 'r' ,
155
- 'time' : 't1' , 'short_ratio' : 's7' }
156
- request = str .join ('' , codes .values ()) # code request string
157
- header = codes .keys ()
158
-
159
- data = dict (zip (codes .keys (), [[] for i in range (len (codes ))]))
160
-
161
- urlStr = 'http://finance.yahoo.com/d/quotes.csv?s=%s&f=%s' % (
162
- sym_list , request )
163
-
164
- try :
165
- lines = urllib2 .urlopen (urlStr ).readlines ()
166
- except Exception , e :
167
- s = "Failed to download:\n {0}" .format (e )
168
- print s
169
- return None
170
-
171
- for line in lines :
172
- fields = line .decode ('utf-8' ).strip ().split (',' )
173
- for i , field in enumerate (fields ):
174
- if field [- 2 :] == '%"' :
175
- data [header [i ]].append (float (field .strip ('"%' )))
176
- elif field [0 ] == '"' :
177
- data [header [i ]].append (field .strip ('"' ))
178
- else :
179
- try :
180
- data [header [i ]].append (float (field ))
181
- except ValueError :
182
- data [header [i ]].append (np .nan )
183
-
184
- idx = data .pop ('symbol' )
185
-
186
- return DataFrame (data , index = idx )
187
-
140
+ raise NotImplementedError ("Google Finance doesn't have this functionality" )
188
141
189
142
def _get_hist_yahoo (sym = None , start = None , end = None , retry_count = 3 ,
190
143
pause = 0 , ** kwargs ):
0 commit comments