Skip to content

Manifest

dataphy.io.manifest

Manifest system for dataset metadata and configuration.

This module provides a manifest system for storing and managing dataset metadata, including source information, provider details, and filtering options.

Classes

Manifest

Bases: BaseModel

Manifest for dataset metadata and configuration.

This model represents a manifest file that contains metadata about a dataset, including its source, provider, and optional filtering criteria.

Attributes
name: Optional[str] = None class-attribute instance-attribute
provider: str instance-attribute
source: Dict[str, Any] instance-attribute
filters: Optional[Dict[str, List[str]]] = None class-attribute instance-attribute
Functions
from_path(path: str) -> 'Manifest' classmethod

Load a manifest from a JSON file.

Parameters:

Name Type Description Default
path str

Path to the JSON manifest file

required

Returns:

Type Description
'Manifest'

Manifest instance loaded from the file

Raises:

Type Description
FileNotFoundError

If the manifest file doesn't exist

ValidationError

If the JSON content is invalid

Source code in src/dataphy/io/manifest.py
@classmethod
def from_path(cls, path: str) -> "Manifest":
    """Load a manifest from a JSON file.

    Args:
        path: Path to the JSON manifest file

    Returns:
        Manifest instance loaded from the file

    Raises:
        FileNotFoundError: If the manifest file doesn't exist
        ValidationError: If the JSON content is invalid
    """
    with open(path, "r") as f:
        return cls.model_validate(json.load(f))