Python async SDK for Surge — high-speed pub/sub data pipeline for quant trading
Project description
surge-python
Python async SDK for Surge — a high-speed, low-latency pub/sub data pipeline built for quant trading.
Install
pip install surge-python
Quick Start
import asyncio
from surge import Publisher, Subscriber
async def main():
# Publish
pub = Publisher("127.0.0.1", 9800)
await pub.connect()
await pub.send("md.sz.000001", b'{"price":15.20}')
# Subscribe
sub = Subscriber("127.0.0.1", 9800)
await sub.connect()
await sub.subscribe(["md.sz.*"])
async for msg in sub.messages():
print(f"{msg.topic} latency={msg.latency_us:.1f}us")
asyncio.run(main())
Features
- Async TCP client with auto-reconnect
- Publish / Subscribe with wildcard topic matching
- Snapshot support for late joiners
- Token-based authentication
- < 30μs P50 latency
License
MIT
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
surge_python-0.1.0.tar.gz
(8.4 kB
view details)
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 surge_python-0.1.0.tar.gz.
File metadata
- Download URL: surge_python-0.1.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b1e6a73e80aed7c876fa29ea73c5870d16a8ffd19d6129aa1def97fd554a8cc
|
|
| MD5 |
c6f995aa70548f706830fd23173d05d2
|
|
| BLAKE2b-256 |
2cb8b23e5ac4f5527a8befa7bc77b59cb28066f652635267a8c1ff9d808e05f9
|
File details
Details for the file surge_python-0.1.0-py3-none-any.whl.
File metadata
- Download URL: surge_python-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
682e9ba1d479a44a63cd733ae27fc9c888f4fe6024b5b90c961767c703286d7e
|
|
| MD5 |
e884685decc9dadef26a83900c03c6ef
|
|
| BLAKE2b-256 |
b8adfe84a5a99d7ac86798c54a5e6aacae6958ea58d42570160c959d5ae4c4b0
|