Resolve request-candles script after migration

This commit is contained in:
Gavin.Chan
2018-03-02 14:03:48 +00:00
parent cc2927ed52
commit b747e01919
3 changed files with 23 additions and 49 deletions
+8 -6
View File
@@ -3,7 +3,7 @@ import logging
import pandas as pd
from libcryptomarket.core import candles, FREQUENCY_TO_SEC_DICT
from libcryptomarket import *
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
@@ -51,13 +51,15 @@ def main():
all_data = {}
exchange = globals()[args.exchange.lower()]
for symbol in args.symbols:
logging.info('Querying symbol %s...', symbol)
data = candles(source=args.exchange,
symbol=symbol,
start_time=start_time,
end_time=end_time,
frequency=args.frequency)
data = exchange().fetch_candles(
symbol=symbol,
start_time=start_time,
end_time=end_time,
frequency=args.frequency)
all_data[symbol] = data.set_index(['start_time'], ['end_time'])
logging.info('Cleaning the data...')
+14 -42
View File
@@ -5,8 +5,8 @@
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2018-02-25T15:25:54.826490Z",
"start_time": "2018-02-25T15:25:54.202778Z"
"end_time": "2018-03-02T13:59:06.716302Z",
"start_time": "2018-03-02T13:59:06.040476Z"
}
},
"outputs": [],
@@ -29,11 +29,11 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2018-02-27T14:08:40.924686Z",
"start_time": "2018-02-27T14:08:32.436437Z"
"end_time": "2018-03-02T13:59:16.182130Z",
"start_time": "2018-03-02T13:59:06.746957Z"
},
"scrolled": true
},
@@ -42,9 +42,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Running exchange <ccxt.poloniex.poloniex object at 0x7f6a1f15d3c8> for instrument LTC/BTC\n",
"Running exchange <ccxt.bitfinex2.bitfinex2 object at 0x7f6a1f15d400> for instrument BTC/USD\n",
"Running exchange <ccxt.gdax.gdax object at 0x7f6a1f151898> for instrument BTC/USD\n"
"Running exchange <ccxt.poloniex.poloniex object at 0x7fe1ff38a6d8> for instrument LTC/BTC\n",
"Running exchange <ccxt.bitfinex2.bitfinex2 object at 0x7fe1d3009240> for instrument BTC/USD\n",
"Running exchange <ccxt.gdax.gdax object at 0x7fe1d3013470> for instrument BTC/USD\n"
]
}
],
@@ -71,24 +71,9 @@
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"ExecuteTime": {
"end_time": "2018-02-27T14:12:49.988940Z",
"start_time": "2018-02-27T14:12:33.771357Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Running exchange <ccxt.poloniex.poloniex object at 0x7f6a1f20db70> for instrument ['LTC/BTC', 'ETH/BTC']\n",
"Running exchange <ccxt.bitfinex2.bitfinex2 object at 0x7f6a1f03be10> for instrument ['BTC/USD', 'ETH/USD']\n",
"Running exchange <ccxt.gdax.gdax object at 0x7f6a1efec400> for instrument ['BTC/USD', 'ETH/USD']\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import libcryptomarket\n",
"\n",
@@ -111,22 +96,9 @@
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"ExecuteTime": {
"end_time": "2018-02-27T14:16:10.738926Z",
"start_time": "2018-02-27T14:16:06.651033Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Running exchange <ccxt.poloniex.poloniex object at 0x7f6a1f0d5eb8> for instrument ['BTC/USDT']\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import libcryptomarket\n",
"\n",
+1 -1
View File
@@ -14,7 +14,7 @@ with open('HISTORY.rst') as history_file:
requirements = [
'ccxt==1.10.1198',
'pandas>=0.20.0',
'requests==2.11.0',
'requests[security]',
'setuptools_scm',
]