All Projects → Crypto-toolbox → Btfxwss

Crypto-toolbox / Btfxwss

Licence: mit
Bitfinex Websocket API Client written in Python3

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Btfxwss

Time Series Machine Learning
Machine learning models for time series analysis
Stars: ✭ 261 (-10.92%)
Mutual labels:  cryptocurrency
Elixium core
A privacy-preserving decentralized application network
Stars: ✭ 274 (-6.48%)
Mutual labels:  cryptocurrency
Cryptofinance Google Sheets Add On
CRYPTOFINANCE() — The easiest way to get cryptocurrencies prices and more in Google Sheets.
Stars: ✭ 281 (-4.1%)
Mutual labels:  cryptocurrency
Tai
A composable, real time, market data and trade execution toolkit. Built with Elixir, runs on the Erlang virtual machine
Stars: ✭ 264 (-9.9%)
Mutual labels:  cryptocurrency
Cryptocurrency Price Prediction
Cryptocurrency Price Prediction Using LSTM neural network
Stars: ✭ 271 (-7.51%)
Mutual labels:  cryptocurrency
Cryptocurrency Analysis Python
Open-Source Tutorial For Analyzing and Visualizing Cryptocurrency Data
Stars: ✭ 278 (-5.12%)
Mutual labels:  cryptocurrency
Road2blockchain
180天搞懂区块链。 区块链的浪潮已来, 当一个弄潮儿,随时准备冲上浪潮之巅。(由于时间精力的原因, 项目暂时搁置,不再更新。 抱歉, 有一腔热情,但是吹下的牛逼没有按时完成。不过对区块链依然保持关注, 欢迎大家关注公众号allinblockchain)
Stars: ✭ 254 (-13.31%)
Mutual labels:  cryptocurrency
Awesome Cryptoeconomics
📚 A curated collection of links for cryptoeconomists
Stars: ✭ 291 (-0.68%)
Mutual labels:  cryptocurrency
Uniswap V2 Periphery
🎚 Peripheral smart contracts for interacting with Uniswap V2
Stars: ✭ 267 (-8.87%)
Mutual labels:  cryptocurrency
51bitquant
51bitquant Python数字货币量化交易视频 CCXT框架 爬取交易所数据 比特币量化交易 交易机器人51bitquant tradingbot cryptocurrency quantitative trading btc trading
Stars: ✭ 284 (-3.07%)
Mutual labels:  cryptocurrency
Cryptocurrency Analysis
Analysis and visualisation of the cryptocurrency market
Stars: ✭ 264 (-9.9%)
Mutual labels:  cryptocurrency
Celo Monorepo
Official repository for core projects comprising the Celo platform
Stars: ✭ 269 (-8.19%)
Mutual labels:  cryptocurrency
Nano Node
Nano is a cryptocurrency
Stars: ✭ 3,336 (+1038.57%)
Mutual labels:  cryptocurrency
Binance Api Node
💹 A complete and heavily tested wrapper with typings for the Binance API.
Stars: ✭ 260 (-11.26%)
Mutual labels:  cryptocurrency
Desktop Wallet
💻 Multi Platform ARK Desktop Wallet
Stars: ✭ 287 (-2.05%)
Mutual labels:  cryptocurrency
Go Vite
Official Go implementation of the Vite protocol
Stars: ✭ 257 (-12.29%)
Mutual labels:  cryptocurrency
Pycoingecko
Python wrapper for the CoinGecko API
Stars: ✭ 270 (-7.85%)
Mutual labels:  cryptocurrency
Optimal Buy Cbpro
Scheduled buying of BTC, ETH, and LTC from Coinbase Pro, optimally!
Stars: ✭ 288 (-1.71%)
Mutual labels:  cryptocurrency
Pywallet
Dead-simple BIP32 (HD) wallet creation for BTC, BTG, BCH, LTC, DASH, USDT, QTUM and DOGE
Stars: ✭ 286 (-2.39%)
Mutual labels:  cryptocurrency
Cryptowatch
🐦 Cryptocurrency price and account balance monitor
Stars: ✭ 283 (-3.41%)
Mutual labels:  cryptocurrency

BTFXWSSBuild Status

Client for Bitfinex Websocket API written in Python

Currently supports all public endpoints; authenticated channels are a work in progress, but are supported.

Offers graceful exception handling of common server errors. Make sure you check the log messages and have proper logging enabled, as there are no exceptions thrown.

Data is stored within BtfxWss as Queues. There are convenience methods available to retrieve a queue for a given type. Consult the code for more documentation.

Please note that you must take care of handling data in the queues yourself! Not doing so will eventually result in MemoryErrors, since the queues do not have a maximum length defined.

Installation

Via pip:

pip install btfxwss

Usage

import logging
import time
import sys

from btfxwss import BtfxWss
    
log = logging.getLogger(__name__)

fh = logging.FileHandler('test.log')
fh.setLevel(logging.DEBUG)
sh = logging.StreamHandler(sys.stdout)
sh.setLevel(logging.DEBUG)

log.addHandler(sh)
log.addHandler(fh)
logging.basicConfig(level=logging.DEBUG, handlers=[fh, sh])
    

wss = BtfxWss()
wss.start()

while not wss.conn.connected.is_set():
    time.sleep(1)

# Subscribe to some channels
wss.subscribe_to_ticker('BTCUSD')
wss.subscribe_to_order_book('BTCUSD')

# Do something else
t = time.time()
while time.time() - t < 10:
    pass

# Accessing data stored in BtfxWss:
ticker_q = wss.tickers('BTCUSD')  # returns a Queue object for the pair.
while not ticker_q.empty():
    print(ticker_q.get())

# Unsubscribing from channels:
wss.unsubscribe_from_ticker('BTCUSD')
wss.unsubscribe_from_order_book('BTCUSD')

# Shutting down the client:
wss.stop()

Your help is required

If you find any bugs, error or have feature requests, please don't hesitate to open an issue. Be as descriptive as possible, and I'll look into the matter as soon as I can.

Looking for a REST client?

Checkout BitEx, a python-based Framework for connecting to a variety of Bitcoin exchanges, including Bitfinex!

Thanks

A big thanks to the devs providing the websocket-client <https://github.com/websocket-client/websocket-client> library, as well ekulyk for providing the PythonPusherClient, which I used as a reference for the connection class. And finally, a big thanks to all the people submitting issues, discussing solutions and simply starring the project - you all help me stay excited and motivated for this project! Cheers to you.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].