Python SDK for the mmflow market-data API — REST, SSE streams, and a typed WebSocket client.
Project description
mmflow — Python SDK
Typed Python client for the mmflow market-data API: REST endpoints, SSE
streams, and a real-time WebSocket client. The REST + SSE surface is
standard-library only; the WebSocket client needs the ws extra.
pip install mmflow-sdk # REST + SSE (zero dependencies)
pip install "mmflow-sdk[ws]" # adds MmflowSocket (websockets)
The package name is mmflow-sdk; the import name remains mmflow.
REST + candles
from mmflow import MmflowClient
mm = MmflowClient()
# OHLCV history (normalized to {time, open, high, low, close, volume})
for c in mm.candles("BTC", interval="1m", hours=24):
print(c["time"], c["close"])
# Cross-venue open interest / funding / liquidations / whales
oi = mm.perps_oi(coins=["BTC", "ETH"], venues=["hl", "binance"])
for row in oi.data:
print(row["coin"], row.get("oiUsd"))
# Anything else under /api/v1:
resp = mm.get("/quant/density", {"coin": "BTC"})
SSE streams
for ev in mm.stream_trades("BTC"):
if ev.type == "trade":
print(ev.data["price"], ev.data["size"])
elif ev.type == "bye":
break
Real-time WebSocket
import asyncio
from mmflow import MmflowSocket
async def main():
sock = MmflowSocket(api_key="YOUR_KEY")
sock.subscribe("trades", "BTC", lambda payload, meta: print(meta["channel"], payload))
sock.subscribe("orderbook", "ETH", lambda payload, meta: print(payload))
await sock.run() # auto-reconnects; runs until close()
asyncio.run(main())
Channels: trades, orderbook, candles, liquidations, funding,
openInterest, markPrice, footprint. Auth, exponential-backoff
reconnect, and subscription replay are built in.
Project details
Release history Release notifications | RSS feed
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 mmflow_sdk-0.1.1.tar.gz.
File metadata
- Download URL: mmflow_sdk-0.1.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dbdf548c091fc4de95fbcd44189f601cc0ff8d004e4bc2f3b37e08d8b17f9c0
|
|
| MD5 |
4c5868680ab04229e913416b266d81ba
|
|
| BLAKE2b-256 |
8eb784c82e51d40567d2ba80ab052c10307a86a66a50abcb815e71a9980b2519
|
File details
Details for the file mmflow_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mmflow_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acac0563b44c8f164a705b79d4cdb3f40bce0988acedf5102877f1e1122e78d0
|
|
| MD5 |
c49ba6116e33075192f98fcbe98c7ff0
|
|
| BLAKE2b-256 |
bb8e99e427874fd36e0e927fb691ce9eb3641bb79b7cae0b1bedb50573c42c70
|