xrtm-data 0.2.2__tar.gz → 0.2.4__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.
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/PKG-INFO +2 -2
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/pyproject.toml +2 -2
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/cli/__init__.py +12 -4
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/version.py +1 -1
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm_data.egg-info/PKG-INFO +2 -2
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm_data.egg-info/SOURCES.txt +1 -0
- xrtm_data-0.2.4/tests/test_cli_ux.py +41 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/LICENSE +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/README.md +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/setup.cfg +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/core/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/core/interfaces.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/core/schemas/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/core/schemas/forecast.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/core/schemas/prior.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/core/schemas/trade.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/corpora/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/corpora/real_binary.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/kit/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/kit/processors/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/providers/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/providers/local/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/providers/local/csv.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/providers/online/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/providers/online/polymarket.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/providers/subgraph/__init__.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm/data/providers/subgraph/polymarket.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm_data.egg-info/dependency_links.txt +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm_data.egg-info/entry_points.txt +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm_data.egg-info/requires.txt +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/src/xrtm_data.egg-info/top_level.txt +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/tests/test_beta_fitter.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/tests/test_cli_loading.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/tests/test_local_datasource.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/tests/test_polymarket_source.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/tests/test_polymarket_subgraph.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/tests/test_prior_schemas.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/tests/test_real_binary_corpus.py +0 -0
- {xrtm_data-0.2.2 → xrtm_data-0.2.4}/tests/test_schemas.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xrtm-data
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: The Snapshot Vault for XRTM.
|
|
5
5
|
Author-email: XRTM Team <moy@xrtm.org>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
|
-
Requires-Python:
|
|
7
|
+
Requires-Python: <3.13,>=3.11
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Requires-Dist: pydantic>=2.0.0
|
|
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "xrtm-data"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.4"
|
|
8
8
|
description = "The Snapshot Vault for XRTM."
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.11"
|
|
10
|
+
requires-python = ">=3.11,<3.13"
|
|
11
11
|
license = "Apache-2.0"
|
|
12
12
|
authors = [
|
|
13
13
|
{name = "XRTM Team", email = "moy@xrtm.org"}
|
|
@@ -75,6 +75,9 @@ def collect(
|
|
|
75
75
|
xrtm-data collect -m 0x1234... -d 30 -o data/trades.parquet
|
|
76
76
|
"""
|
|
77
77
|
output_path = Path(output)
|
|
78
|
+
output_suffix = output_path.suffix.lower()
|
|
79
|
+
if output_suffix not in {".parquet", ".json"}:
|
|
80
|
+
raise click.ClickException("Output path must end with .parquet or .json")
|
|
78
81
|
|
|
79
82
|
# Check cache
|
|
80
83
|
if output_path.exists() and not force:
|
|
@@ -124,10 +127,12 @@ def collect(
|
|
|
124
127
|
# Save output
|
|
125
128
|
output_path.parent.mkdir(parents=True, exist_ok=True)
|
|
126
129
|
|
|
127
|
-
if
|
|
130
|
+
if output_suffix == ".parquet":
|
|
128
131
|
_save_parquet(window, output_path)
|
|
129
|
-
|
|
132
|
+
elif output_suffix == ".json":
|
|
130
133
|
_save_json(window, output_path)
|
|
134
|
+
else: # pragma: no cover - guarded before collection
|
|
135
|
+
raise click.ClickException("Output path must end with .parquet or .json")
|
|
131
136
|
|
|
132
137
|
console.print(f"[green]✓ Saved {len(window.trades)} trades to:[/green] {output_path}")
|
|
133
138
|
|
|
@@ -214,8 +219,9 @@ def info(file_path: str):
|
|
|
214
219
|
Displays summary statistics for trade files or prior files.
|
|
215
220
|
"""
|
|
216
221
|
path = Path(file_path)
|
|
222
|
+
suffix = path.suffix.lower()
|
|
217
223
|
|
|
218
|
-
if
|
|
224
|
+
if suffix == ".json":
|
|
219
225
|
with open(path) as f:
|
|
220
226
|
data = json.load(f)
|
|
221
227
|
|
|
@@ -230,7 +236,7 @@ def info(file_path: str):
|
|
|
230
236
|
))
|
|
231
237
|
else:
|
|
232
238
|
console.print(f"JSON file with {len(data)} keys")
|
|
233
|
-
elif
|
|
239
|
+
elif suffix == ".parquet":
|
|
234
240
|
import pyarrow.parquet as pq
|
|
235
241
|
|
|
236
242
|
table = pq.read_table(path)
|
|
@@ -240,6 +246,8 @@ def info(file_path: str):
|
|
|
240
246
|
f"Columns: {table.column_names}",
|
|
241
247
|
title=path.name,
|
|
242
248
|
))
|
|
249
|
+
else:
|
|
250
|
+
raise click.ClickException("Unsupported file type. Expected .json or .parquet")
|
|
243
251
|
|
|
244
252
|
|
|
245
253
|
def _save_parquet(window, path: Path) -> None:
|
|
@@ -21,7 +21,7 @@ This module provides the single source of truth for the package version.
|
|
|
21
21
|
|
|
22
22
|
__all__ = ["__version__", "__author__", "__contact__", "__license__", "__copyright__"]
|
|
23
23
|
|
|
24
|
-
__version__ = "0.2.
|
|
24
|
+
__version__ = "0.2.4"
|
|
25
25
|
__author__ = "XRTM Team"
|
|
26
26
|
__contact__ = "moy@xrtm.org"
|
|
27
27
|
__license__ = "Apache-2.0"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xrtm-data
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: The Snapshot Vault for XRTM.
|
|
5
5
|
Author-email: XRTM Team <moy@xrtm.org>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
|
-
Requires-Python:
|
|
7
|
+
Requires-Python: <3.13,>=3.11
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Requires-Dist: pydantic>=2.0.0
|
|
@@ -29,6 +29,7 @@ src/xrtm_data.egg-info/requires.txt
|
|
|
29
29
|
src/xrtm_data.egg-info/top_level.txt
|
|
30
30
|
tests/test_beta_fitter.py
|
|
31
31
|
tests/test_cli_loading.py
|
|
32
|
+
tests/test_cli_ux.py
|
|
32
33
|
tests/test_local_datasource.py
|
|
33
34
|
tests/test_polymarket_source.py
|
|
34
35
|
tests/test_polymarket_subgraph.py
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from click.testing import CliRunner
|
|
5
|
+
|
|
6
|
+
from xrtm.data.cli import main
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_info_rejects_unsupported_suffix() -> None:
|
|
10
|
+
runner = CliRunner()
|
|
11
|
+
|
|
12
|
+
with runner.isolated_filesystem():
|
|
13
|
+
path = Path("trades.txt")
|
|
14
|
+
path.write_text("not a supported data file")
|
|
15
|
+
|
|
16
|
+
result = runner.invoke(main, ["info", str(path)])
|
|
17
|
+
|
|
18
|
+
assert result.exit_code != 0
|
|
19
|
+
assert "Unsupported file type" in result.output
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_collect_rejects_unsupported_output_suffix_before_fetching() -> None:
|
|
23
|
+
runner = CliRunner()
|
|
24
|
+
|
|
25
|
+
result = runner.invoke(main, ["collect", "-m", "0x1234", "-o", "trades.txt"])
|
|
26
|
+
|
|
27
|
+
assert result.exit_code != 0
|
|
28
|
+
assert "Output path must end with .parquet or .json" in result.output
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_info_accepts_json_file() -> None:
|
|
32
|
+
runner = CliRunner()
|
|
33
|
+
|
|
34
|
+
with runner.isolated_filesystem():
|
|
35
|
+
path = Path("prior.json")
|
|
36
|
+
path.write_text(json.dumps({"family": "beta", "alpha": 1, "beta": 2}))
|
|
37
|
+
|
|
38
|
+
result = runner.invoke(main, ["info", str(path)])
|
|
39
|
+
|
|
40
|
+
assert result.exit_code == 0
|
|
41
|
+
assert "Prior File" in result.output
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|