diff --git a/collect-data/collect_trades.py b/collect-data/collect_trades.py index 6a67f30..e31aeb8 100644 --- a/collect-data/collect_trades.py +++ b/collect-data/collect_trades.py @@ -14,6 +14,9 @@ def format_trade(trade): + ''' + Formats trade data + ''' if all(key in trade for key in ('tid', 'amount', 'price', 'timestamp')): trade['_id'] = trade.pop('tid') trade['amount'] = float(trade['amount']) @@ -24,6 +27,9 @@ def format_trade(trade): def get_json(url): + ''' + Gets json from the API + ''' resp = urllib2.urlopen(url) return json.load(resp, object_hook=format_trade), resp.getcode()