wags_tails.mondo#

Provide source fetching for Mondo Disease Ontology.

class wags_tails.mondo.MondoData(data_dir=None, silent=True)[source]#

Provide access to Mondo disease ontology data.

get_latest(from_local=False, force_refresh=False)[source]#

Get path to latest version of data. Overwrite inherited method because final downloads depend on information gleaned from the version API call.

Parameters:
  • from_local (bool) – if True, use latest available local file

  • force_refresh (bool) – if True, fetch and return data from remote regardless of whether a local copy is present

Return type:

Tuple[Path, str]

Returns:

Path to location of data, and version value of it

Raises:

ValueError – if both force_refresh and from_local are True

get_specific(version, from_local=False, force_refresh=False)[source]#

Get specified version of data.

Parameters:
  • from_local (bool) – if True, use latest available local file

  • force_refresh (bool) – if True, fetch and return data from remote regardless of whether a local copy is present

Return type:

Path

Returns:

Path to location of data

Raises:
  • ValueError – if both force_refresh and from_local are True

  • FileNotFoundError – if from_local is True and local file doesn’t exist

__init__(data_dir=None, silent=True)[source]#

Set common class parameters.

Parameters:
  • data_dir (Optional[Path]) – direct location to store data files in, if specified. See get_data_dir() in the storage_utils module for further configuration details.

  • silent (bool) – if True, don’t print any info/updates to console

iterate_versions()[source]#

Lazily get versions (i.e. not the files themselves, just their version strings), starting with the most recent value and moving backwards.

Return type:

Generator

Returns:

Generator yielding version strings