Metadata-Version: 2.1
Name: topbid
Version: 1.2.0
Summary: Helper library to fetch current best bid/ask from crypto exchanges orderbook APIs
Home-page: https://github.com/tferreira/topbid
Author: Thomas Ferreira
Author-email: fulura@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: request-boost (==0.6)
Requires-Dist: requests (==2.28.2)
Provides-Extra: dev
Requires-Dist: black (==22.12.0) ; extra == 'dev'
Requires-Dist: build (==0.10.0) ; extra == 'dev'
Requires-Dist: pylint (==2.15.10) ; extra == 'dev'
Requires-Dist: pytest (==7.2.1) ; extra == 'dev'
Requires-Dist: responses (==0.22.0) ; extra == 'dev'
Requires-Dist: twine (==4.0.2) ; extra == 'dev'

# topbid

[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/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

```python
>>> 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
```
