download_files()
Python package: neptune-fetcher
Dowloads files associated with the specified experiments and File attributes.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
experiments | Union[str, Filter], optional | None | Specifies the experiments to fetch files from:
None, all experiments are considered. |
attributes | Union[str, AttributeFilter], optional | None | Within the selected experiments, specifies the attributes to fetch:
None, all attributes are considered. |
destination | str, optional | None | Path to where the files should be downloaded. Can be relative or absolute. If None, the files are downloaded to the current working directory (CWD). |
context | Context, optional | None | Which project and API token to use for the fetching operation. Useful for switching projects. |
Constructing the destination path
Files are downloaded to the following directory:
<destination>/<experiment_name>/<attribute_path>/<file_name>
Note that:
- The directory specified with the
destinationparameter requires write permissions. - If the experiment name or an attribute path includes slashes
/, each element that follows the slash is treated as a subdirectory. - The directory and subdirectories are automatically created if they don't already exist.
Example
To download a results.csv file logged under the dataset/image_sample attribute path of the seabird-flying-skills experiment, use:
import neptune_fetcher.alpha as npt
npt.download_files(
experiments="seabird-flying-skills",
attributes="dataset/image_sample",
destination="/data/samples/images",
)
The file will be downloaded to the following directory:
/data/samples/images/seabird-flying-skills/dataset/image_sample/results.csv
Download from runs
To fetch files from runs instead of experiments:
- Import the
download_files()function from therunsmodule - Replace the
experimentsparameter withruns - Pass run IDs instead of experiment names
from neptune_fetcher.alpha import runs
runs.download_files(
runs=r"marigold",
attributes="dataset/image_sample",
destination="/data/samples/images",
)