
Misata: synthetic data library
io.github.rasinmuhammed由 GitHub 账号 rasinmuhammed 发布v0.9.8更新于 Nov 2, 2026
Declarative synthetic data: multi-table data that holds the facts you declare, checked by DuckDB.
概览
Misata 是一个声明式合成数据生成器,可生成满足所声明事实的多表数据,并用 DuckDB 校验、出具可复跑的证书。
- 可以做什么
- 根据 YAML 或字典 schema、一句描述、SQL DDL 或故事领域生成数据集,生成前先检查声明是否可同时成立
- 解释、校验和查看 schema,预览并列出可用的故事领域
- 向在线数据库灌入数据、创建并查询沙箱、驱动流水线达到声明的结果
- 对生成的数据集做认证与审计,并评估其真实感
- 输出 CSV、Parquet、JSONL、DuckDB 或 Postgres,并附带独立校验脚本逐条复核派生不变量
- 适用场景
- 适合需要测试夹具、开发或预发数据库、评测数据、智能体沙箱或演示租户,且希望答案独立于被测代码即可知的场景;也适合让助手设计 schema、由引擎做算术、再由 DuckDB 认证。
- 运行要求
- 以本地 stdio 进程运行,通过 uvx 从 PyPI 安装(misata 及 mcp 附加包)。生成与校验需要 Python 和 DuckDB;向在线数据库灌数据需要该数据库的连接串。
安装
在 SourceWeft 中
- 打开 控制台中的 Misata: synthetic data library,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Misata
Declare what must be true. Get data that makes it true. Prove it.
Misata is a declarative synthetic data generator for Python. You write down the facts a dataset has to satisfy, from a monthly revenue curve to a balanced ledger to a foreign key that must never dangle, and the engine builds multi-table data that satisfies all of them at once. Then DuckDB checks the files on disk and writes a certificate anyone can re-run.
[PyPI] [Python] [Tests] [License] [Open in Colab] [smithery badge]
Docs · Use cases · The language · Limitations · Studio · Changelog
Sixty seconds
The 69 are derived from the YAML before a row exists: twelve monthly revenue
totals (180,000.00 in January, 240,000.00 in June, 310,000.00 in December,
straight lines between), the channel split inside every one of those months,
the planned row count per month, zero orphaned customer_ids and unique keys.
verify.py needs only the standard library and duckdb, and it shares no
code with the generator.
The YAML above, generated and summed by month and channel. Each bar is a month of generated revenue split by channel; the cap is the total the YAML declares. Drawn by readme_charts.py from a fresh run of this README's own YAML.
Change one cent in one row and it says so:
Why declare instead of generate
Every test fixture has an oracle problem. To check a dbt model, a Spark job, a dashboard tile or a data agent you need input data and an answer you know independently of the code under test. Copying production gives you data without an answer. Hand-written fixtures give you an answer that rots. Random generators give you data whose answer you have to compute with the code you are testing.
Misata turns it around. The specification is the ground truth and the rows are derived from it. "January revenue is 180,000" is true before a single row exists, so your pipeline either returns 180,000.00 or it has a bug.
Three properties make this different from a generator with options:
- A declaration is honoured or refused, never quietly replaced. Declarations that cannot all hold stop generation with an error that names each one, shows the arithmetic and suggests the change.
- The certificate is checked by code that did not write the data. A bug in Misata's arithmetic shows up as a failed invariant, not a self-consistent wrong answer.
- The same spec, seed and version give the same bytes on Linux, macOS and Windows, so a fixture can live in git with its fingerprint.
Where this is going
Misata's aim is that nobody writes a Python script to make a dataset, of any kind. You say what has to be true; the engine works out the rows, refuses what cannot hold, and proves what it built.
It is not there yet, and it is getting there brick by brick. Each release adds things you can declare instead of programming, and a brick is laid only when it passes three tests: it can be declared in a few lines of YAML, it is refused before generation when it contradicts another declaration, and it is re-checked on the rows afterwards by code that did not write them.
Every brick is something you declare instead of code. Drawn from misata/registry.py, the list a contract test holds the code to, so the wall cannot claim a brick the engine does not have.
One fact, two ways. What a script has to do to make a fact true, and what you write instead:
What still takes code, and where each one stands:
LIMITATIONS.md keeps the full list. When a line leaves this table, it is because the brick that replaces it has passed all three tests.
The evidence
The Gauntlet: 13 tables and 136 SQL assertions run by DuckDB. The Faker script ties wherever a fact is about one column at a time and loses wherever columns, rows or tables have to agree. Source, rerun with python -m benchmarks.gauntlet.
A gradient-boosted classifier tries to tell generated rows from real ones; mean of five seeds. Without seeing a real row, a declared schema beats SDV trained on the real orders. On taxi trips SDV wins: blind fares are a miss. Source, numbers in summary.json.
What you can declare
Each declaration has a guarantee stated so you could test it, a list of the columns it owns, a cost and a refusal. LANGUAGE.md is the reference. All 25 declaration kinds are checked for feasibility before a row exists and re-checked on the rows afterwards; the ones marked ✓ are also in the DuckDB certificate.
Underneath any declaration, foreign keys resolve by construction (parents are built before children), text agrees with its row, money is skewed, timestamps have a daily rhythm and a few customers place most of the orders, so the data looks like a business before you declare anything. A sentence picks one of 18 story domains, from SaaS and fintech to healthcare, logistics and streaming, each with its tables, keys and calibrated distributions.
Pick your entry point
Pass a seed every time. The same seed is the same data.
Twelve recipes
Each is a folder with the schema, the commands, and the check that proves the
declaration held. tools/stranger.py --clean runs every command on every page
from a freshly built wheel in a clean virtualenv before each release, so the
numbers on the pages are what you will see.
A status that implies its history
Declare the state machine once and every row's timestamps follow from its status. From the demo tenant:
Of 1,200 subscriptions, exactly 720 are active, 312 churned, 84 past due and 84 still trialing: weights are counts, allocated by largest remainder, not probabilities. Every past-due row has an activation date and a past-due date, in that order and after it started; no active row has a churn date. The certificate checks both, row by row. A state reachable several ways splits its rows across every route: of the 312 churned, 156 left during the trial, 78 after being active and 78 after falling past due.
The demo tenant's 1,200 subscriptions, grouped by which timestamps are set. Six routes, and no row outside them. Drawn by readme_charts.py from the recipe's own YAML.
When it says no
misata explain prints the planned rows, what each declaration will write,
how many invariants the certificate will carry and every conflict, without
generating anything. Every command takes --json and prints one envelope;
exit code 3 means the declarations cannot all hold and nothing was written.
With a coding agent
The agent designs the schema, Misata does the arithmetic, and DuckDB checks it. An agent cannot certify its own output; this is how it gets an answer it did not write.
Fifteen tools: generate_from_schema, generate_dataset, explain_schema,
validate_yaml, inspect_schema, preview_story, list_domains,
validate_domain, seed_database, create_sandbox, query_sandbox,
solve_outcome, attest_dataset, audit_dataset and check_realism.
AGENTS.md tells an agent which entry point fits which job and
which claims the evidence supports.
What it is not
Misata imitates nothing unless you ask it to. It does not learn a joint
distribution from your data. If you need a statistical twin of a specific
private table, use a differentially private synthesizer with a stated
epsilon. mimic fits to real rows and is not anonymous.
It is exact for what can be declared (sums, rates, shares, roll-ups,
ledgers, keys, lifecycles) and not for arbitrary SQL. A model built on a
window function or business logic Misata cannot invert still gets coherent,
key-valid inputs, and you write the expected output. misata solve closes
part of that gap by driving inputs through your real pipeline to a declared
outcome within a stated tolerance, and the certificate says which tolerance.
Priors are English-first and US-leaning on money, and rates round to whole rows. LIMITATIONS.md has the full list and wins any argument with the rest of the docs.
Cite
If Misata helps your work, cite the software. GitHub's Cite this repository button reads the same metadata from CITATION.cff.
Contribute
A capability earns a place only if it can be declared and verified. The
conformance suites in benchmarks/ are the contract: write the assertion
first, watch it fail, then make it pass. MIT licensed.
来源:README.md,提交 be29088
工具
0版本历史
3- v0.9.8最新Oct 26, 2026
- v0.9.6.60Oct 1, 2026
- v0.8.7.2Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分