bioniumx.utils.fetch_data

bioniumx.utils.fetch_data(filename: str, url: str | None = None, known_hash: str | None = None) str[source]

Fetch a data file, downloading and caching it locally if it doesn’t exist.

Parameters:
  • filename (str) – The name of the file to fetch.

  • url (str, optional) – If provided, download from this URL instead of the base_url.

  • known_hash (str, optional) – The SHA256 hash of the file. If None, it will download without checking the hash (useful during development, but should be set for production data).

Returns:

The absolute path to the local cached file.

Return type:

str