h3.utils package#
Submodules#
h3.utils.directories module#
- h3.utils.directories.get_metadata_pickle_dir() str [source]#
./data/datasets/processed_data/metadata_pickle
- h3.utils.directories.get_xbd_disaster_dir(disaster: str) str [source]#
/data/datasets/xBD_data/{disaster}
h3.utils.downloader module#
- h3.utils.downloader.downloader(urls: Iterable[str], target_dir: str = '/github/workspace/data/downloads')[source]#
Downloader to download multiple files.
- h3.utils.downloader.url_download(url: str, path: str, task: int = 1, total: int = 1) None [source]#
Download an url to a local file
See also
downloader
Downloads multiple url in parallel.
h3.utils.file_ops module#
- h3.utils.file_ops.get_sha1(filepath: str) str [source]#
As the files are big using this method that uses buffers https://stackoverflow.com/a/22058673/9931399
- h3.utils.file_ops.unpack_file(filepath: str, clean: bool = False, file_format: None | str = None)[source]#
Unpack an archive file. It is quite slow for big files
- Parameters:
filepath (str,) – Path of the file to unpack, it will unpack in the folder
clean (bool, optional) – If True will delete the archive after unpacking. The default is False.
file_format (str, optional) – The archive format. If None it will use the file extension. See shutil.unpack_archive()