Local-first datasets: inventory and addressable artifact bags.
See Managing datasets and Dataset Schema Reference.
Local-first datasets: inventory and addressable artifact bags.
Import from biolm.datasets (not top-level biolm).
- exception biolm.datasets.BackendNotAvailableError
Bases:
DatasetErrorRequested push/pull backend is not installed or not registered.
- class biolm.datasets.Dataset(path: str | Path, meta: DatasetMeta | None = None)
Bases:
objectA local dataset directory containing dataset.yaml.
- add(source: str | Path, *, recursive: bool = False, dest_name: str | None = None) → Path
Copy a file or directory into the dataset content directory.
Returns the destination path.
- property attrs: Dict[str, Any]
- property created_at: str | None
- property data_dir: Path
Preferred content directory: data/ if present, else dataset root.
- property description: str | None
- files() → List[Path]
Relative paths of files under the dataset (excluding dataset.yaml).
- property id: str
- property meta: DatasetMeta
- open_seqframe()
Open this dataset as a
SeqFrame.Requires
biolm-sdk[seqframe]. Resolvesattrs.seqframe_pathor exactly one*.parquetunder the dataset. Seebiolm.seqframe.dataset_bridge.
- property path: Path
- push(backend: str = 'mlflow', **opts: Any) → Dict[str, Any]
Push this dataset via a registered backend.
- refresh() → Dataset
Re-read dataset.yaml from disk.
- to_dict() → Dict[str, Any]
- property type: str
- class biolm.datasets.DatasetClient(roots: Sequence[str | Path] | None = None, *, primary_root: str | Path | None = None, cwd: str | Path | None = None)
Bases:
objectClient for local dataset inventory and push/pull.
- create(dataset_id: str, *, type: str = 'files', tags: List[str] | None = None, attrs: Dict[str, Any] | None = None, description: str | None = None, root: str | Path | None = None, force: bool = False) → Dataset
Create
and an empty/ /dataset.yaml data/directory.
- get(id_or_path: str | Path) → Dataset
Resolve a dataset by filesystem path or by id under discovery roots.
- init(path: str | Path, *, id: str | None = None, type: str = 'files', tags: List[str] | None = None, attrs: Dict[str, Any] | None = None, description: str | None = None, force: bool = False) → Dataset
Write dataset.yaml into an existing directory without moving files.
- list(*, type: str | None = None, tag: str | None = None) → List[Dataset]
List datasets discovered under configured roots.
- property primary_root: Path
- pull(dataset_id: str, *, backend: str = 'mlflow', path: str | Path | None = None, force: bool = False, **opts: Any) → Dataset
Pull a remote dataset into a local directory and return Dataset.
- property roots: List[Path]
- exception biolm.datasets.DatasetError
Bases:
ExceptionBase error for local dataset operations.
- exception biolm.datasets.DatasetExistsError
Bases:
DatasetErrordataset.yaml already exists and force was not set.
- class biolm.datasets.DatasetMeta(id: str, schema_version: int = 1, description: str | None = None, created_at: str | None = None, type: str = 'files', tags: ~typing.List[str] = <factory>, attrs: ~typing.Dict[str, ~typing.Any] = <factory>)
Bases:
objectValidated metadata from dataset.yaml.
- attrs: Dict[str, Any]
- created_at: str | None = None
- description: str | None = None
- id: str
- schema_version: int = 1
- to_dict() → Dict[str, Any]
- type: str = 'files'
- exception biolm.datasets.DatasetNotFoundError
Bases:
DatasetErrorDataset id or path could not be resolved.
- class biolm.datasets.DatasetPushPullBackend(*args, **kwargs)
Bases:
ProtocolAdapter that can push/pull a local dataset to a remote store.
- name: str
- pull(dataset_id: str, dest: Path, **opts: Any) → Dict[str, Any]
Download remote dataset into dest; return status info.
- push(dataset: Dataset, **opts: Any) → Dict[str, Any]
Upload local dataset artifacts and metadata.
- exception biolm.datasets.DatasetSchemaError
Bases:
DatasetErrordataset.yaml is missing required fields or is invalid.
- exception biolm.datasets.DuplicateDatasetIdError
Bases:
DatasetErrorThe same dataset id was found under multiple discovery roots.
- biolm.datasets.get_backend(name: str) → DatasetPushPullBackend
Return a registered backend, lazy-loading known plugins when needed.
- biolm.datasets.register_backend(name: str, backend: DatasetPushPullBackend) → None
Register a push/pull backend under name.
biolm.datasets.client module
DatasetClient: create, discover, and resolve local datasets.
- class biolm.datasets.client.DatasetClient(roots: Sequence[str | Path] | None = None, *, primary_root: str | Path | None = None, cwd: str | Path | None = None)
Bases:
objectClient for local dataset inventory and push/pull.
- create(dataset_id: str, *, type: str = 'files', tags: List[str] | None = None, attrs: Dict[str, Any] | None = None, description: str | None = None, root: str | Path | None = None, force: bool = False) → Dataset
Create
and an empty/ /dataset.yaml data/directory.
- get(id_or_path: str | Path) → Dataset
Resolve a dataset by filesystem path or by id under discovery roots.
- init(path: str | Path, *, id: str | None = None, type: str = 'files', tags: List[str] | None = None, attrs: Dict[str, Any] | None = None, description: str | None = None, force: bool = False) → Dataset
Write dataset.yaml into an existing directory without moving files.
- list(*, type: str | None = None, tag: str | None = None) → List[Dataset]
List datasets discovered under configured roots.
- property primary_root: Path
- pull(dataset_id: str, *, backend: str = 'mlflow', path: str | Path | None = None, force: bool = False, **opts: Any) → Dataset
Pull a remote dataset into a local directory and return Dataset.
- property roots: List[Path]
biolm.datasets.dataset module
Dataset resource: one local self-describing dataset directory.
- class biolm.datasets.dataset.Dataset(path: str | Path, meta: DatasetMeta | None = None)
Bases:
objectA local dataset directory containing dataset.yaml.
- add(source: str | Path, *, recursive: bool = False, dest_name: str | None = None) → Path
Copy a file or directory into the dataset content directory.
Returns the destination path.
- property attrs: Dict[str, Any]
- property created_at: str | None
- property data_dir: Path
Preferred content directory: data/ if present, else dataset root.
- property description: str | None
- files() → List[Path]
Relative paths of files under the dataset (excluding dataset.yaml).
- property id: str
- property meta: DatasetMeta
- open_seqframe()
Open this dataset as a
SeqFrame.Requires
biolm-sdk[seqframe]. Resolvesattrs.seqframe_pathor exactly one*.parquetunder the dataset. Seebiolm.seqframe.dataset_bridge.
- property path: Path
- push(backend: str = 'mlflow', **opts: Any) → Dict[str, Any]
Push this dataset via a registered backend.
- refresh() → Dataset
Re-read dataset.yaml from disk.
- to_dict() → Dict[str, Any]
- property type: str