Python SDK for the 3kk0 unified streaming API
Project description
kk0 SDK
A minimal Python client for the 3kk0 unified WebSocket stream.
Quickstart
from kk0 import Stream
import asyncio
async def main():
async with Stream("wss://api.3kk0.com/stream") as s:
await s.subscribe(
channels=["trades"],
symbols=["SOL/USDT"],
exchanges=["binance"],
)
async for event in s:
print(event)
asyncio.run(main())
The broker exposes a single /stream websocket: send a subscribe payload with the filters you care about, and the iterator yields every normalized trade, orderbook, heartbeat, or raw message that matches. Include raw=True in the subscribe call to flow through the raw-connector payload (events arrive with type == "raw" and a payload that mirrors the upstream exchange data). Adjust depth and other filters as needed for your workload.
Unified stream schema
Each event received over /stream follows the dataclasses defined in engine/schemas.py. Trade frames (e.g., type == "trade") always include exchange, symbol, ts_event, ts_exchange, price, size, side, and the optional metadata listed there; order book frames carry bids, asks, update_type, depth, sequence, and the derived helpers documented in the same file. Heartbeats carry info, and enabling raw=True adds type == "raw" messages whose payload is built in apps/broker/unified.py to mirror the upstream connector data.
Every exchange connector referenced by the broker (for example engine/connectors/binance.py, engine/connectors/bybit.py, and engine/connectors/hyperliquid.py) normalizes its native JSON into these fields before the broker fans them to clients. Because the SDK simply deserializes whatever JSON the broker sends (Stream.__anext__ just json.loads(...)), you always see the same normalized keys regardless of the exchange you subscribe to.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kk0-0.1.5.tar.gz.
File metadata
- Download URL: kk0-0.1.5.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba3fc95ee293f6791da86fe5cc6d936fcf93875ba592ecfb48436fc4d188eeda
|
|
| MD5 |
c92d5e1def805b2ca009a569a48a1106
|
|
| BLAKE2b-256 |
afdd06996c1beabb61adb13d96b87ef922b26399f1c756fc9f638bf153bd699b
|
File details
Details for the file kk0-0.1.5-py3-none-any.whl.
File metadata
- Download URL: kk0-0.1.5-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c59d4ca27d4cb6b13957ffa9e74a332b63bada0831ef984e6bd69d52f6195fa2
|
|
| MD5 |
e4f9c9bc0cb2d37884190c65ee420760
|
|
| BLAKE2b-256 |
6d3a9763ba8ee819298b33a69db54e6911c725cc68f1a9df03247db5dc6fb4e5
|