algoproven 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AlgoProven
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: algoproven
3
+ Version: 0.1.0
4
+ Summary: The prop-firm rule runtime for futures bots — ask before every trade: can this break my prop account?
5
+ Author: AlgoProven
6
+ License: MIT
7
+ Project-URL: Homepage, https://algoproven.com
8
+ Project-URL: Documentation, https://app.algoproven.com/api/docs
9
+ Keywords: prop-firm,futures,trading,risk,topstep,apex,rule-gate,drawdown
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ # algoproven
16
+
17
+ The prop-firm **rule runtime** for futures bots. Execution tools send trades — AlgoProven decides whether the next trade is **allowed under your exact prop-firm rules**. Ask before every order: *can this break my prop account?*
18
+
19
+ Pure Python stdlib, no dependencies.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ pip install algoproven # (publishing to PyPI soon)
25
+ # from source: cd sdk && pip install -e .
26
+ ```
27
+
28
+ ## Use
29
+
30
+ ```python
31
+ from algoproven import RuleGate
32
+
33
+ gate = RuleGate() # -> https://app.algoproven.com
34
+
35
+ v = gate.check(firm="topstep_50k", symbol="ES", qty=2, stop_ticks=12, room=1000)
36
+ print(v["decision"], "-", v["reason"])
37
+ # ALLOW - Risk $300 is within $1,000 of room - $700 left after.
38
+
39
+ # one-liner go/no-go inside your bot's order path:
40
+ if not gate.allowed(firm="topstep_50k", symbol="ES", qty=5, stop_ticks=40, room=1000):
41
+ return # REDUCE or BLOCK — skip the trade
42
+
43
+ gate.firms() # -> available presets
44
+ ```
45
+
46
+ ## Verdicts
47
+
48
+ | decision | meaning |
49
+ |---|---|
50
+ | `ALLOW` | risk fits the room — take it |
51
+ | `REDUCE` | too big — `max_safe_qty` tells you the largest safe size |
52
+ | `BLOCK` | no safe size — tighten the stop or skip |
53
+
54
+ Each verdict returns `{decision, reason, max_safe_qty, proposed_risk, room, distance_to_breach}`.
55
+
56
+ ## Inputs
57
+
58
+ - `firm` — preset key (`topstep_50k`, `apex_50k`, `ffn_50k`; see `gate.firms()`)
59
+ - `symbol` — `ES / MES / NQ / MNQ / MGC / MCL / M6E`
60
+ - `qty`, `stop_ticks` — the proposed trade; OR pass `open_risk` (the $ you'd lose if stopped)
61
+ - `room` — $ left before breach today (daily-loss room or live distance-to-breach). Defaults to the firm's binding line.
62
+
63
+ ## Notes
64
+
65
+ v1 is **stateless** — it computes on the values you pass, holds no credentials, places no orders. Live account-state binding (real-time distance-to-breach, PayoutLock, multi-account) ships with the AlgoProven cockpit. Rules change weekly; confirm against your firm's official page.
66
+
67
+ Not affiliated with any prop firm. Not financial advice.
@@ -0,0 +1,53 @@
1
+ # algoproven
2
+
3
+ The prop-firm **rule runtime** for futures bots. Execution tools send trades — AlgoProven decides whether the next trade is **allowed under your exact prop-firm rules**. Ask before every order: *can this break my prop account?*
4
+
5
+ Pure Python stdlib, no dependencies.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install algoproven # (publishing to PyPI soon)
11
+ # from source: cd sdk && pip install -e .
12
+ ```
13
+
14
+ ## Use
15
+
16
+ ```python
17
+ from algoproven import RuleGate
18
+
19
+ gate = RuleGate() # -> https://app.algoproven.com
20
+
21
+ v = gate.check(firm="topstep_50k", symbol="ES", qty=2, stop_ticks=12, room=1000)
22
+ print(v["decision"], "-", v["reason"])
23
+ # ALLOW - Risk $300 is within $1,000 of room - $700 left after.
24
+
25
+ # one-liner go/no-go inside your bot's order path:
26
+ if not gate.allowed(firm="topstep_50k", symbol="ES", qty=5, stop_ticks=40, room=1000):
27
+ return # REDUCE or BLOCK — skip the trade
28
+
29
+ gate.firms() # -> available presets
30
+ ```
31
+
32
+ ## Verdicts
33
+
34
+ | decision | meaning |
35
+ |---|---|
36
+ | `ALLOW` | risk fits the room — take it |
37
+ | `REDUCE` | too big — `max_safe_qty` tells you the largest safe size |
38
+ | `BLOCK` | no safe size — tighten the stop or skip |
39
+
40
+ Each verdict returns `{decision, reason, max_safe_qty, proposed_risk, room, distance_to_breach}`.
41
+
42
+ ## Inputs
43
+
44
+ - `firm` — preset key (`topstep_50k`, `apex_50k`, `ffn_50k`; see `gate.firms()`)
45
+ - `symbol` — `ES / MES / NQ / MNQ / MGC / MCL / M6E`
46
+ - `qty`, `stop_ticks` — the proposed trade; OR pass `open_risk` (the $ you'd lose if stopped)
47
+ - `room` — $ left before breach today (daily-loss room or live distance-to-breach). Defaults to the firm's binding line.
48
+
49
+ ## Notes
50
+
51
+ v1 is **stateless** — it computes on the values you pass, holds no credentials, places no orders. Live account-state binding (real-time distance-to-breach, PayoutLock, multi-account) ships with the AlgoProven cockpit. Rules change weekly; confirm against your firm's official page.
52
+
53
+ Not affiliated with any prop firm. Not financial advice.
@@ -0,0 +1,72 @@
1
+ """AlgoProven — the prop-firm rule runtime for futures bots.
2
+
3
+ Ask before every trade: *can this break my prop account?*
4
+
5
+ from algoproven import RuleGate
6
+ gate = RuleGate() # -> https://app.algoproven.com
7
+ v = gate.check(firm="topstep_50k", symbol="ES", qty=2, stop_ticks=12, room=1000)
8
+ print(v["decision"], "-", v["reason"]) # ALLOW - Risk $300 is within $1,000 ...
9
+
10
+ Stateless v1: you pass the firm preset + the proposed trade + your room-to-breach;
11
+ the gate returns ALLOW / REDUCE / BLOCK with a reason, max safe size and distance.
12
+ No broker credentials, no orders — it only *decides*. Pure stdlib (no dependencies).
13
+ """
14
+ import json as _json
15
+ import urllib.error
16
+ import urllib.request
17
+ from typing import Optional
18
+
19
+ __version__ = "0.1.0"
20
+ DEFAULT_BASE = "https://app.algoproven.com"
21
+
22
+
23
+ class RuleGateError(RuntimeError):
24
+ pass
25
+
26
+
27
+ class RuleGate:
28
+ """Pre-Trade Rule Gate client."""
29
+
30
+ def __init__(self, base_url: str = DEFAULT_BASE, api_key: Optional[str] = None, timeout: float = 10.0):
31
+ self.base = base_url.rstrip("/")
32
+ self.api_key = api_key
33
+ self.timeout = timeout
34
+
35
+ def check(self, firm: str = "topstep_50k", symbol: str = "ES", side: str = "BUY",
36
+ qty: int = 1, stop_ticks=None, open_risk=None, room=None) -> dict:
37
+ """Return the verdict dict: {decision, reason, max_safe_qty, proposed_risk,
38
+ room, distance_to_breach}. decision in {ALLOW, REDUCE, BLOCK}."""
39
+ payload = {"firm": firm, "symbol": symbol, "side": side, "qty": int(qty)}
40
+ if stop_ticks is not None:
41
+ payload["stop_ticks"] = stop_ticks
42
+ if open_risk is not None:
43
+ payload["open_risk"] = open_risk
44
+ if room is not None:
45
+ payload["room"] = room
46
+ return self._req("POST", "/api/v1/rulegate/check", payload)
47
+
48
+ def allowed(self, **kw) -> bool:
49
+ """True only if the verdict is ALLOW — the one-liner for a bot's go/no-go."""
50
+ return self.check(**kw).get("decision") == "ALLOW"
51
+
52
+ def firms(self) -> dict:
53
+ """List the available firm presets."""
54
+ return self._req("GET", "/api/v1/rulegate/firms")
55
+
56
+ # ---- transport (stdlib only) ----
57
+ def _req(self, method: str, path: str, payload: Optional[dict] = None) -> dict:
58
+ headers = {"Content-Type": "application/json", "User-Agent": f"algoproven-sdk/{__version__}"}
59
+ if self.api_key:
60
+ headers["X-API-Key"] = self.api_key
61
+ data = _json.dumps(payload).encode() if payload is not None else None
62
+ req = urllib.request.Request(self.base + path, data=data, headers=headers, method=method)
63
+ try:
64
+ with urllib.request.urlopen(req, timeout=self.timeout) as r:
65
+ return _json.loads(r.read().decode())
66
+ except urllib.error.HTTPError as e:
67
+ raise RuleGateError(f"RuleGate HTTP {e.code}: {e.read().decode()[:200]}") from None
68
+ except urllib.error.URLError as e:
69
+ raise RuleGateError(f"RuleGate unreachable: {e.reason}") from None
70
+
71
+
72
+ __all__ = ["RuleGate", "RuleGateError", "__version__"]
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: algoproven
3
+ Version: 0.1.0
4
+ Summary: The prop-firm rule runtime for futures bots — ask before every trade: can this break my prop account?
5
+ Author: AlgoProven
6
+ License: MIT
7
+ Project-URL: Homepage, https://algoproven.com
8
+ Project-URL: Documentation, https://app.algoproven.com/api/docs
9
+ Keywords: prop-firm,futures,trading,risk,topstep,apex,rule-gate,drawdown
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ # algoproven
16
+
17
+ The prop-firm **rule runtime** for futures bots. Execution tools send trades — AlgoProven decides whether the next trade is **allowed under your exact prop-firm rules**. Ask before every order: *can this break my prop account?*
18
+
19
+ Pure Python stdlib, no dependencies.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ pip install algoproven # (publishing to PyPI soon)
25
+ # from source: cd sdk && pip install -e .
26
+ ```
27
+
28
+ ## Use
29
+
30
+ ```python
31
+ from algoproven import RuleGate
32
+
33
+ gate = RuleGate() # -> https://app.algoproven.com
34
+
35
+ v = gate.check(firm="topstep_50k", symbol="ES", qty=2, stop_ticks=12, room=1000)
36
+ print(v["decision"], "-", v["reason"])
37
+ # ALLOW - Risk $300 is within $1,000 of room - $700 left after.
38
+
39
+ # one-liner go/no-go inside your bot's order path:
40
+ if not gate.allowed(firm="topstep_50k", symbol="ES", qty=5, stop_ticks=40, room=1000):
41
+ return # REDUCE or BLOCK — skip the trade
42
+
43
+ gate.firms() # -> available presets
44
+ ```
45
+
46
+ ## Verdicts
47
+
48
+ | decision | meaning |
49
+ |---|---|
50
+ | `ALLOW` | risk fits the room — take it |
51
+ | `REDUCE` | too big — `max_safe_qty` tells you the largest safe size |
52
+ | `BLOCK` | no safe size — tighten the stop or skip |
53
+
54
+ Each verdict returns `{decision, reason, max_safe_qty, proposed_risk, room, distance_to_breach}`.
55
+
56
+ ## Inputs
57
+
58
+ - `firm` — preset key (`topstep_50k`, `apex_50k`, `ffn_50k`; see `gate.firms()`)
59
+ - `symbol` — `ES / MES / NQ / MNQ / MGC / MCL / M6E`
60
+ - `qty`, `stop_ticks` — the proposed trade; OR pass `open_risk` (the $ you'd lose if stopped)
61
+ - `room` — $ left before breach today (daily-loss room or live distance-to-breach). Defaults to the firm's binding line.
62
+
63
+ ## Notes
64
+
65
+ v1 is **stateless** — it computes on the values you pass, holds no credentials, places no orders. Live account-state binding (real-time distance-to-breach, PayoutLock, multi-account) ships with the AlgoProven cockpit. Rules change weekly; confirm against your firm's official page.
66
+
67
+ Not affiliated with any prop firm. Not financial advice.
@@ -0,0 +1,8 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ algoproven/__init__.py
5
+ algoproven.egg-info/PKG-INFO
6
+ algoproven.egg-info/SOURCES.txt
7
+ algoproven.egg-info/dependency_links.txt
8
+ algoproven.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ algoproven
@@ -0,0 +1,20 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "algoproven"
7
+ version = "0.1.0"
8
+ description = "The prop-firm rule runtime for futures bots — ask before every trade: can this break my prop account?"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "AlgoProven" }]
13
+ keywords = ["prop-firm", "futures", "trading", "risk", "topstep", "apex", "rule-gate", "drawdown"]
14
+
15
+ [project.urls]
16
+ Homepage = "https://algoproven.com"
17
+ Documentation = "https://app.algoproven.com/api/docs"
18
+
19
+ [tool.setuptools]
20
+ packages = ["algoproven"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+