heartrithm / exchanges

Clean python library for communicating with cryptocurrency exchanges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exchange APIs

CircleCI

Coverage Status

Reliably talk to supported exchange APIs, with a simple raw interface. Handles the barebones communication (authentication, HTTP handling, etc.), as well as some abstraction of common methods. Used in production at HeartRithm since 2017.

Features

  • Retry of GET requests upon failure, up to 3 times, with an exponential back-off
  • Robust handling of connection, timeout, and HTTP errors, with grouping to ExchangeApiException.
  • Parsing / handling of exchange error messages
  • Thorough tests with mocks
  • Proper python logging
  • High performance json parsing with ujson
  • Methods to standardize symbol/pair names across exchanges

Usage

Bitfinex

from exchanges import exchange_factory

# Public V2
client = exchange_factory("bitfinex")()
client.brequest(2, "platform/status")
# returns [1]

# Private V1
client = exchange_factory("bitfinex")("my key", "my secret")
result = client.brequest(1, "offer/cancel", authenticate=True, method="POST", data={"offer_id": 124124})

Supported Exchanges

  • Bitfinex, both V1 and V2 versions of the REST API
  • Binance spot API
  • SFOX
  • KuCoin
  • Shrimpy
  • Tardis

About

Clean python library for communicating with cryptocurrency exchanges


Languages

Language:Python 100.0%