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
singleflag 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 thesingleflag, either adictor alistis 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 therecursiveflag toFalsedisables table import, which will result in only the record available at thesrcpath being loaded.With the
jsonldflag, a declared or default JSON-LD context is loaded and inserted into the record.