-
Notifications
You must be signed in to change notification settings - Fork 679
/
Copy pathstooq.py
41 lines (34 loc) · 1.29 KB
/
stooq.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from pandas_datareader.base import _DailyBaseReader
class StooqDailyReader(_DailyBaseReader):
"""
Returns DataFrame/Panel of historical stock prices from symbols, over date
range, start to end. To avoid being penalized by Google Finance servers,
pauses between downloading 'chunks' of symbols can be specified.
Parameters
----------
symbols : string, array-like object (list, tuple, Series), or DataFrame
Single stock symbol (ticker), array-like object of symbols or
DataFrame with index containing stock symbols.
retry_count : int, default 3
Number of times to retry query request.
pause : int, default 0
Time, in seconds, to pause between consecutive queries of chunks. If
single value given for symbol, represents the pause between retries.
chunksize : int, default 25
Number of symbols to download consecutively before intiating pause.
session : Session, default None
requests.sessions.Session instance to be used
Notes
-----
See `Stooq <https://stooq.com>`__
"""
@property
def url(self):
"""API URL"""
return 'https://stooq.com/q/d/l/'
def _get_params(self, symbol):
params = {
's': symbol,
'i': "d"
}
return params