I have adapted the
@xeroc developed pricefeed script included within the python-graphenelib repository:
https://github.com/xeroc/python-graphenelib
If you are using this script, you may use the steps below as a guide to provide valid feeds for gold and silver.
1. Edit config.py to remove Yahoo as a feed provider for GOLD and SILVER (Yahoo is not providing a valid USD price at this time)
1.1 Locate the feedsources.Yahoo function
1.2 Comment out the XAU and XAG entries using the hash symbol
#"XAU" : "GOLD",
#"XAG" : "SILVER",
2. Ensure Quandl is enable as a feed provider for GOLD and SILVER
feedSources["quandl"] = feedsources.Quandl(datasets={ # You provide a valid API Key or this will fail!
"GOLD:USD": [
"WGC/GOLD_DAILY_USD",
"LBMA/GOLD",
"PERTH/GOLD_USD_D"
],
"SILVER:USD": [
"LBMA/SILVER",
"PERTH/SLVR_USD_D"
]
}
)
3. Acquire a Quandl API Key
3.1
http://help.quandl.com/article/118-how-do-i-pass-along-my-user-id-or-api-key3.2 It’s free, but requires a valid email account, GitHub account or other authentication provider
4. Edit config.py to add your Quandl API Key
quandlApiKey = "dsahFHUiewjjd" # This is an invalid API Key. Replace with yours!
5. Edit feedsources.py to include your Quandl API Key
5.1 Locate the Quandl URL string:
url = "https://www.quandl.com/api/v3/datasets/{dataset}.json?start_date={date}.format(
5.2 Modify the query string portion of the URL to include your API Key from the config.py file
url = "https://www.quandl.com/api/v3/datasets/{dataset}.json?start_date={date}&api_key=" + config.quandlApiKey.format(
These modifications should allow your witness to provide a valid feed for both gold and silver.
I know others are using the scripts from the
@wackou provided bts_tools repository:
https://github.com/wackou/bts_tools
I quickly glanced at this codebase, but did not locate Quandl as a feed provider. I will endeavor to scratch together some code for bts_tools as well.
Cheers!
Fox