Skip to content

feat(spreadsheets): read jamovi data files (.omv) - #1997

Open
YusufMntm wants to merge 1 commit into
KnifeLemon:mainfrom
YusufMntm:feat/omv-1818
Open

YusufMntm wants to merge 1 commit into
KnifeLemon:mainfrom
YusufMntm:feat/omv-1818

Conversation

@YusufMntm

Copy link
Copy Markdown
Contributor

Fixes #1818

What

jamovi data files (.omv) now open in Filee and convert to XLSX, ODS, CSV and TSV, and on from there to everything a spreadsheet reaches (PDF, JSON, HTML, HWPX, ...). Only the data table is read; analyses and results inside the file are ignored.

How

  • Office/Sheets/OmvReader.cs is a new built-in reader. It reads the archive the way jamovi's own formatio/omv.py writes it:
    • the manifest (meta, or META-INF/MANIFEST.MF in older files) must name a jamovi-Archive-Version;
    • metadata.json gives the columns, xdata.json the labels;
    • data.bin is column-major: Decimal columns are 8-byte doubles (NaN = missing); every other column is a 4-byte int (int.MinValue = missing);
    • text columns hold level numbers, shown as their labels;
    • ID text columns hold offsets into strings.bin.
  • Integers and decimals stay real numbers in XLSX/ODS. Integer columns keep the raw number, not a value label, the same as jamovi's own CSV export.
  • Filter columns are left out, as jamovi's CSV export leaves active filters out. Filter formulas aren't evaluated, so every row is kept.
  • Older archives without dataType (NominalText, Continuous) are read with jamovi's own fallback rules.
  • The reader is added as a source of SpreadsheetConverter. Format omv is Spreadsheet, read-only, graded Specialist in the science field (statistics, off by default).
  • Schema v112 lets existing spreadsheet donuts learn .omv. SharedPresetVersions gets omv = 2.6.0. README and ENGINES.md are updated.
  • Refused with error.unsupported_source:
    • files that aren't ZIPs or have no jamovi manifest;
    • a missing or broken metadata.json, or a missing data.bin;
    • a data.bin shorter than the columns need;
    • string offsets outside strings.bin;
    • data sets larger than a sheet can hold (1,048,575 rows, 16,384 columns).

Tests

  • OmvTests (Engines, 10 tests) builds .omv archives in the test and checks:
    • Integer, Decimal, text-with-labels and ID-text columns to XLSX/ODS/CSV/TSV, with non-ASCII text;
    • missing values;
    • filter and computed columns;
    • an old manifest without dataType;
    • 0 rows;
    • the refusals, an existing output kept on refusal, and cancellation.
  • OmvFormatTests (Core): registry, donut, field and the v112 step. FormatFieldsTests and UserDataStoreTests are updated.
  • Results: Engines Omv|Spreadsheet|Route 216 passed / 5 skipped (LibreOffice/rhwp); the whole Filee.Core.Tests 1905 passed / 11 skipped; dotnet format --verify-no-changes is clean.

Not tried by hand

No real .omv file was available (the issue has no sample). The test archives follow jamovi's writer code exactly, but I haven't opened a file saved by jamovi itself.

The schema step is v112. My open PRs #1994 and #1995 also use v112, so whichever merges later needs renumbering; I'll do that on request.

CHANGELOG lines are in a comment below, per the changelog policy.

🤖 Generated with Claude Code

.omv files from jamovi now convert to XLSX, ODS, CSV and TSV (and on from
there, to PDF, JSON, HTML, ...). The data table is read in managed code
from the archive, the way jamovi itself writes it: metadata.json for the
columns, xdata.json for the labels of text columns, the column-major
data.bin and strings.bin for ID text. Integers and decimals stay numbers,
missing values are empty cells, and filter columns, analyses and results
are left out. Older archives without a dataType are read too. A file that
isn't a jamovi archive, or whose data.bin is cut short, is refused.
Schema v112 lets existing spreadsheet donuts learn the extension.

Fixes KnifeLemon#1818

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YusufMntm
YusufMntm requested a review from KnifeLemon as a code owner December 2, 2026 18:57
@YusufMntm

Copy link
Copy Markdown
Contributor Author

The CHANGELOG.md lines for this one, for the CHANGELOG PR:

ko: jamovi 데이터 파일(.omv)을 XLSX, ODS, CSV, TSV로 바꿀 수 있어요
en: jamovi data files (.omv) convert to XLSX, ODS, CSV and TSV
- **jamovi data files** (#1818). `.omv` data sets from jamovi convert to XLSX, ODS, CSV and TSV (and on to PDF, JSON
  and the other spreadsheet targets): numbers stay numbers, text columns show their labels, missing values stay
  empty. Analyses, results and filter columns are left out.

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this one, @YusufMntm. The reader follows jamovi's writer closely (virtual columns, cumulative string offsets, the dataType fallback, missing values), and the tests build every archive in code. A few things before it can go in:

1. No cap on cells or text (blocking)

data.bin is streamed, but nothing limits how many cells or how much text the workbook grows to. Two small files can run Filee out of memory:

  • 2,000 Integer fields × 1,048,575 rows of zeros: data.bin is 8.4 GB but deflates to about 8 MB, and it becomes about 2.1 billion cells.
  • strings.bin holding 256 MB of A and one terminating zero (about 250 KB packed), with every ID offset in data.bin set to 0: every row decodes a fresh 256 MB string (ReadIdString), so about 30 rows fill 16 GB.

OdsReader already guards against exactly this: MaxCells = 10_000_000 and MaxTextCharacters = BoundedXml.MaxPartBytes, refused with error.document_too_large. Could you do the same here?

  • Refuse up front when rowCount × kept columns is over the cell limit.
  • Spend a text budget on each text cell (labels and ID strings), and check end - offset against it before calling GetString.

A test for each, built in code like the others, would be great.

2. Archive version

jamovi itself refuses a jamovi-Archive-Version whose major version is above 12 ("A newer version of jamovi is required", in formatio/omv.py). Here any value is accepted, so a future layout would come out as wrong numbers with no error. Please parse the major version and refuse unknown ones.

3. Translated READMEs

Only README.md gained "OMV (jamovi) read". The spreadsheet row in docs/readme/README.*.md needs the same line, as you did in #1988.

4. Schema 112

#1994 and #1995 also take 112. Whichever merges later moves to the next number: the constant, the from < N step, and the ApplyToLibrary(...) calls and test names in OmvFormatTests and UserDataStoreTests. We'll tell you which number when it's time.

Smaller things, take or leave:

  • The size refusals could use error.document_too_large, as the ODS reader does.
  • jamovi's columnCount includes virtual columns and fields doesn't, so the columnCount check can refuse a data set whose fields fit. The fields count check is enough on its own.
  • jamovi's CSV export drops only active filters (column.is_filter and column.active). metadata.json has active, so inactive filter columns could stay.
  • The v112 test appears twice, in OmvFormatTests and UserDataStoreTests. One is enough.

CI never started on this PR (no checks at all). Your next push should trigger it.

@github-actions github-actions Bot added the feature New features label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Format]: .omv

2 participants