datalad_tabby.io
Input/output and conversion routines for tabby-format metadata records
- datalad_tabby.io.load_tabby(src: Path, *, single: bool = True, jsonld: bool = True, recursive: bool = True, cpaths: List | None = None) Dict | List [source]
Load a tabby (TSV) record as structured (JSON(-LD)) data
The record is identified by the table/sheet file path
src
. This need not be the root 'dataset' sheet, but can be any component of the full record.The
single
flag determines whether the record is interpreted as a single entity (i.e., JSON object), or many entities (i.e., JSON array of (homogeneous) objects). Depending on thesingle
flag, either adict
or alist
is returned.Other tabby tables/sheets are loaded when
@tabby-single|many-
import statements are discovered. The corresponding data structures then replace the import statement at its location. Setting therecursive
flag toFalse
disables table import, which will result in only the record available at thesrc
path being loaded.With the
jsonld
flag, a declared or default JSON-LD context is loaded and inserted into the record.