Skip to main content

Helper library to fetch current best bid/ask from crypto exchanges orderbook APIs

Project description

topbid

Python 3.8 Code style: black

Helper library to fetch and store current orderbook top bid/ask price and volume from crypto exchanges APIs. Currently supports Binance, Gateio, Kraken and Kucoin.

Requires Python 3.8+

Installation

pip install topbid

Usage

>>> from topbid.orderbook import OrderBook

>>> orderbook = OrderBook("cryptocompare-api-key", ["binance", "kucoin"])
2023-01-01 13:37:00,000 - topbid_orderbook - INFO - Saved mappings from CryptoCompare API for exchange binance
2023-01-01 13:37:00,000 - topbid_orderbook - INFO - Saved mappings from CryptoCompare API for exchange kucoin

>>> orderbook.add("binance", "BTC/USDT")

>>> orderbook.start(update_every=2)

>>> orderbook.get_orderbook_top_bid("binance", "BTC/USDT")
(23130.41, 0.0584)

>>> orderbook.get_orderbook_top_ask("binance", "BTC/USDT")
(23130.43, 0.0214)

>>> orderbook.delete("binance", "BTC/USDT")

>>> orderbook.stop()

Build

python -m build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topbid-1.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

topbid-1.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file topbid-1.2.0.tar.gz.

File metadata

  • Download URL: topbid-1.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for topbid-1.2.0.tar.gz
Algorithm Hash digest
SHA256 48f30a41d03b814a095827c62c30c5ad43fc6b6d4296645ae0b454b5a91fa8b0
MD5 a89b96c91b500d7d2416dfe148d5aacc
BLAKE2b-256 1e15fc6de69975da2d1fcc78e88ba3f15c1582184e39030ac36abd6da93391ff

See more details on using hashes here.

File details

Details for the file topbid-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: topbid-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for topbid-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88e3759f78cc51c94059eb35b21337c3045b97d88731f62bbec4833a60f58fca
MD5 2d63a62d0e6a68fb80f9202fa5fba63a
BLAKE2b-256 3036ce2b0a6d70a1d2f70bc98aaa53dab01115a8ff6cd9dba2773493233216a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page