Metadata-Version: 2.4
Name: kashrock
Version: 0.3.0
Summary: Official Python SDK for the KashRock esports API — props, odds, matches, and scores.
Author-email: KashRock <ovitalszn@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://www.kashrock.com
Project-URL: Documentation, https://www.kashrock.com/docs
Project-URL: API, https://kashrock.up.railway.app
Project-URL: Repository, https://github.com/kashrockapi/kashrock-python
Keywords: esports,api,cs2,valorant,dota,props,odds
Classifier: Programming Language :: Python :: 3
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 :: Internet :: WWW/HTTP
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx<0.29,>=0.26
Requires-Dist: websockets<15,>=12
Requires-Dist: cryptography>=41
Requires-Dist: polymarket-us<3,>=2.3
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Dynamic: license-file

# KashRock Python SDK

[![Listed on MCP Market](https://mcpmarket.com/badge/server/kashrock.svg)](https://mcpmarket.com/server/kashrock?utm_source=readme&utm_medium=badge "Listed on MCP Market")

Official Python client for the KashRock esports API.

Props, odds, matches, live scores, and history — one key, normalized IDs.

Site: https://www.kashrock.com

## Install

```bash
pip install kashrock
```

## Four lines to a live prop

```python
from kashrock import KashRock

kr = KashRock("YOUR_API_KEY")
print(kr.props("cs2")["props"][0])
```

Sandbox key: https://www.kashrock.com/pricing

Docs: https://www.kashrock.com/docs

`KASHROCK_API_KEY` works if you do not want the key in code.

## What you can call

```python
kr.me()
kr.props("cs2", book="prizepicks", limit=20)
kr.lines("cs2")
kr.matches("cs2", status="upcoming")
kr.live_games("cs2")
kr.gamelogs("cs2", "zywoo")
kr.history_tape(market_key="kr_mk_…")
```

Same paths as the HTTP API and the KashRock MCP. Stacks are not included.

MCP: https://www.kashrock.com/mcp

## Auto-trade

KashRock computes signed trade intents on every board change and streams them
on `wss://…/v7/trade`. One command runs the executor on your machine:

```bash
export KASHROCK_API_KEY=kr_live_…
kashrock trade --venue polymarket-us
```

Paper mode is the default — every intent is verified and logged to your
console ledger without touching money. Filters (sports, min EV, stake, risk
limits) are set in the console and apply live.

The executor:

- verifies the Ed25519 signature on every intent (unsigned → never placed)
- skips expired intents and stops placing after 15s without a heartbeat
- dedupes on `intent_id` across restarts (`~/.kashrock/trade_placed.json`)
- places IOC limit orders only, at-or-better than `limit_price`, previewed first
- enforces your daily loss, max open positions and per-match exposure caps
  against the venue's own balance and positions
- reports every outcome back so the ledger stays honest

`--live` requests real orders — it is enabled per account after review.
Venue credentials (`POLYMARKET_KEY_ID` / `POLYMARKET_SECRET_KEY`, env or
`~/.kashrock/pm_us.env`) are read only from your machine and never sent to
KashRock. Parlay intents are paper-only and are never split into singles.

Sandbox keys work on every sport, up to 500 requests per UTC day: props, matches, players, delayed live scores, and 30 days of history. Hobby+ adds consensus lines and live odds. Builder+ adds the live WebSocket and quote history.

## License

MIT
