Skip to content

Domain format parsing guide

Maturity labels

  • Now: Stable and supported in current releases.
  • Preview: Usable today, but behavior and APIs may evolve.
  • Planned: Not yet implemented.

Note

Status: Now

Model-based tabular parsing for domain formats follows a stable three-step pattern.

1) Parse rows from text

>>> import omnipy as om
>>> text = "a\tb\n1\t2\n"
>>> om.TsvTableModel(text)

2) Apply typed row spec

>>> import omnipy as om
>>> import pydantic as pyd
>>> class Row(pyd.v1.BaseModel):
...     a: int
...     b: int
>>> om.Model[list[Row]](om.TsvTableModel("a\tb\n1\t2\n"))

3) Convert to downstream representation

For table workflows, convert parsed records to table/pandas-oriented structures as needed.