Added candle type to ohlcv_get_available_data

This commit is contained in:
Sam Germain
2021-11-20 22:46:47 -06:00
parent b4029533ec
commit 64a6abc541
5 changed files with 31 additions and 17 deletions

View File

@@ -28,9 +28,13 @@ class HDF5DataHandler(IDataHandler):
:param datadir: Directory to search for ohlcv files
:return: List of Tuples of (pair, timeframe)
"""
_tmp = [re.search(r'^([a-zA-Z_]+)\-(\d+\S+)(?=.h5)', p.name)
for p in datadir.glob("*.h5")]
return [(match[1].replace('_', '/'), match[2]) for match in _tmp
_tmp = [
re.search(
r'^([a-zA-Z_]+)\-(\d+\S)\-?([a-zA-Z_]*)?(?=.h5)',
p.name
) for p in datadir.glob("*.h5")
]
return [(match[1].replace('_', '/'), match[2], match[3]) for match in _tmp
if match and len(match.groups()) > 1]
@classmethod

View File

@@ -29,9 +29,12 @@ class JsonDataHandler(IDataHandler):
:param datadir: Directory to search for ohlcv files
:return: List of Tuples of (pair, timeframe)
"""
_tmp = [re.search(r'^([a-zA-Z_]+)\-(\d+\S+)(?=.json)', p.name)
for p in datadir.glob(f"*.{cls._get_file_extension()}")]
return [(match[1].replace('_', '/'), match[2]) for match in _tmp
_tmp = [
re.search(
r'^([a-zA-Z_]+)\-(\d+\S)\-?([a-zA-Z_]*)?(?=.json)',
p.name
) for p in datadir.glob(f"*.{cls._get_file_extension()}")]
return [(match[1].replace('_', '/'), match[2], match[3]) for match in _tmp
if match and len(match.groups()) > 1]
@classmethod