-
Notifications
You must be signed in to change notification settings - Fork 1
/
US_bnd_CFD.cfg
executable file
·110 lines (85 loc) · 3.36 KB
/
US_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
"""
Config file for CFDscraper
Name: US bond 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.
Note: For now I am leaving the 10-year row because it is already covered
by the World_Bonds.cfg
Rate:
Data is updated every 10 seconds.
"""
dataname = 'US_bnd_CFD'
logpath = dataname + '_scrape.log'
chromepath = '/Users/jonathanamorris/Code/chromedriver'
browser_choice = 'phantomjs' # Choose chrome, firefox, or phantomjs
phantom_log_path = dataname + '_phantomjs.log'
# Database info:
db_host = 'dataserve.local'
db_user = 'jonathan'
db_pass = "poop"
db_name = 'mydb'
db_dialect = 'mysql+pymysql'
# Page info:
page_source_timeout = 5 # int() in seconds. How long before driver refresh.
browser_lifetime = 1680 # In seconds. 14400 is four hours.
base_url = 'http://www.investing.com'
url_string = base_url + '/rates-bonds/usa-government-bonds?maturity_from=10&maturity_to=290'
web_tz = 'GMT'
# Table info:
attribute = {'id': 'cr1'}
time_col = "UTCTime"
row_title_column = 'Pair' # 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 = ("US_1m_bnd_CFD",
(("UTCTime", "U.S. 1-Month", "Time"),
("Value", "U.S. 1-Month", "Yield")))
bootstrap_list.append(bootstrap1)
bootstrap2 = ("US_3m_bnd_CFD",
(("UTCTime", "U.S. 3-Month", "Time"),
("Value", "U.S. 3-Month", "Yield")))
bootstrap_list.append(bootstrap2)
bootstrap3 = ("US_6m_bnd_CFD",
(("UTCTime", "U.S. 6-Month", "Time"),
("Value", "U.S. 6-Month", "Yield")))
bootstrap_list.append(bootstrap3)
bootstrap4 = ("US_1y_bnd_CFD",
(("UTCTime", "U.S. 1-Year", "Time"),
("Value", "U.S. 1-Year", "Yield")))
bootstrap_list.append(bootstrap4)
bootstrap5 = ("US_2y_bnd_CFD",
(("UTCTime", "U.S. 2-Year", "Time"),
("Value", "U.S. 2-Year", "Yield")))
bootstrap_list.append(bootstrap5)
bootstrap6 = ("US_3y_bnd_CFD",
(("UTCTime", "U.S. 3-Year", "Time"),
("Value", "U.S. 3-Year", "Yield")))
bootstrap_list.append(bootstrap6)
bootstrap7 = ("US_5y_bnd_CFD",
(("UTCTime", "U.S. 5-Year", "Time"),
("Value", "U.S. 5-Year", "Yield")))
bootstrap_list.append(bootstrap7)
bootstrap8 = ("US_7y_bnd_CFD",
(("UTCTime", "U.S. 7-Year", "Time"),
("Value", "U.S. 7-Year", "Yield")))
bootstrap_list.append(bootstrap8)
bootstrap9 = ("US_30y_bnd_CFD",
(("UTCTime", "U.S. 30-Year", "Time"),
("Value", "U.S. 30-Year", "Yield")))
bootstrap_list.append(bootstrap9)
# bootstrap_list.sort()