DEV Community

Cover image for Omnist: Canonical Schema and Data Model for JSON, YAML, TOML, and XML
Thomas Lee
Thomas Lee

Posted on • Originally published at omnist.dev

Omnist: Canonical Schema and Data Model for JSON, YAML, TOML, and XML

If you've ever hand-written a converter between JSON and YAML, or guessed whether a schema change would break someone downstream, this might be useful.

I built Omnist — an open-source Python library with one tree model underneath JSON, YAML, TOML, and XML. Read any of them into the same structure, validate it against a schema, write it back out to any of the others. No per-pair converters.

I put together a short deck walking through the model and implementation:

👉 omnist.dev/presentation.html

It also ships a schema algebra, all decidable rather than heuristic:

  • compatible_with — will every old document still validate under a new schema?
  • equivalent — do two differently-written schemas accept the same documents?
  • normalize — collapse a schema to its canonical minimal form
  • extract — the minimal subschema for a subset of fields

100% line coverage, mypy --strict, property-based fuzzing.

The story behind it

Omnist started as a 16-year-old idea from my PhD research, built out in two weeks of spare time with AI doing most of the heavy lifting on both the thinking and the shipping side. If you're curious how that actually worked — not just "AI writes code fast," but how research decisions and engineering execution stayed separated even with one person running both — I wrote it up as a five-part series:

  1. Omnist: I Turned My Sixteen-Year-Old PhD Research Into a Personal Open Source Project in Two Weeks
  2. A Team of One, Running Two Teams
  3. The Research Assistant in the Room
  4. The DevOps Team That Never Sleeps
  5. Alpha to Beta: Bringing In QA

Try it out

Quick start: omnist.dev/quickstart

Install Omnist:

pip install omnist
Enter fullscreen mode Exit fullscreen mode

Feedback and issues genuinely welcome — github.com/omnist-dev/omnist.

Top comments (0)