Archiver

class emmet.archival.base.Archiver(**data)

Bases: BaseModel

Define base archival methods.

to_arrow()

Convert data to an arrow table.

Return type:

Table

classmethod from_arrow(table)

Extract data from an arrow table

Return type:

Any

Parameters:

table (Table)

to_archive(file_name='archive.h5', metadata=None, compression=None, zarr_store=None)

Create a new data archive from the parsed objects.

With no arguments passed, this function parses the files in file_paths and archives them to a file called archive.h5.

Return type:

None

Parameters:
  • file_name (Annotated[str | Path | DirEntry[str] | PathLike[str], PlainSerializer(func=~emmet.core.types.typing.<lambda>, return_type=str, when_used=always)])

  • metadata (dict[str, Any] | None)

  • compression (dict | None)

  • zarr_store (MutableMapping | None)

Parameters

file_name (str or Path) : defaults to “archive.h5” metadata (dict[str,Any]) : JSON-like metadata, optional compression (dict[str,Any] or None) : If specified, compression

kwargs to pass to the file writer.

zarr_storeMutableMapping or None (default)

If specified, the ZARR store to begin file root at. Could be an FSStore, default is same as ZARR’s default: MemoryStore.

classmethod extract(archive_path, zarr_store=None, *args, **kwargs)

Extract data from an archive.

Return type:

Any

Parameters:
  • archive_path (str | Path)

  • zarr_store (MutableMapping | None)

Parameters

file_name (str or Path) : defaults to “archive.h5” zarr_store : MutableMapping or None (default)

If specified, the ZARR store to begin file root at. Could be an FSStore, default is same as ZARR’s default: MemoryStore.

*args : args to pass to _extract_from_{hdf5_like, parquet} **kwargs : kwargs to pass to _extract_from_{hdf5_like, parquet}

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].