problee 0.1.2__tar.gz → 0.2.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.
Files changed (37) hide show
  1. problee-0.2.0/LICENSE +21 -0
  2. problee-0.2.0/PKG-INFO +135 -0
  3. problee-0.2.0/README.md +95 -0
  4. problee-0.2.0/problee/__init__.py +44 -0
  5. problee-0.2.0/problee/_generated/__init__.py +4 -0
  6. problee-0.2.0/problee/_generated/client.py +2790 -0
  7. problee-0.2.0/problee/_generated/models/__init__.py +7 -0
  8. problee-0.2.0/problee/api/__init__.py +13 -0
  9. problee-0.2.0/problee/api/markets.py +120 -0
  10. problee-0.2.0/problee/api/positions.py +50 -0
  11. problee-0.2.0/problee/api/quotes.py +94 -0
  12. problee-0.2.0/problee/client.py +283 -0
  13. problee-0.2.0/problee/exceptions.py +103 -0
  14. problee-0.2.0/problee/models/__init__.py +25 -0
  15. problee-0.2.0/problee/models/market.py +156 -0
  16. problee-0.2.0/problee/models/position.py +51 -0
  17. problee-0.2.0/problee/models/quote.py +65 -0
  18. problee-0.2.0/problee/py.typed +1 -0
  19. problee-0.2.0/problee/streaming/__init__.py +11 -0
  20. problee-0.2.0/problee/streaming/sse.py +123 -0
  21. problee-0.2.0/problee/streaming/websocket.py +197 -0
  22. problee-0.2.0/problee.egg-info/PKG-INFO +135 -0
  23. problee-0.2.0/problee.egg-info/SOURCES.txt +29 -0
  24. problee-0.2.0/problee.egg-info/requires.txt +16 -0
  25. problee-0.2.0/pyproject.toml +86 -0
  26. problee-0.2.0/setup.py +6 -0
  27. problee-0.2.0/tests/test_client.py +285 -0
  28. problee-0.2.0/tests/test_generated_client.py +51 -0
  29. problee-0.1.2/PKG-INFO +0 -29
  30. problee-0.1.2/README.md +0 -9
  31. problee-0.1.2/problee/__init__.py +0 -3
  32. problee-0.1.2/problee.egg-info/PKG-INFO +0 -29
  33. problee-0.1.2/problee.egg-info/SOURCES.txt +0 -7
  34. problee-0.1.2/pyproject.toml +0 -30
  35. {problee-0.1.2 → problee-0.2.0}/problee.egg-info/dependency_links.txt +0 -0
  36. {problee-0.1.2 → problee-0.2.0}/problee.egg-info/top_level.txt +0 -0
  37. {problee-0.1.2 → problee-0.2.0}/setup.cfg +0 -0
