
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 分