-
Notifications
You must be signed in to change notification settings - Fork 1
/
world_bnd.CFD.cfg
152 lines (119 loc) · 4.6 KB
/
world_bnd.CFD.cfg
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
"""
Config file for CFDscraper
Name: World bonds rate CFDs
Source description:
investing.com hosts streaming rates for a number of instruments, including
bond rates and world stock indicies.
Quality:
This source skirts data license restrictions by using CFD data from off-
exchange bucket shops. Since rate data from bucket shops needs to be close
to the real value to avoid creating arbitrage opportunites, I suspect the
data is quite accurate.
Rate:
Data is updated every 10 seconds.
"""
dataname = 'world_bnd_CFD'
logpath = dataname + '_scrape.log'
chromepath = '/Users/jmorris/Code/chromedriver'
browser_choice = 'phantomjs' # Choose chrome, firefox, or phantomjs
phantom_log_path = dataname + '_phantomjs.log'
# Database info:
db_host = 'dataserve.local'
db_user = 'j'
db_pass = "poop"
db_name = 'mydb'
db_dialect = 'mysql+pymysql'
# Page info:
page_source_timeout = 5 # int() in seconds. How long before driver refersh.
browser_lifetime = 1680 # In seconds. 14400 is four hours.
base_url = 'http://www.investing.com'
url_string = base_url + '/rates-bonds/government-bond-spreads'
web_tz = 'GMT'
# Table info:
attribute = {'id': 'bonds'}
time_col = "UTCTime"
row_title_column = 'Country' # Need this to know index column.
refresh_rate = 10.5 # Minimum number of seconds between scrapes.
# Construct table form:
# bootstrap = (db_table_name,
# ((db_column1_name, web_row_string, web_col_string),
# (db_column2_name, web_row_string, web_col_string)))
# Timestamp column name is special and will be made primary key
# All others will be Float by default.
# The timestamp column, whatever its dytpe, must be the first for
# everything to work.
###### Tables list ############################################################
bootstrap_list = []
bootstrap1 = ("DE_10y_bnd_CFD",
(("UTCTime", "Germany", "Time"),
("Value", "Germany", "Yield")))
bootstrap_list.append(bootstrap1)
bootstrap2 = ("ES_10y_bnd_CFD",
(("UTCTime", "Spain", "Time"),
("Value", "Spain", "Yield")))
bootstrap_list.append(bootstrap2)
bootstrap3 = ("US_10y_bnd_CFD",
(("UTCTime", "United States", "Time"),
("Value", "United States", "Yield")))
bootstrap_list.append(bootstrap3)
bootstrap4 = ("FR_10y_bnd_CFD",
(("UTCTime", "France", "Time"),
("Value", "France", "Yield")))
bootstrap_list.append(bootstrap4)
bootstrap5 = ("JP_10y_bnd_CFD",
(("UTCTime", "Japan", "Time"),
("Value", "Japan", "Yield")))
bootstrap_list.append(bootstrap5)
bootstrap6 = ("AU_10y_bnd_CFD",
(("UTCTime", "Australia", "Time"),
("Value", "Australia", "Yield")))
bootstrap_list.append(bootstrap6)
bootstrap7 = ("IT_10y_bnd_CFD",
(("UTCTime", "Italy", "Time"),
("Value", "Italy", "Yield")))
bootstrap_list.append(bootstrap7)
bootstrap8 = ("PT_10y_bnd_CFD",
(("UTCTime", "Portugal", "Time"),
("Value", "Portugal", "Yield")))
bootstrap_list.append(bootstrap8)
bootstrap9 = ("AT_10y_bnd_CFD",
(("UTCTime", "Austria", "Time"),
("Value", "Austria", "Yield")))
bootstrap_list.append(bootstrap9)
bootstrap10 = ("BE_10y_bnd_CFD",
(("UTCTime", "Belgium", "Time"),
("Value", "Belgium", "Yield")))
bootstrap_list.append(bootstrap10)
bootstrap11 = ("CA_10y_bnd_CFD",
(("UTCTime", "Canada", "Time"),
("Value", "Canada", "Yield")))
bootstrap_list.append(bootstrap11)
bootstrap12 = ("CN_10y_bnd_CFD",
(("UTCTime", "China", "Time"),
("Value", "China", "Yield")))
bootstrap_list.append(bootstrap12)
bootstrap13 = ("HR_10y_bnd_CFD",
(("UTCTime", "Croatia", "Time"),
("Value", "Croatia", "Yield")))
bootstrap_list.append(bootstrap13)
bootstrap14 = ("CZ_10y_bnd_CFD",
(("UTCTime", "Czech Republic", "Time"),
("Value", "Czech Republic", "Yield")))
bootstrap_list.append(bootstrap14)
bootstrap15 = ("DK_10y_bnd_CFD",
(("UTCTime", "Denmark", "Time"),
("Value", "Denmark", "Yield")))
bootstrap_list.append(bootstrap15)
bootstrap16 = ("FI_10y_bnd_CFD",
(("UTCTime", "Finland", "Time"),
("Value", "Finland", "Yield")))
bootstrap_list.append(bootstrap16)
bootstrap17 = ("GR_10y_bnd_CFD",
(("UTCTime", "Greece", "Time"),
("Value", "Greece", "Yield")))
bootstrap_list.append(bootstrap17)
bootstrap18 = ("HK_10y_bnd_CFD",
(("UTCTime", "Hong Kong", "Time"),
("Value", "Hong Kong", "Yield")))
bootstrap_list.append(bootstrap18)
bootstrap_list.sort()