ODS
Read the sheets of a LibreOffice Calc file (.ods) as JSON rows with typed values, and write JSON rows into a new .ods file with one or more sheets, dates, percentages and amounts. Merged cells, repeated rows and very large empty areas are handled safely. Typical uses: import a spreadsheet filled by a team, send a report to a partner who uses LibreOffice, convert between Excel and LibreOffice files.
ods write <ods_path> <json_rows>
Description
Write JSON rows into an .ods file (the folders are created, an existing file is replaced): an array of rows gives one sheet (Sheet1), an object {"sheet name": rows, ...} gives one sheet per key. Returns {file, sheets [{name, rows, columns}]}
Write JSON rows into an .ods file (the folders are created, an existing file is replaced): an array of rows gives one sheet (Sheet1), an object {"sheet name": rows, ...} gives one sheet per key. Returns {file, sheets [{name, rows, columns}]}
Parameters
ods_path: The .ods file to write - String - required
json_rows: The rows - String - required
ods_path: The .ods file to write - String - required
json_rows: The rows - String - required
admin
ods write "tmp/doc_ods/simple.ods" "[{\"shop\": \"Saint-Denis\", \"day\": \"2026-03-01\", \"amount\": 1250.5, \"margin\": 0.185, \"paid\": true}, {\"shop\": \"Saint-Pierre\", \"day\": \"2026-03-02\", \"amount\": 980, \"margin\": 0.12, \"paid\": false}, {\"shop\": \"Le Port\", \"day\": \"2026-03-02\", \"amount\": 455.25, \"margin\": null, \"paid\": true, \"note\": \"two lines: closed at noon\"}]"
mentdb
{"file": "tmp/doc_ods/simple.ods", "sheets": [{"name": "Sheet1", "rows": 3, "columns": 6}]}
ods write <ods_path> <json_rows> <json_params>
Description
Write with parameters: sheet (name for an array of rows), columns (order and subset), date_columns (yyyy-MM-dd or yyyy-MM-dd HH:mm:ss texts written as real dates), time_columns (HH:mm or HH:mm:ss), percent_columns (0.185 shown 18.50 %), currency_columns and currency (EUR by default, ISO code), widths ({"column": cm}), header (true), freeze (true: the header stays visible), autosize (true: widths from the first 10 000 rows). A text that is no valid date or time stays a text, and so does a date before 1582-10-15 (LibreOffice would read it in the Julian calendar). Sheet names: no [ ] * ? : / \ and different without case
Write with parameters: sheet (name for an array of rows), columns (order and subset), date_columns (yyyy-MM-dd or yyyy-MM-dd HH:mm:ss texts written as real dates), time_columns (HH:mm or HH:mm:ss), percent_columns (0.185 shown 18.50 %), currency_columns and currency (EUR by default, ISO code), widths ({"column": cm}), header (true), freeze (true: the header stays visible), autosize (true: widths from the first 10 000 rows). A text that is no valid date or time stays a text, and so does a date before 1582-10-15 (LibreOffice would read it in the Julian calendar). Sheet names: no [ ] * ? : / \ and different without case
Parameters
ods_path: The .ods file to write - String - required
json_rows: The rows - String - required
json_params: The parameters - String - required
ods_path: The .ods file to write - String - required
json_rows: The rows - String - required
json_params: The parameters - String - required
admin
ods write "tmp/doc_ods/sales.ods" "[{\"shop\": \"Saint-Denis\", \"day\": \"2026-03-01\", \"amount\": 1250.5, \"margin\": 0.185, \"paid\": true}, {\"shop\": \"Saint-Pierre\", \"day\": \"2026-03-02\", \"amount\": 980, \"margin\": 0.12, \"paid\": false}, {\"shop\": \"Le Port\", \"day\": \"2026-03-02\", \"amount\": 455.25, \"margin\": null, \"paid\": true, \"note\": \"two lines: closed at noon\"}]" "{\"date_columns\": [\"day\"], \"percent_columns\": [\"margin\"], \"currency_columns\": [\"amount\"]}"
mentdb
{"file": "tmp/doc_ods/sales.ods", "sheets": [{"name": "Sheet1", "rows": 3, "columns": 6}]}
Two sheets, a time column and a fixed width
admin
ods write "tmp/doc_ods/book.ods" "{\"Sales\": [{\"shop\": \"Saint-Denis\", \"day\": \"2026-03-01\", \"amount\": 1250.5, \"margin\": 0.185, \"paid\": true}, {\"shop\": \"Saint-Pierre\", \"day\": \"2026-03-02\", \"amount\": 980, \"margin\": 0.12, \"paid\": false}, {\"shop\": \"Le Port\", \"day\": \"2026-03-02\", \"amount\": 455.25, \"margin\": null, \"paid\": true, \"note\": \"two lines: closed at noon\"}], \"Shops\": [{\"shop\": \"Saint-Denis\", \"opens\": \"08:30\", \"manager\": \"A. Payet\"}, {\"shop\": \"Le Port\", \"opens\": \"09:00\", \"manager\": \"J. Hoarau\"}]}" "{\"time_columns\": [\"opens\"], \"widths\": {\"manager\": 6}}"
mentdb
{"file": "tmp/doc_ods/book.ods", "sheets": [{"name": "Sales", "rows": 3, "columns": 6}, {"name": "Shops", "rows": 2, "columns": 3}]}
ods sheets <ods_path>
Description
The sheets of an .ods file: name, index (from 0), rows (last row with a value, header included) and columns (last column with a value)
The sheets of an .ods file: name, index (from 0), rows (last row with a value, header included) and columns (last column with a value)
Parameters
ods_path: The .ods file - String - required
ods_path: The .ods file - String - required
admin
ods sheets "tmp/doc_ods/book.ods"
mentdb
[{"name": "Sales", "index": 0, "rows": 4, "columns": 6}, {"name": "Shops", "index": 1, "rows": 3, "columns": 3}]
Used in use cases (1 recipe)
Accountant & manager › Send the sales of the month as a LibreOffice Calc file with a summary sheet
Accountant & manager › Send the sales of the month as a LibreOffice Calc file with a summary sheet
ods read <ods_path>
Description
Read the first sheet of an .ods file into JSON rows: the first line gives the names (an empty name gives c1, c2..., a repeated one name_2), values typed (see the top of the page), empty rows skipped
Read the first sheet of an .ods file into JSON rows: the first line gives the names (an empty name gives c1, c2..., a repeated one name_2), values typed (see the top of the page), empty rows skipped
Parameters
ods_path: The .ods file - String - required
ods_path: The .ods file - String - required
admin
ods read "tmp/doc_ods/sales.ods"
mentdb
[{"shop": "Saint-Denis", "day": "2026-03-01", "amount": 1250.5, "margin": 0.185, "paid": true, "note": null}, {"shop": "Saint-Pierre", "day": "2026-03-02", "amount": 980, "margin": 0.12, "paid": false, "note": null}, {"shop": "Le Port", "day": "2026-03-02", "amount": 455.25, "margin": null, "paid": true, "note": "two lines:\ closed at noon"}]
ods read <ods_path> <json_params>
Description
Read with parameters: sheet (name, or index from 0: a text is a sheet name first, so a sheet named 2024 is found by its name), header_row (1; 0 = no header, columns c1, c2...), first_row (first data line, from 1), max_rows, columns (forced names), types (auto | string: the text shown), skip_empty_rows (true), merged (first | fill: the value of merged cells copied into the covered cells)
Read with parameters: sheet (name, or index from 0: a text is a sheet name first, so a sheet named 2024 is found by its name), header_row (1; 0 = no header, columns c1, c2...), first_row (first data line, from 1), max_rows, columns (forced names), types (auto | string: the text shown), skip_empty_rows (true), merged (first | fill: the value of merged cells copied into the covered cells)
Parameters
ods_path: The .ods file - String - required
json_params: The parameters - String - required
ods_path: The .ods file - String - required
json_params: The parameters - String - required
admin
ods read "tmp/doc_ods/book.ods" "{\"sheet\": \"Shops\"}"
mentdb
[{"shop": "Saint-Denis", "opens": "08:30:00", "manager": "A. Payet"}, {"shop": "Le Port", "opens": "09:00:00", "manager": "J. Hoarau"}]
The text shown by the spreadsheet
admin
ods read "tmp/doc_ods/sales.ods" "{\"types\": \"string\", \"max_rows\": 2}"
mentdb
[{"shop": "Saint-Denis", "day": "2026-03-01", "amount": "1250.50 \u20AC", "margin": "18.50%", "paid": "TRUE", "note": null}, {"shop": "Saint-Pierre", "day": "2026-03-02", "amount": "980.00 \u20AC", "margin": "12.00%", "paid": "FALSE", "note": null}]
No header row, from the second line
admin
ods read "tmp/doc_ods/simple.ods" "{\"header_row\": 0, \"first_row\": 2, \"columns\": [\"shop\", \"day\"]}"
mentdb
[{"shop": "Saint-Denis", "day": "2026-03-01"}, {"shop": "Saint-Pierre", "day": "2026-03-02"}, {"shop": "Le Port", "day": "2026-03-02"}]
