Skip to main content

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

symbol = 'BTC/USDT'

streams = [\
                {\
                    'endpoint': 'order_book',\
                    'symbol': symbol
                },\
                {\
                    'endpoint': 'kline',\
                    'symbol': symbol,\
                    'interval': interval\
                },\
                {\
                    'endpoint': 'trades',\
                    'symbol': symbol
                },\
                {\
                    'endpoint': 'ticker',\
                    'symbol': symbol
                }\
        ]

wsm = Ccxw('binance',\
            streams,\
            result_max_len=5,\
            data_max_len=10)

wsm.start()  # Start getting data

time.sleep(2)  # Wait for available data

for i in range(0, 10):
    for stream in streams:
        interval = 'none'
        if 'interval' in stream:
            interval = stream['interval']
        data = wsm.get_current_data(stream['endpoint'], stream['symbol'], interval)
        pprint.pprint(data, sort_dicts=False)
        print('----------------------------------')
        time.sleep(1)
    print('============================================================')

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

Metadata

Release files for ccxw 0.2.41

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ccxw 0.2.41
File Size Uploaded Provenance Actions
ccxw-0.2.41.tar.gz 53.0 kB Without provenance Details for ccxw-0.2.41.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ccxw 0.2.41
File Interpreter ABI Platform Actions
ccxw-0.2.41-py3-none-any.whl Python 3 none any Details for ccxw-0.2.41-py3-none-any.whl

Total release size: 104.9 kB

Release files / ccxw-0.2.41.tar.gz

Download URL ccxw-0.2.41.tar.gz
Size 53.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f0df8b5dc3c5c788ac5a08d71f8dd81c3c573823336419f6ebdbd971d4cbc022
BLAKE2b-256 checksum
How to use checksums
c8bd78c87644a240736fe91f30206a6c2e68cd682ba38c941b86262e998e7bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / ccxw-0.2.41-py3-none-any.whl

Download URL ccxw-0.2.41-py3-none-any.whl
Size 51.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cdf317c9226e874f4bc5b476eec4b217aa0e7c16a0a50586ecb56699727d8f5
BLAKE2b-256 checksum
How to use checksums
74633632e1a5db2acf88886dd989daf1de54aeb182c1e900aea14cfeb00e63f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for ccxw 0.2.41

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.41 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page