xrtm-data 0.7.1__tar.gz → 0.7.2__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. {xrtm_data-0.7.1/src/xrtm_data.egg-info → xrtm_data-0.7.2}/PKG-INFO +1 -1
  2. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/pyproject.toml +1 -1
  3. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/polymarket.py +3 -2
  4. {xrtm_data-0.7.1 → xrtm_data-0.7.2/src/xrtm_data.egg-info}/PKG-INFO +1 -1
  5. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_online_sources.py +35 -0
  6. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/LICENSE +0 -0
  7. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/README.md +0 -0
  8. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/setup.cfg +0 -0
  9. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/__init__.py +0 -0
  10. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/__init__.py +0 -0
  11. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/interfaces.py +0 -0
  12. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/__init__.py +0 -0
  13. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/forecast.py +0 -0
  14. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/market.py +0 -0
  15. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/prior.py +0 -0
  16. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/resolution.py +0 -0
  17. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/trade.py +0 -0
  18. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/corpora/__init__.py +0 -0
  19. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/corpora/_builtin_corpora.py +0 -0
  20. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/corpora/real_binary.py +0 -0
  21. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/corpora/registry.py +0 -0
  22. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/__init__.py +0 -0
  23. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/__init__.py +0 -0
  24. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/kalshi.py +0 -0
  25. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/manifold.py +0 -0
  26. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/metaculus.py +0 -0
  27. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/version.py +0 -0
  28. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm_data.egg-info/SOURCES.txt +0 -0
  29. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm_data.egg-info/dependency_links.txt +0 -0
  30. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm_data.egg-info/requires.txt +0 -0
  31. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm_data.egg-info/top_level.txt +0 -0
  32. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_corpus_registry.py +0 -0
  33. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_market_snapshot.py +0 -0
  34. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_prior_schemas.py +0 -0
  35. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_real_binary_corpus.py +0 -0
  36. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_resolution_schemas.py +0 -0
  37. {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_schemas.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xrtm-data
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: The Snapshot Vault for XRTM.
5
5
  Author-email: XRTM Team <moy@xrtm.org>
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xrtm-data"
7
- version = "0.7.1"
7
+ version = "0.7.2"
8
8
  description = "The Snapshot Vault for XRTM."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11,<3.13"
@@ -79,8 +79,9 @@ class PolymarketSource(DataSource, ResolutionSource):
79
79
  try:
80
80
  data = self._get_json(url)
81
81
  except DataSourceError:
82
- # Gamma API may return a list directly
83
- url = f"{self.api_base}/events?limit={min(limit, 50)}&closed=false"
82
+ # Fallback: same markets endpoint without the volume ordering,
83
+ # which some Gamma deployments reject.
84
+ url = f"{self.api_base}/markets?limit={min(limit, 100)}&closed=false"
84
85
  data = self._get_json(url)
85
86
 
86
87
  # Gamma API may wrap in "markets" key or return list directly
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xrtm-data
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: The Snapshot Vault for XRTM.
5
5
  Author-email: XRTM Team <moy@xrtm.org>
6
6
  License-Expression: Apache-2.0
@@ -194,3 +194,38 @@ async def test_kalshi_fetch_resolved_paginates_cursor(monkeypatch):
194
194
 
195
195
  assert len(resolved) == 250
196
196
  assert calls["count"] == 2
197
+
198
+
199
+ @pytest.mark.asyncio
200
+ async def test_polymarket_fetch_questions_fallback_uses_markets(monkeypatch):
201
+ from xrtm.data.core import DataSourceError
202
+
203
+ source = PolymarketSource()
204
+ calls = {"urls": []}
205
+
206
+ def _get_json(url):
207
+ calls["urls"].append(url)
208
+ if "order=volume24hr" in url:
209
+ raise DataSourceError("volume ordering unsupported")
210
+ return [
211
+ {
212
+ "id": "m1",
213
+ "question": "Will X happen?",
214
+ "description": "d",
215
+ "outcomes": '["Yes", "No"]',
216
+ "outcomePrices": '["0.6", "0.4"]',
217
+ "volume": 1000,
218
+ "liquidity": 500,
219
+ "endDate": "2026-12-31T00:00:00Z",
220
+ "slug": "will-x",
221
+ "closed": False,
222
+ }
223
+ ]
224
+
225
+ monkeypatch.setattr(source, "_get_json", _get_json)
226
+
227
+ questions = await source.fetch_questions(limit=1)
228
+
229
+ assert len(calls["urls"]) == 2
230
+ assert "/markets?" in calls["urls"][1]
231
+ assert questions and questions[0].id == "polymarket-m1"
File without changes
File without changes
File without changes