Skip to content

Commit

Permalink
added examples/py/basic-rate-limiting.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Dec 19, 2017
1 parent 9917d27 commit 87b5468
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/py/basic-rate-limiting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-

from pprint import pprint

import os
import sys

root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')

import ccxt # noqa: E402


symbol = 'ETH/BTC'

exchange = ccxt.poloniex({
'enableRateLimit': True, # or .enableRateLimit = True later
})

# print 10 times with appropriate delay
for i in range(0, 10):
print('--------------------------------------------------------------------')
ticker = exchange.fetch_ticker(symbol)
ticker = exchange.omit(ticker, 'info')
pprint(ticker)

0 comments on commit 87b5468

Please sign in to comment.