nirs4all-io
Dataset-assembly bridge. Turn any user input — a directory, a list of files, a glob, a config dict/JSON/YAML, in-memory arrays, a folder of vendor spectra + a reference table — into a pipeline-ready dataset.
nirs4all-io owns the dataset-level concepts that the low-level reader library
nirs4all-formats deliberately
does not: X/Y/metadata roles, train/test/folds, multi-source, relational
joins, signal/task-type inference, and a declarative convention system. It
matches the expressiveness of nirs4all's DatasetConfig/DatasetLoader and
adds a score-based inference engine.
any input ──► RESOLVE ──► INFER ──► CONFIGURE ──► MATERIALIZE ──► SpectroDataset
(InputSet) (DatasetPlan, scored) (DatasetSpec) (and later: dag-ml-data)
Status
Phase 1 (Python MVP) — complete and parity-verified. load() and infer()
work end-to-end and target SpectroDataset; the build is byte-equivalent to
nirs4all's own DatasetConfigs on the supported topologies (pytest -m parity).
178 tests, ruff + mypy clean. See docs/STATUS.md for the
per-epic breakdown, docs/API.md for the seam, and
docs/PHASE2_GATE.md for why the Rust / dag-ml-data
target (Phase 2) stays gated. Full design:
../nirs4all-formats/docs/REDESIGN_FORMATS_AND_IO.md.
Quick start (target API)
# Inspect a directory and get a scored recommendation
=
# Materialize a spec/plan/input into a SpectroDataset
=
=
# Vendor corpus + reference table (headline new capability)
=
What can it load?
docs/DATASET_CONFIGURATIONS.md is the complete
reference: every input form, DatasetSpec field, column selector, merge mode,
relational join, partition, fold and loading parameter — with a use-case cookbook
and an honest ✅/🟡/📋 implementation status on each option.
Language bindings
One Rust core, thin wrappers per language (all over the same canonical-JSON
contract). See COMPAT.md for the full operation matrix.
- CLI —
nirs4all-io(infer/to-spec/validate/load/emit-dag-ml-data). - Python (pyo3/maturin) —
bindings/python; the only surface that builds a realSpectroDataset. - R (
.Callover the C ABI) —bindings/r. Install the prebuilt binary from R-universe: - MATLAB / Octave (MEX over the C ABI) —
bindings/matlab. - WASM / JS (wasm-bindgen, fs-free) —
bindings/wasm.
Design principles
- Self-contained: no runtime dependency on
nirs4all. The only touch-point is a lazy import of theSpectroDatasetclass at materialization. - Parsers live in
nirs4all-formats: vendor byte-decoding is never reimplemented here; tabular loading logic is copied fromnirs4all(seeCOPY_PROVENANCE.md). - Versioned, machine-validatable
DatasetSpecis the canonical contract.
License
nirs4all-io is dual-licensed open-source — CeCILL-2.1 OR AGPL-3.0-or-later (your choice) —
with an optional commercial license for closed-source / SaaS use. For any commercial use, contact
nirs4all-admin@cirad.fr. See LICENSING.md, the texts under LICENSES/,
and THIRD_PARTY_NOTICES.md.