Continuation of: https://github.com/scottjbarr/bitfinex
A Python client for the Bitfinex API v1 and v2 + websockets for v2.
Functionality related to nonces has been changed in release 1.0.0. This might cause existing keys that where used on earlier version of this library to stop working due to a "nonce too small" error.
Either create a new key/secret to use with 1.0.0 or use a nonce multiplier of 100000 (100k).
pip install bitfinex-v2
from bitfinex import WssClient, ClientV2, ClientV1
def my_handler(message):
# Here you can do stuff with the messages
print(message)
my_client = WssClient()
my_client.subscribe_to_ticker(
symbol="BTCUSD",
callback=my_handler
)
my_client.start()
The full documentation is available here: https://bitfinex.readthedocs.io/en/latest/
This code has been tested on
At the moment the library is only supported from 3.6 and above.
Contributions are welcome and i will do my best to merge PR quickly.
Here are some guidelines that makes everything easier for everybody:
Install the requirements:
pip install -r requirements.txt
This projects uses pytest, so to run all the tests use:
pytest -v
At the moment functionality related to websocket v2 is not properly tested.
The MIT License (MIT)
Copyright (c) 2014-2015 Scott Barr ^ Original project created by this guy.
See LICENSE.md