From 37f6c213f619717dfe2a05f4abe5d92f2bbd9f31 Mon Sep 17 00:00:00 2001 From: dertione Date: Fri, 13 Oct 2017 15:50:50 +0200 Subject: [PATCH 1/3] fork test --- freqtrade/tests/testdata/download_backtest_data.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 freqtrade/tests/testdata/download_backtest_data.py diff --git a/freqtrade/tests/testdata/download_backtest_data.py b/freqtrade/tests/testdata/download_backtest_data.py new file mode 100644 index 000000000..463087588 --- /dev/null +++ b/freqtrade/tests/testdata/download_backtest_data.py @@ -0,0 +1,13 @@ +#!/usr/bin/python3.6 + +from urllib.request import urlopen + +currencies = ["ok","neo","dash","etc","eth","snt"] + +for cur in currencies: + url = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-'+cur+'&tickInterval=fiveMin' + x = urlopen(url) + data = x.read() + str2 = str(data,'utf-8') + with open("btc-"+cur+".json", "w") as fichier: + fichier.write(str2) From afd1a0bf9b2d8bce712018c09bdfd230aea2bf6d Mon Sep 17 00:00:00 2001 From: dertione Date: Sat, 14 Oct 2017 14:40:26 +0200 Subject: [PATCH 2/3] update for pylint --- .../tests/testdata/download_backtest_data.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/freqtrade/tests/testdata/download_backtest_data.py b/freqtrade/tests/testdata/download_backtest_data.py index 463087588..6aef5f9f0 100644 --- a/freqtrade/tests/testdata/download_backtest_data.py +++ b/freqtrade/tests/testdata/download_backtest_data.py @@ -1,13 +1,16 @@ -#!/usr/bin/python3.6 +"""This module download automatically json data of crypto currencies in bittrex""" +#!/usr/bin/env python3 from urllib.request import urlopen -currencies = ["ok","neo","dash","etc","eth","snt"] +CURRENCIES = ["ok", "neo", "dash", "etc", "eth", "snt"] -for cur in currencies: - url = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-'+cur+'&tickInterval=fiveMin' +for cur in CURRENCIES: + url1 = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-' + url2 = '&tickInterval=fiveMin' + url = url1+cur+url2 x = urlopen(url) - data = x.read() - str2 = str(data,'utf-8') - with open("btc-"+cur+".json", "w") as fichier: - fichier.write(str2) + json_data = x.read() + json_str = str(json_data, 'utf-8') + with open("btc-"+cur+".json", "w") as file: + file.write(json_str) From 389f9b45bb49d9f9fe69ed6d4e0ffbcec207135b Mon Sep 17 00:00:00 2001 From: dertione Date: Sun, 15 Oct 2017 17:24:49 +0200 Subject: [PATCH 3/3] update pylint 10/10 --- .../tests/testdata/download_backtest_data.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/freqtrade/tests/testdata/download_backtest_data.py b/freqtrade/tests/testdata/download_backtest_data.py index 6aef5f9f0..1119aac42 100644 --- a/freqtrade/tests/testdata/download_backtest_data.py +++ b/freqtrade/tests/testdata/download_backtest_data.py @@ -1,16 +1,16 @@ -"""This module download automatically json data of crypto currencies in bittrex""" #!/usr/bin/env python3 +"""This script generate json data from bittrex""" + from urllib.request import urlopen CURRENCIES = ["ok", "neo", "dash", "etc", "eth", "snt"] for cur in CURRENCIES: - url1 = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-' - url2 = '&tickInterval=fiveMin' - url = url1+cur+url2 - x = urlopen(url) - json_data = x.read() - json_str = str(json_data, 'utf-8') - with open("btc-"+cur+".json", "w") as file: - file.write(json_str) + url1 = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-' + url = url1+cur+'&tickInterval=fiveMin' + x = urlopen(url) + json_data = x.read() + json_str = str(json_data, 'utf-8') + with open('btc-'+cur+'.json', 'w') as file: + file.write(json_str)