Metadata-Version: 2.4
Name: purpletrader
Version: 0.1.0
Summary: A lightweight Python client for the Amherst College Quant Club Live Trading Engine.
Project-URL: Homepage, https://github.com/ACquantclub/purpletrader
License: MIT
License-File: LICENSE
Keywords: api,client,http,trading
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Requires-Dist: requests>=2.31.0
Description-Content-Type: text/markdown

# purpletrader

A lightweight Python client for the Live Trading Engine HTTP API.

## Installation

```bash
pip install purpletrader
```

## Usage

```python
from purpletrader import TradingEngineClient, Order, Timeframe

# Optionally set a default user_id so you don't have to provide it per order
client = TradingEngineClient(base_url="http://localhost:8080", user_id="trader_123")

# Submit order
resp = client.submit_order(Order(
    id="order_001",
    symbol="AAPL",
    type="LIMIT",
    side="BUY",
    quantity=100,
    price=150.25,
))
print(resp)

# Fetch data
print(client.get_orderbook("AAPL"))
print(client.get_stats("AAPL"))
print(client.get_stats_timeframe("AAPL", Timeframe.ONE_MINUTE))
print(client.get_all_stats())
print(client.get_stats_summary())
print(client.get_leaderboard())
print(client.health())
```

## Notes
- Raises `HTTPError` on non-2xx responses with `status_code`, `message`, and `body`.
- Default timeout is 30s; override via `TradingEngineClient(timeout=...)`.
- You can still override `userId` per order by passing it in the `Order`.
