eval-dataset-smith-py
Generate balanced AI eval fixtures from your bugs, docs, examples, and policies. Zero runtime dependencies.
Python port of @mukundakatta/eval-dataset-smith. The JS sibling has the full design notes; this README sticks to the Python API.
Install
pip install eval-dataset-smith-py
Usage
from eval_dataset_smith import forge_dataset, stratified_split
sources = [
{"type": "bug", "id": "B-1", "input": "repro: click X", "expected": "no crash", "difficulty": "easy"},
{"type": "bug", "id": "B-2", "input": "repro: open file Y", "expected": "no crash", "difficulty": "med"},
{"type": "doc", "question": "how does foo work?", "answer": "see chapter 3", "difficulty": "easy"},
{"type": "policy", "input": "is PII allowed?", "expected": "redact", "difficulty": "hard"},
]
ds = forge_dataset(sources, balance_keys=["type", "difficulty"])
ds.cases # list[EvalCase] -- the eval fixtures
ds.balance # {"type": {...}, "difficulty": {...}} -- audit input skew
len(ds) # 4
# Per-tag stratified split (preserves type balance across train/test)
parts = stratified_split([c.__dict__ for c in ds.cases], ratio=0.8)
parts["train"], parts["test"]
API
forge_dataset(sources, balance_keys=("type","difficulty"), max_per_type=20) -> Dataset
Top-level Pythonic entry point. Returns a typed Dataset of EvalCase records plus a balance histogram you can use to audit input skew.
build_eval_dataset(items, max_per_type=20) -> list[dict]
Direct port of the JS buildEvalDataset. Accepts the JS field-name aliases:
| Field | Aliases |
|---|---|
input |
input / question / prompt |
expected |
expected / answer / acceptance |
type |
type (defaults to "general") |
tags |
tags: list[str] |
stratified_split(items, ratio=0.8) -> {"train": [...], "test": [...]}
Direct port of the JS stratifiedSplit. Splits by the first tag of each item, slicing each group at ceil(len(group) * ratio).
API differences from the JS sibling
forge_datasetis a Python addition that returns typed dataclasses (Dataset,EvalCase).build_eval_datasetandstratified_splitmirror the JS function names withsnake_case.
See the JS sibling's README for the full design notes.
Metadata
Release files for eval-dataset-smith-py 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eval_dataset_smith_py-0.1.0.tar.gz | 7.3 kB | Without provenance | Details for eval_dataset_smith_py-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eval_dataset_smith_py-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for eval_dataset_smith_py-0.1.0-py3-none-any.whl |
Total release size: 13.9 kB
Release files / eval_dataset_smith_py-0.1.0.tar.gz
| Download URL | eval_dataset_smith_py-0.1.0.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a7829d92748846d9e817d806fbea65598afc778d3eceb6f4d9aaebee077a4a0
|
|
BLAKE2b-256 checksum How to use checksums |
d4aab6bdc9c489f4f4a988294ad0cdd6ef0d84732cf75cdb3614f7c3fc105cf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / eval_dataset_smith_py-0.1.0-py3-none-any.whl
| Download URL | eval_dataset_smith_py-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08e764e480f7ba256ac6f63ae9b7b3cd2e5368e62d5e262a4cd2a9e9519facf3
|
|
BLAKE2b-256 checksum How to use checksums |
b0c4e4413d1a72c6e2c55c8d9a0f7ed8d661e013f8b03e5e9ccf5789f4a8f574
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for eval-dataset-smith-py 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.