Luno API for python
pip install pyluno
See the tests for detailed usage examples, but basically:
from pyluno.api import Luno
api = Luno(key, secret, options)
Where options
is dictions and can have any of the following keys and associated values:
option key | description | default |
---|---|---|
hostname | the API host | api.mybitx.com |
port | the TCP port to attach to | 443 |
pair | The currency pair to provide results for | XBTZAR |
ca | The root certificate | None |
timeout | The maximum time to wait for requests | 30 (s) |
maxRate | The maximum number of calls per second. Set to None to deactivate | 1 |
maxBurst | Number of call that can be made without being rate limited. After this number is exceeded the accumulated time is waited. Set to 1 to deactivate bursts. Irrelevant if maxRate is None | 5 |
api.market.get_ticker()
Returns: dictionary containing the latest ticker values
api.market.get_all_tickers()
Returns: dictionary containing the latest ticker values for all currency pairs
- Rates published on the Luno website aren't accurate- your milliage may vary
- Not all error handling has been handled
This repo was called pybitc and made by @CjS77. It has since been updated and adapted and gone though a name change
- Tests for some of the endpoints needing dynamic reponses
- Tests for the rate limiter
- Fork it
- Contribute
- Be Awesome