Skip to main content

Ccxw - CryptoCurrency eXchange Websocket Library

Project description

CCXW - CryptoCurrency eXchange Websocket Library

This library is designed to fetch data from exchange WebSocket APIs and store or update data in a temporary SQLite database in the background, making it readily accessible for retrieval.

Currently, it is available for several exchanges, including Binance, Bybit, and more. You can find a complete list of supported exchanges using Ccxw.get_supported_exchanges().

Furthermore, the library supports a variety of endpoints, such as order_book, kline, and more. A comprehensive list of supported endpoints can be found via Ccxw.get_supported_endpoints().

Example:

###Install

pip install ccxw

###Use

import time
import pprint
from ccxw import Ccxw

exchange = 'binance'
endpoint = 'order_book'
symbol = 'BTC/USDT'

wsm = Ccxw(exchange, endpoint, symbol, result_max_len=20)  # Create instance

wsm.start()  # Start getting data

time.sleep(2)  # Wait for available data

for i in range(0, 10):
    data = wsm.get_current_data()
    pprint.pprint(data, sort_dicts=False)
    time.sleep(1)

wsm.stop()  # Stop getting data

Important Information

Please be aware that each instance opens a new connection to websockets. If you create multiple instances for the same exchange, you may exceed the websockets connection limits set by exchanges. Make sure to check the connection limits of exchanges before opening numerous instances.

View License

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

ccxw-0.1.7.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

ccxw-0.1.7-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file ccxw-0.1.7.tar.gz.

File metadata

  • Download URL: ccxw-0.1.7.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for ccxw-0.1.7.tar.gz
Algorithm Hash digest
SHA256 c9462e20537f8c0a9c16f534cb8b968cde79526a4b7d0a198a7b325ac1fa8950
MD5 b65895623fe2a155e76d8525780f6383
BLAKE2b-256 d32725ea70658abf93fb6501bb9f548da0719dae987f4a216d8ea0c291e602ca

See more details on using hashes here.

File details

Details for the file ccxw-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ccxw-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for ccxw-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 821571e7ea6796a0226ff584111a335439efd2e88de3bef25896ac6bac928996
MD5 b488c32a5b779d2c666c7271e74df0a9
BLAKE2b-256 11f210a2455f21e302b7c8bf06fa6049018aa87c28fac6db0f9c310989fe123e

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page