metacat_utils

Utility functions for interacting with the MetaCat web API.

class merge_utils.metacat_utils.MetaCatWrapper[source]

Class for sending asynchronous requests to the MetaCat web API.

Initialize the MetaCatWrapper.

async connect() None[source]

Connect to the MetaCat web API

async disconnect() None[source]

No need to explicitly disconnect from MetaCat?

async files(files: list, metadata: bool = True, provenance: bool = True) list[source]

Asynchronously request a list of DIDs from MetaCat

Parameters:
  • files – list of file dicts, with either ‘fid’, ‘did’, or ‘namespace’ & ‘name’ keys

  • metadata – whether to include metadata in the results

  • provenance – whether to include provenance in the results

Returns:

list of file metadata dictionaries

async query(query: str, metadata: bool = True, provenance: bool = True) list[source]

Asynchronously query MetaCat.

Parameters:
  • query – MQL query to execute

  • metadata – whether to include metadata in the results

  • provenance – whether to include provenance in the results

Returns:

list of file metadata dictionaries