src.datamodules.components package§

Submodules§

src.datamodules.components.utils module§

src.datamodules.components.utils.download_path(path=None)§

Return a path to download data. If path=None, then it yields a temporal path that is eventually deleted, otherwise the real path of the input.

Parameters:

path (str) – Path to download data.

Returns:

Real path where the data is stored.

Return type:

str

Examples

>>> with download_path() as path:
>>> ... maybe_download(url="http://example.com/file.zip", work_directory=path)
src.datamodules.components.utils.maybe_download(url, filename=None, work_directory='.', expected_bytes=None)§

Download a file if it is not already downloaded.

Parameters:
  • filename (str) – File name.

  • work_directory (str) – Working directory.

  • url (str) – URL of the file to download.

  • expected_bytes (int) – Expected file size in bytes.

Returns:

File path of the file downloaded.

Return type:

str

src.datamodules.components.utils.unzip_file(zip_src, dst_dir, clean_zip_file=False)§

Unzip a file

Parameters:
  • zip_src (str) – Zip file.

  • dst_dir (str) – Destination folder.

  • clean_zip_file (bool) – Whether or not to clean the zip file.

Module contents§