Clean up the frequency options in console command

This commit is contained in:
Gavin.Chan
2018-03-02 14:50:02 +00:00
parent 0df8bc95bf
commit 6c8f0188ea
2 changed files with 4 additions and 4 deletions
-2
View File
@@ -5,8 +5,6 @@
"""Top-level package for libcryptomarket."""
from libcryptomarket.exchange import *
from libcryptomarket.instrument import instruments
from libcryptomarket.order_book import order_book
from libcryptomarket.candle import (
candles, latest_candles, FREQUENCY_TO_SEC_DICT)
import libcryptomarket.candle.inject
+4 -2
View File
@@ -5,10 +5,12 @@ import pandas as pd
# pylint: disable-msg=W0401
from libcryptomarket.exchange import * # flake8: noqa
from libcryptomarket import FREQUENCY_TO_SEC_DICT
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
FREQUENCIES = ['1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1d',
'1w', '2w', '1M', ]
def get_args():
"""Get input arguments.
@@ -22,7 +24,7 @@ def get_args():
type=str, nargs='+', required=True)
parser.add_argument('--frequency', action='store', dest='frequency',
help='Frequency.',
choices=list(FREQUENCY_TO_SEC_DICT.keys()),
choices=list(FREQUENCIES),
required=True)
parser.add_argument('--start-time', action='store', dest='start_time',
help='Start time in format of \'YYYY-MM-DD\'',