Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 624 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 624 Bytes

timeseries2redis

python pandas timeseries store of tick data to redis

>>> from timeseries2redis import TickData
>>> ts = TickData("B")

>>> date = datetime.datetime.fromtimestamp(int(time.time()))
>>> price = random.randint(10,100)
>>> data = {"date": date,
>>>      "bid": price,
>>>      "ask": price,
>>>      "volume": 1000,
>>>      "count": 1}
>>> ts.set(data)

>>> ts.get(-5)
ask	bid	count	volume
date				
2016-04-20 13:02:32	31	31	1	1000
2016-04-20 13:02:32	34	34	1	1000
2016-04-20 13:02:32	48	48	1	1000
2016-04-20 13:02:32	11	11	1	1000
2016-04-20 13:02:32	35	35	1	1000