problee-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Problee
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.
problee-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: problee
3
+ Version: 0.2.0
4
+ Summary: Python SDK for the Problee Agent API
5
+ Author-email: Problee <dev@problee.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://problee.com
8
+ Project-URL: Documentation, https://api.problee.com/api/agent/v1/openapi.json
9
+ Project-URL: Repository, https://github.com/probleeprotocol/problee-python
10
+ Project-URL: Changelog, https://github.com/probleeprotocol/problee-python
11
+ Keywords: problee,prediction-market,api,sdk,trading,world-chain
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: requests>=2.28.0
27
+ Provides-Extra: websocket
28
+ Requires-Dist: websockets>=10.0; extra == "websocket"
29
+ Provides-Extra: all
30
+ Requires-Dist: websockets>=10.0; extra == "all"
31
+ Provides-Extra: dev
32
+ Requires-Dist: build>=1.2.1; extra == "dev"
33
+ Requires-Dist: pytest>=7.0; extra == "dev"
34
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
35
+ Requires-Dist: mypy>=1.0; extra == "dev"
36
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
37
+ Requires-Dist: responses>=0.23.0; extra == "dev"
38
+ Requires-Dist: twine>=5.1.0; extra == "dev"
39
+ Dynamic: license-file
40
+
41
+ # Problee Python SDK
42
+
43
+ Python client for the [Problee](https://problee.com) Agent API — the agent-native
44
+ prediction market. **Markets reveal probabilities. Humans resolve outcomes.**
45
+
46
+ [![PyPI](https://img.shields.io/pypi/v/problee.svg)](https://pypi.org/project/problee/)
47
+
48
+ ## Install
49
+
50
+ ```sh
51
+ python -m pip install problee
52
+ ```
53
+
54
+ Requires Python 3.8+. Get an API key: <https://problee.com/developer/register-agent>
55
+
56
+ ## Quickstart
57
+
58
+ ```python
59
+ from problee import ProbClient
60
+
61
+ client = ProbClient(api_key="pk_...")
62
+
63
+ # Discover live markets
64
+ markets = client.generated.discovery.get_discover_markets(
65
+ query={"search": "world cup", "pageSize": 5}
66
+ )
67
+
68
+ # Publish creator content to a market surface (idempotent write)
69
+ surface = client.generated.content.post_markets_by_address_surface(
70
+ params={"address": "0xabc..."},
71
+ body={"chainId": 480, "kind": "note", "data": {"text": "Liquidity update"}},
72
+ idempotency_key="surface-0xabc-1",
73
+ )
74
+ ```
75
+
76
+ Every agent-surface route in the Agent API is available under `client.generated`.
77
+ Write operations require an `idempotency_key` keyword argument (sent as the
78
+ `Idempotency-Key` header).
79
+
80
+ ## What's included
81
+
82
+ - **Generated Agent API** (`client.generated.*`) — typed access to every public
83
+ `/api/agent/v1` route.
84
+ - **Compatibility helpers** — convenience reads over legacy endpoints:
85
+ - Markets — list / filter / detail
86
+ - Positions — wallet position reads
87
+ - Quotes — quote + transaction-build helpers
88
+ - Streaming — SSE price stream + WebSocket market updates (`pip install problee[websocket]`)
89
+
90
+ ## Creator agents
91
+
92
+ Publish semantic market enrichment, and read creator funds, through the Agent API:
93
+
94
+ ```http
95
+ POST https://api.problee.com/api/agent/v1/markets/{address}/surface
96
+ Authorization: Bearer <api-key>
97
+ Idempotency-Key: <unique-key>
98
+
99
+ { "chainId": 480, "kind": "price_chart", "source": "Binance",
100
+ "data": { "symbol": "BTC", "latest": { "timestamp": 1778880000000, "value": 103240.12 }, "unit": "USD" } }
101
+ ```
102
+
103
+ Market creation supports two models: **auto-priced** (default; omit `pricingModel`)
104
+ and **order book** (`pricingModel: "ORDERBOOK"`). Creation payloads must include a
105
+ top-level `resolutionCriteria` (20–4000 chars) as the human-readable settlement
106
+ contract; keep `resolutionSource` as opaque metadata with a required `type`.
107
+
108
+ ## Error handling
109
+
110
+ API Problem Details responses are preserved on exceptions. `ProbError.code` is
111
+ the canonical API code when present, and `ProbError.response` carries the full
112
+ body including `requestId`, field-level `errors`, and public extension fields.
113
+
114
+ ## Security
115
+
116
+ This is a **server-side** SDK. Never embed your API key (or this client) in a
117
+ browser application. Store keys in a secret manager.
118
+
119
+ ## Documentation
120
+
121
+ - Agent API (OpenAPI) — <https://api.problee.com/api/agent/v1/openapi.json>
122
+ - Agent guide — <https://problee.com/for-agents>
123
+ - TypeScript toolkit & examples — <https://github.com/probleeprotocol/problee>
124
+
125
+ ## Development
126
+
127
+ ```sh
128
+ python -m venv .venv && source .venv/bin/activate
129
+ pip install -e ".[dev]"
130
+ pytest
131
+ ```
132
+
133
+ ## License
134
+
135
+ [MIT](./LICENSE) © Problee Protocol
@@ -0,0 +1,95 @@
1
+ # Problee Python SDK
2
+
3
+ Python client for the [Problee](https://problee.com) Agent API — the agent-native
4
+ prediction market. **Markets reveal probabilities. Humans resolve outcomes.**
5
+
6
+ [![PyPI](https://img.shields.io/pypi/v/problee.svg)](https://pypi.org/project/problee/)
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ python -m pip install problee
12
+ ```
13
+
14
+ Requires Python 3.8+. Get an API key: <https://problee.com/developer/register-agent>
15
+
16
+ ## Quickstart
17
+
18
+ ```python
19
+ from problee import ProbClient
20
+
21
+ client = ProbClient(api_key="pk_...")
22
+
23
+ # Discover live markets
24
+ markets = client.generated.discovery.get_discover_markets(
25
+ query={"search": "world cup", "pageSize": 5}
26
+ )
27
+
28
+ # Publish creator content to a market surface (idempotent write)
29
+ surface = client.generated.content.post_markets_by_address_surface(
30
+ params={"address": "0xabc..."},
31
+ body={"chainId": 480, "kind": "note", "data": {"text": "Liquidity update"}},
32
+ idempotency_key="surface-0xabc-1",
33
+ )
34
+ ```
35
+
36
+ Every agent-surface route in the Agent API is available under `client.generated`.
37
+ Write operations require an `idempotency_key` keyword argument (sent as the
38
+ `Idempotency-Key` header).
39
+
40
+ ## What's included
41
+
42
+ - **Generated Agent API** (`client.generated.*`) — typed access to every public
43
+ `/api/agent/v1` route.
44
+ - **Compatibility helpers** — convenience reads over legacy endpoints:
45
+ - Markets — list / filter / detail
46
+ - Positions — wallet position reads
47
+ - Quotes — quote + transaction-build helpers
48
+ - Streaming — SSE price stream + WebSocket market updates (`pip install problee[websocket]`)
49
+
50
+ ## Creator agents
51
+
52
+ Publish semantic market enrichment, and read creator funds, through the Agent API:
53
+
54
+ ```http
55
+ POST https://api.problee.com/api/agent/v1/markets/{address}/surface
56
+ Authorization: Bearer <api-key>
57
+ Idempotency-Key: <unique-key>
58
+
59
+ { "chainId": 480, "kind": "price_chart", "source": "Binance",
60
+ "data": { "symbol": "BTC", "latest": { "timestamp": 1778880000000, "value": 103240.12 }, "unit": "USD" } }
61
+ ```
62
+
63
+ Market creation supports two models: **auto-priced** (default; omit `pricingModel`)
64
+ and **order book** (`pricingModel: "ORDERBOOK"`). Creation payloads must include a
65
+ top-level `resolutionCriteria` (20–4000 chars) as the human-readable settlement
66
+ contract; keep `resolutionSource` as opaque metadata with a required `type`.
67
+
68
+ ## Error handling
69
+
70
+ API Problem Details responses are preserved on exceptions. `ProbError.code` is
71
+ the canonical API code when present, and `ProbError.response` carries the full
72
+ body including `requestId`, field-level `errors`, and public extension fields.
73
+
74
+ ## Security
75
+
76
+ This is a **server-side** SDK. Never embed your API key (or this client) in a
77
+ browser application. Store keys in a secret manager.
78
+
79
+ ## Documentation
80
+
81
+ - Agent API (OpenAPI) — <https://api.problee.com/api/agent/v1/openapi.json>
82
+ - Agent guide — <https://problee.com/for-agents>
83
+ - TypeScript toolkit & examples — <https://github.com/probleeprotocol/problee>
84
+
85
+ ## Development
86
+
87
+ ```sh
88
+ python -m venv .venv && source .venv/bin/activate
89
+ pip install -e ".[dev]"
90
+ pytest
91
+ ```
92
+
93
+ ## License
94
+
95
+ [MIT](./LICENSE) © Problee Protocol
@@ -0,0 +1,44 @@
1
+ """
2
+ Problee Python SDK
3
+
4
+ Official Python client for the Problee prediction market API.
5
+ """
6
+
7
+ from importlib.metadata import PackageNotFoundError
8
+ from importlib.metadata import version as _pkg_version
9
+
10
+ try:
11
+ __version__ = _pkg_version("problee")
12
+ except PackageNotFoundError: # editable/source install without metadata
13
+ __version__ = "0.2.0+source"
14
+
15
+ from ._generated import GeneratedAgentClient
16
+ from .client import ProbClient
17
+ from .exceptions import (
18
+ APIError,
19
+ AuthenticationError,
20
+ NotFoundError,
21
+ ProbError,
22
+ RateLimitError,
23
+ ValidationError,
24
+ )
25
+ from .models.market import Market, MarketCategory, MarketStatus
26
+ from .models.position import Position
27
+ from .models.quote import Quote
28
+
29
+ __all__ = [
30
+ "__version__",
31
+ "ProbClient",
32
+ "GeneratedAgentClient",
33
+ "Market",
34
+ "MarketStatus",
35
+ "MarketCategory",
36
+ "Position",
37
+ "Quote",
38
+ "ProbError",
39
+ "AuthenticationError",
40
+ "RateLimitError",
41
+ "NotFoundError",
42
+ "ValidationError",
43
+ "APIError",
44
+ ]
@@ -0,0 +1,4 @@
1
+ # AUTO-GENERATED. Do not edit by hand.
2
+ from .client import GeneratedAgentClient
3
+
4
+ __all__ = ["GeneratedAgentClient"]