No description
  • JavaScript 77.1%
  • Python 16.1%
  • TypeScript 4.8%
  • CSS 0.8%
  • HTML 0.6%
  • Other 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
oliver.maklott c955830d81
All checks were successful
sheets / sheets (pull_request) Successful in 10s
sheets / sheets (push) Successful in 10s
Release 1.2.0: German thousands by one rule; a file is what its bytes are
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVUe4hWqPfFUKC4KEEmcM2
2026-11-28 20:03:51 +00:00
.forgejo/workflows TK01: the workbook reader of Meine-Lerndaten 1.4.1, extended (Plan 26) 2026-11-10 14:03:21 +00:00
app TK02: findings per cell and of CSV files, the table bridge app (Plan 26) 2026-11-10 14:10:08 +00:00
browser CR77: read German thousands by one rule; a file is what its bytes are 2026-11-27 22:42:52 +00:00
check TK03: checker core, vendor manifest, release 1.0.0 (Plan 26) 2026-11-10 14:12:48 +00:00
fixtures AR8: without a named sheet, read the first sheet with data (1.1.0) 2026-11-23 19:03:36 +00:00
scripts AR8: without a named sheet, read the first sheet with data (1.1.0) 2026-11-23 19:03:36 +00:00
test CR77: read German thousands by one rule; a file is what its bytes are 2026-11-27 22:42:52 +00:00
.gitignore TK03: checker core, vendor manifest, release 1.0.0 (Plan 26) 2026-11-10 14:12:48 +00:00
.npmrc TK01: the workbook reader of Meine-Lerndaten 1.4.1, extended (Plan 26) 2026-11-10 14:03:21 +00:00
.prettierignore TK03: checker core, vendor manifest, release 1.0.0 (Plan 26) 2026-11-10 14:12:48 +00:00
.prettierrc TK01: the workbook reader of Meine-Lerndaten 1.4.1, extended (Plan 26) 2026-11-10 14:03:21 +00:00
LICENSE.md Initial commit: license 2026-11-10 14:03:20 +00:00
package-lock.json Release 1.2.0: German thousands by one rule; a file is what its bytes are 2026-11-28 20:03:51 +00:00
package.json Release 1.2.0: German thousands by one rule; a file is what its bytes are 2026-11-28 20:03:51 +00:00
README.md CR77: read German thousands by one rule; a file is what its bytes are 2026-11-27 22:42:52 +00:00

@aivopod/sheets

Reads Excel workbooks (.xlsx) and CSV files in the browser, for Aivopod packs that check work students did in a spreadsheet program. Plan 26 of Aivopod (docs/PLAN-26.md in aivopod-app, Teil AZ of its docs/SPEC.md).

Part What
browser/ classic scripts on window.AivopodSheets, no build: xml, zip, formula, xlsx, csv. They run as they are back to Safari 15.4.
app/ the table bridge: a pack app that reads the file a student picks and answers what a step asks for (settings.cells); it loads the scripts from vendor/
fixtures/ lerndaten/: the workbooks of Meine-Lerndaten 1.4.1 (made by scripts/lerndaten-fixtures.py, openpyxl); reader/: scripts/build-fixtures.py

The reader came from the Excel bridge of the pack Meine-Lerndaten (1.4.1). test/legacy/ holds that reader; a test reads every workbook of the pack with both and requires the library to return everything the old reader did, with the same values.

Packs take the library through aivopod.vendor in their package.json; aivopod pack build copies the parts into the pack (Teil AZ, D516).

Findings per cell

A step asks with settings.cells: ranges and the fields wanted, at most 400 cells. The answer has only those fields, and only where they differ from the default. It always fits the platform's limit (15 500 characters): when it would not, texts and formulas get shorter, then cells at the end are left out, and trimmed says so. Fields and the answer's shape: browser/cells.js, test/schema.mjs.

A step names its sheet with settings.sheet. Without one, the bridge reads the first visible sheet that holds a value or a formula (1.1.0): Excel's "Daten abrufen ▸ Aus Text/CSV ▸ Laden" puts the data on a new sheet beside the empty "Tabelle1" of a new workbook.

What a file is

The bytes decide what a file is (cells.detect), never its name: a workbook is a ZIP archive with a workbook part, so a .docx or .pptx is unbekannt and not a workbook without sheets; an OpenDocument file is ods only when it is a spreadsheet; a CSV file is text, so a picture, a PDF, an RTF or HTML file or anything with control characters is unbekannt. A workbook with macros or of a macro format is makro-datei; a workbook merely named .xlsm is read. detect never throws. xlsx.read throws only Error("zip:…"), Error("xml:…") or Error("xlsx:…"): xlsx:no-workbook for an Office file that is no workbook, xlsx:broken (with cause) for a damaged one.

Numbers in CSV files

A CSV file has no types, so the library reads its fields the way a German Excel does, by one rule (csv.number; csv.num, the cells of a CSV file and its decimalComma all follow it):

  • The comma is the decimal sign: 0,45, 1234,5, and also 1,234 (1.234, not 1234).
  • A point is a thousands separator, and only between groups: one to three digits that do not start with 0, then groups of exactly three: 1.234 is 1234, 1.234,5 is 1234.5. A no-break space (U+00A0, U+202F) groups the same way: the Unicode locale data (CLDR), which Apple's programs follow, group like that for Austria.
  • A point is never a decimal sign. 0.59, 1.5, 0.125, 1.2345, 1,234.5, 1'234 and 1 234 with a plain space are text (t: "s"), as are 12,5 % and 13,50 €. 1.2.2024 is a date.

So the ambiguous 1.234 is always 1234. csv.num is for apps that read fields themselves: the same rule first, and for everything else a plain JavaScript number (0.59 is 0.59) or null.

Checker core

@aivopod/sheets/check (TypeScript, no runtime dependencies) goes into a pack's checker: answerOf(answer, { accept, template, calculated }) gives the answer or a basis error with a fixed ID (sheets.keine-datei, sheets.nur-csv, sheets.nur-xlsx, sheets.makro-datei, sheets.falsches-format, sheets.falsche-vorlage, sheets.nicht-berechnet, sheets.blatt-fehlt); the pack has texts for them under feedback.sheets.*. The template counts by <pack>/<file>, not by its version. Helpers say facts about cells (samePattern, constantsIn, allBorders, merged, near, …); the verdict and its feedback are the pack's.

Vendoring into a pack

aivopod-vendor.json (written by npm run build) names what a pack may copy and the SHA-256 of each file: the browser scripts in load order, the app tabellen-bruecke (scripts go into its vendor/) and the checker core. A pack names the package under aivopod.vendor in its package.json; aivopod pack build copies the files and refuses changed ones (D516).

Develop

npm install
npm run check              # prettier and the tests (node --test)
python3 scripts/build-fixtures.py   # rebuild fixtures/reader (Python 3, no libraries)

A new version in package.json on main is published by CI to the npm registry of the aivopod organisation (scripts/publish.sh, secret PACKAGE_TOKEN).

License

FSL-1.1-ALv2, see LICENSE.md.