wealthschema 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.
- wealthschema-0.1.0/.gitignore +26 -0
- wealthschema-0.1.0/PKG-INFO +80 -0
- wealthschema-0.1.0/README.md +64 -0
- wealthschema-0.1.0/pyproject.toml +31 -0
- wealthschema-0.1.0/wealthschema/__init__.py +120 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
.next/
|
|
3
|
+
.env
|
|
4
|
+
.env.local
|
|
5
|
+
.env.development
|
|
6
|
+
.env.production
|
|
7
|
+
.env.test
|
|
8
|
+
*.log
|
|
9
|
+
.turso/
|
|
10
|
+
dist/
|
|
11
|
+
out/
|
|
12
|
+
*.tsbuildinfo
|
|
13
|
+
*.db
|
|
14
|
+
*.db-journal
|
|
15
|
+
.DS_Store
|
|
16
|
+
|
|
17
|
+
# Regenerable machine output from `npm run audit-claims` (baseline + report are committed)
|
|
18
|
+
content-audit/claims-inventory.json
|
|
19
|
+
|
|
20
|
+
# QA harness output (the harness scripts in qa/ are committed; their
|
|
21
|
+
# artifacts — screenshots, captured emails, reports — are regenerable)
|
|
22
|
+
qa/screenshots/
|
|
23
|
+
qa/outbox/
|
|
24
|
+
qa/report.json
|
|
25
|
+
qa/report.md
|
|
26
|
+
qa/flows-report.json
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: wealthschema
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official SDK for WealthSchema: cited U.S. financial-planning figures (API + MCP), synthetic-household evaluation samples, and the free Planning Benchmark for AI financial-advisor agents.
|
|
5
|
+
Project-URL: Homepage, https://www.wealthschema.com
|
|
6
|
+
Project-URL: Repository, https://github.com/CapsteraSupport/wealthschema-py
|
|
7
|
+
Author: WealthSchema
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: ai-agent-evaluation,benchmark,fintech,irs,mcp,no-pii,planning-figures,synthetic-data,synthetic-financial-data,tax,test-data,wealthschema,wealthtech
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# wealthschema (Python)
|
|
18
|
+
|
|
19
|
+
Official Python SDK for [WealthSchema](https://www.wealthschema.com) — the data layer for building and testing financial software. Zero dependencies (standard library only).
|
|
20
|
+
|
|
21
|
+
It wraps WealthSchema's public, free surfaces:
|
|
22
|
+
|
|
23
|
+
- **Rule Sets** — cited, current U.S. planning figures (IRS, SSA, CMS, Treasury) with issuer, document, section, and effective date.
|
|
24
|
+
- **Evaluation samples** — one deliberately-insufficient synthetic household per archetype.
|
|
25
|
+
- **Free Planning Benchmark** — tasks with ground-truth answers for evaluating AI financial-advisor agents.
|
|
26
|
+
- **Catalog** — the product catalog.
|
|
27
|
+
|
|
28
|
+
> The full synthetic-household **corpus is a one-time purchase**, delivered as files after checkout — not a metered API. This SDK intentionally has no method to download it. Samples are banded and truncated for evaluation only.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install wealthschema
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Quickstart
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from wealthschema import WealthSchema
|
|
40
|
+
|
|
41
|
+
ws = WealthSchema() # or WealthSchema(api_key="...") ; falls back to WEALTHSCHEMA_API_KEY
|
|
42
|
+
|
|
43
|
+
# A cited planning figure, with its source and effective date:
|
|
44
|
+
fact = ws.get_fact("us-federal-2026", "retirement.401k.elective_deferral.under_50")
|
|
45
|
+
print(fact["value"], fact["source"]) # 24500 {'issuer': 'IRS', 'document': 'Notice 2025-67', ...}
|
|
46
|
+
|
|
47
|
+
# A sample synthetic household (evaluation only):
|
|
48
|
+
sample = ws.get_sample_household("young-family-first-home")
|
|
49
|
+
|
|
50
|
+
# The free Planning Benchmark for agent evals:
|
|
51
|
+
bench = ws.get_benchmark(withhold_answers=True) # omit for the answer key
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Get a free API key at https://www.wealthschema.com/account/api-keys. The free tier works without a key.
|
|
55
|
+
|
|
56
|
+
## API
|
|
57
|
+
|
|
58
|
+
| Method | Returns |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `list_reference_datasets()` | Reference index + tier matrix |
|
|
61
|
+
| `get_reference_dataset(id)` | All cited facts for a dataset |
|
|
62
|
+
| `get_fact(id, key)` | One cited fact by key, or `None` |
|
|
63
|
+
| `get_manifest()` | Archetype/bundle taxonomy + sample links |
|
|
64
|
+
| `get_sample_household(archetype_id)` | One insufficient sample household |
|
|
65
|
+
| `get_catalog()` | Product catalog |
|
|
66
|
+
| `get_benchmark(withhold_answers=False)` | Free Planning Benchmark tasks |
|
|
67
|
+
|
|
68
|
+
Requests raise `WealthSchemaError` with `.status` and `.code` (e.g. `code="rate_limited"` on HTTP 429).
|
|
69
|
+
|
|
70
|
+
## MCP
|
|
71
|
+
|
|
72
|
+
Rule Sets is also an MCP server:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{ "mcpServers": { "wealthschema": { "url": "https://www.wealthschema.com/api/mcp" } } }
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT. Data and API use are governed by the [feed terms](https://www.wealthschema.com/reference-feed-terms) and per-purchase license.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# wealthschema (Python)
|
|
2
|
+
|
|
3
|
+
Official Python SDK for [WealthSchema](https://www.wealthschema.com) — the data layer for building and testing financial software. Zero dependencies (standard library only).
|
|
4
|
+
|
|
5
|
+
It wraps WealthSchema's public, free surfaces:
|
|
6
|
+
|
|
7
|
+
- **Rule Sets** — cited, current U.S. planning figures (IRS, SSA, CMS, Treasury) with issuer, document, section, and effective date.
|
|
8
|
+
- **Evaluation samples** — one deliberately-insufficient synthetic household per archetype.
|
|
9
|
+
- **Free Planning Benchmark** — tasks with ground-truth answers for evaluating AI financial-advisor agents.
|
|
10
|
+
- **Catalog** — the product catalog.
|
|
11
|
+
|
|
12
|
+
> The full synthetic-household **corpus is a one-time purchase**, delivered as files after checkout — not a metered API. This SDK intentionally has no method to download it. Samples are banded and truncated for evaluation only.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install wealthschema
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quickstart
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from wealthschema import WealthSchema
|
|
24
|
+
|
|
25
|
+
ws = WealthSchema() # or WealthSchema(api_key="...") ; falls back to WEALTHSCHEMA_API_KEY
|
|
26
|
+
|
|
27
|
+
# A cited planning figure, with its source and effective date:
|
|
28
|
+
fact = ws.get_fact("us-federal-2026", "retirement.401k.elective_deferral.under_50")
|
|
29
|
+
print(fact["value"], fact["source"]) # 24500 {'issuer': 'IRS', 'document': 'Notice 2025-67', ...}
|
|
30
|
+
|
|
31
|
+
# A sample synthetic household (evaluation only):
|
|
32
|
+
sample = ws.get_sample_household("young-family-first-home")
|
|
33
|
+
|
|
34
|
+
# The free Planning Benchmark for agent evals:
|
|
35
|
+
bench = ws.get_benchmark(withhold_answers=True) # omit for the answer key
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Get a free API key at https://www.wealthschema.com/account/api-keys. The free tier works without a key.
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
| Method | Returns |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `list_reference_datasets()` | Reference index + tier matrix |
|
|
45
|
+
| `get_reference_dataset(id)` | All cited facts for a dataset |
|
|
46
|
+
| `get_fact(id, key)` | One cited fact by key, or `None` |
|
|
47
|
+
| `get_manifest()` | Archetype/bundle taxonomy + sample links |
|
|
48
|
+
| `get_sample_household(archetype_id)` | One insufficient sample household |
|
|
49
|
+
| `get_catalog()` | Product catalog |
|
|
50
|
+
| `get_benchmark(withhold_answers=False)` | Free Planning Benchmark tasks |
|
|
51
|
+
|
|
52
|
+
Requests raise `WealthSchemaError` with `.status` and `.code` (e.g. `code="rate_limited"` on HTTP 429).
|
|
53
|
+
|
|
54
|
+
## MCP
|
|
55
|
+
|
|
56
|
+
Rule Sets is also an MCP server:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{ "mcpServers": { "wealthschema": { "url": "https://www.wealthschema.com/api/mcp" } } }
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT. Data and API use are governed by the [feed terms](https://www.wealthschema.com/reference-feed-terms) and per-purchase license.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "wealthschema"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Official SDK for WealthSchema: cited U.S. financial-planning figures (API + MCP), synthetic-household evaluation samples, and the free Planning Benchmark for AI financial-advisor agents."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "WealthSchema" }]
|
|
13
|
+
keywords = [
|
|
14
|
+
"wealthschema", "synthetic-data", "synthetic-financial-data", "fintech",
|
|
15
|
+
"wealthtech", "test-data", "irs", "tax", "planning-figures", "mcp",
|
|
16
|
+
"ai-agent-evaluation", "benchmark", "no-pii",
|
|
17
|
+
]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Topic :: Software Development :: Libraries",
|
|
23
|
+
]
|
|
24
|
+
dependencies = []
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://www.wealthschema.com"
|
|
28
|
+
Repository = "https://github.com/CapsteraSupport/wealthschema-py"
|
|
29
|
+
|
|
30
|
+
[tool.hatch.build.targets.wheel]
|
|
31
|
+
packages = ["wealthschema"]
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""WealthSchema Python SDK.
|
|
2
|
+
|
|
3
|
+
A thin, dependency-free client for WealthSchema's public, free surfaces:
|
|
4
|
+
|
|
5
|
+
- Rule Sets: cited, current U.S. planning figures (API + MCP).
|
|
6
|
+
- Evaluation samples: one deliberately-insufficient synthetic household per
|
|
7
|
+
archetype (a taste; the full corpus is a one-time purchase, not an API).
|
|
8
|
+
- The free Planning Benchmark for AI financial-advisor agents.
|
|
9
|
+
- The product catalog.
|
|
10
|
+
|
|
11
|
+
By design there is no method to download the synthetic-household corpus: it is
|
|
12
|
+
static reference data sold once via checkout, never a metered data API. Samples
|
|
13
|
+
are intentionally banded/truncated. See https://www.wealthschema.com/llms.txt
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import json
|
|
19
|
+
import os
|
|
20
|
+
import urllib.error
|
|
21
|
+
import urllib.parse
|
|
22
|
+
import urllib.request
|
|
23
|
+
from typing import Any, Optional
|
|
24
|
+
|
|
25
|
+
__version__ = "0.1.0"
|
|
26
|
+
__all__ = ["WealthSchema", "WealthSchemaError"]
|
|
27
|
+
|
|
28
|
+
_DEFAULT_BASE = "https://www.wealthschema.com"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class WealthSchemaError(Exception):
|
|
32
|
+
"""Raised when a request fails. Carries HTTP ``status`` and optional ``code``."""
|
|
33
|
+
|
|
34
|
+
def __init__(self, message: str, status: Optional[int] = None, code: Optional[str] = None):
|
|
35
|
+
super().__init__(message)
|
|
36
|
+
self.status = status
|
|
37
|
+
self.code = code
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class WealthSchema:
|
|
41
|
+
def __init__(
|
|
42
|
+
self,
|
|
43
|
+
api_key: Optional[str] = None,
|
|
44
|
+
base_url: str = _DEFAULT_BASE,
|
|
45
|
+
timeout: float = 30.0,
|
|
46
|
+
):
|
|
47
|
+
self.api_key = api_key or os.environ.get("WEALTHSCHEMA_API_KEY")
|
|
48
|
+
self.base_url = base_url.rstrip("/")
|
|
49
|
+
self.timeout = timeout
|
|
50
|
+
|
|
51
|
+
def _get(self, path: str, auth: bool = False, query: Optional[dict] = None) -> Any:
|
|
52
|
+
url = self.base_url + path
|
|
53
|
+
if query:
|
|
54
|
+
clean = {k: v for k, v in query.items() if v is not None}
|
|
55
|
+
if clean:
|
|
56
|
+
url += "?" + urllib.parse.urlencode(clean)
|
|
57
|
+
headers = {"Accept": "application/json", "User-Agent": f"wealthschema-py/{__version__}"}
|
|
58
|
+
if auth and self.api_key:
|
|
59
|
+
headers["Authorization"] = f"Bearer {self.api_key}"
|
|
60
|
+
req = urllib.request.Request(url, headers=headers)
|
|
61
|
+
try:
|
|
62
|
+
with urllib.request.urlopen(req, timeout=self.timeout) as resp:
|
|
63
|
+
return json.loads(resp.read().decode("utf-8"))
|
|
64
|
+
except urllib.error.HTTPError as e:
|
|
65
|
+
if e.code == 429:
|
|
66
|
+
retry = e.headers.get("Retry-After")
|
|
67
|
+
raise WealthSchemaError(
|
|
68
|
+
f"Rate limited{f'; retry after {retry}s' if retry else ''}. "
|
|
69
|
+
"Add an API key or upgrade your tier.",
|
|
70
|
+
status=429,
|
|
71
|
+
code="rate_limited",
|
|
72
|
+
) from None
|
|
73
|
+
body = {}
|
|
74
|
+
try:
|
|
75
|
+
body = json.loads(e.read().decode("utf-8"))
|
|
76
|
+
except Exception:
|
|
77
|
+
pass
|
|
78
|
+
raise WealthSchemaError(
|
|
79
|
+
body.get("message") or body.get("error") or f"Request failed ({e.code})",
|
|
80
|
+
status=e.code,
|
|
81
|
+
code=body.get("code"),
|
|
82
|
+
) from None
|
|
83
|
+
|
|
84
|
+
# ── Rule Sets: cited planning figures ────────────────────────────────
|
|
85
|
+
def list_reference_datasets(self) -> Any:
|
|
86
|
+
"""Index of reference datasets + tier matrix."""
|
|
87
|
+
return self._get("/api/reference/v1", auth=True)
|
|
88
|
+
|
|
89
|
+
def get_reference_dataset(self, dataset_id: str) -> Any:
|
|
90
|
+
"""All cited facts for a dataset, e.g. ``us-federal-2026``."""
|
|
91
|
+
return self._get(f"/api/reference/v1/{urllib.parse.quote(dataset_id)}", auth=True)
|
|
92
|
+
|
|
93
|
+
def get_fact(self, dataset_id: str, key: str) -> Optional[dict]:
|
|
94
|
+
"""One cited fact by key, or None."""
|
|
95
|
+
doc = self.get_reference_dataset(dataset_id)
|
|
96
|
+
for fact in (doc or {}).get("facts", []):
|
|
97
|
+
if fact.get("key") == key:
|
|
98
|
+
return fact
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
# ── Evaluation samples (a taste; not the corpus) ─────────────────────
|
|
102
|
+
def get_manifest(self) -> Any:
|
|
103
|
+
"""Machine manifest: archetype/bundle taxonomy + sample links."""
|
|
104
|
+
return self._get("/api/for-agents")
|
|
105
|
+
|
|
106
|
+
def get_sample_household(self, archetype_id: str) -> Any:
|
|
107
|
+
"""One deliberately-insufficient sample household (evaluation only)."""
|
|
108
|
+
return self._get(f"/api/for-agents/households/{urllib.parse.quote(archetype_id)}")
|
|
109
|
+
|
|
110
|
+
def get_catalog(self) -> Any:
|
|
111
|
+
"""Product catalog."""
|
|
112
|
+
return self._get("/api/catalog")
|
|
113
|
+
|
|
114
|
+
# ── Free Planning Benchmark ──────────────────────────────────────────
|
|
115
|
+
def get_benchmark(self, withhold_answers: bool = False) -> Any:
|
|
116
|
+
"""The free Planning Benchmark for AI financial-advisor agents."""
|
|
117
|
+
return self._get(
|
|
118
|
+
"/api/benchmark/v1",
|
|
119
|
+
query={"withhold_answers": "true"} if withhold_answers else None,
|
|
120
|
+
)
|