Metadata-Version: 2.4
Name: surge-python
Version: 0.1.0
Summary: Python async SDK for Surge — high-speed pub/sub data pipeline for quant trading
Author: Surge Team
License: MIT
Project-URL: Homepage, https://github.com/surge-pubsub/surge
Project-URL: Documentation, https://github.com/surge-pubsub/surge
Project-URL: Repository, https://github.com/surge-pubsub/surge
Keywords: surge,pubsub,quant,trading,low-latency,pipeline,async
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Networking
Classifier: Framework :: AsyncIO
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: protobuf>=4.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"

# surge-python

Python async SDK for **Surge** — a high-speed, low-latency pub/sub data pipeline built for quant trading.

## Install

```bash
pip install surge-python
```

## Quick Start

```python
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
