Metadata-Version: 2.5
Name: galore-sdk
Version: 0.1.0
Summary: Python SDK for Galore (trygalore.com): check every AI trade against a person's rules before it reaches the brokerage. Hosted practice API, no key.
Project-URL: Homepage, https://trygalore.com
Project-URL: Documentation, https://trygalore.com/developers/sandbox
Project-URL: Source, https://github.com/mehek-builds/galore-sdk
Project-URL: API reference, https://trygalore.com/api/sandbox/openapi.json
Author-email: Galore <mehekbuilds@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: ai trading,brokerage,galore,guardrails,mcp,pre-trade check,risk rules,trading agent,trygalore
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# galore-sdk

Galore checks every trade an AI sends against rules a person approved once, before the trade reaches their brokerage (Alpaca, Robinhood, Interactive Brokers, Kalshi, Polymarket). It never picks trades, holds money or gives advice.

> This is **Galore from [trygalore.com](https://trygalore.com)**, the AI trade-check service. It is not the GaLore PyTorch optimizer (`galore-torch`) or the `galore` spectroscopy package.

The SDK talks to Galore's **hosted practice API**: no key, no account, nothing saved. `rules` and `order` follow the live connector's `set_rules` and `send_trade` schemas, so the same objects work there; the extra `agent` argument names the AI (live, its sign-in does).

```bash
pip install galore-sdk
```

```python
from galore_sdk import Galore, make_order, make_rules

galore = Galore()                     # hosted practice API, no key

rules = make_rules(
    agents=["my-trading-agent"],
    instruments=["AAPL", "MSFT"],
    max_order_usd=2000,
    max_daily_usd=5000,
    max_quantity=10,
)
order = make_order(instrument="AAPL", side="buy", quantity=2, limit_price=190)
# make_order gives a fresh eventId; reuse an order's eventId only to retry that same trade.

result = galore.check("my-trading-agent", rules, order)
print(result["decision"])             # allowed | stopped | held | needs_person
for check in result["checks"]:
    print(check["rule"], check["passed"], check["detail"])
```

Command line: `galore check --symbol AAPL --qty 2 --price 190`.

Errors raise `galore_sdk.GaloreError` with `.status`, `.code` and `.field` (the bad input). Python 3.9+, no dependencies.

## What comes back

- `decision`: `allowed` (every rule passed), `stopped` (a rule failed; the trade never reaches the brokerage), `held` (this `eventId` was already sent; read its status, never resend), `needs_person` (above `confirmAboveUsd`; the person confirms in their own browser).
- `summary`: one plain line. `checks`: every rule with `passed` and `detail`. `practice`: always `true` here.

Rule fields (live `set_rules` shape): `connectionId`, `agents`, `instruments`, `sides`, `timeInForce`, `maxQuantity`, `maxOrderUsd`, `maxDailySubmittedUsd`, `maxOrdersPerDay`, `maxSnapshotAgeMs`, `expiresAt` (ms), `disclosure`; optional `confirmAboveUsd`, `maxPositionUsd`. Live-only fields that need brokerage data are accepted and listed in `notChecked`. Optional `context`: `ordersToday`, `submittedTodayUsd`, `positionUsd`, `availableQuantity`, `recentEventIds`.

## Real trades

Add `https://connect.trygalore.com/mcp` to your AI as an MCP connector and sign in with a Galore account ($19 a month, Night Stop included). The person approves the rules in their own browser; the same rules and order objects work there (`brokerage` for the real `connectionId`, `set_rules`, `ask_to_approve`, then `send_trade`).

Docs: https://trygalore.com/developers/sandbox · Source: https://github.com/mehek-builds/galore-sdk · License: MIT
