Skip to main content
App version: 3.20250811

download_files()

Downloads files from the specified Neptune experiments or runs.

Parameters

files
types.File | Iterable[types.File] | pandas.Series | pandas.DataFrame
required

Which files to download, specified using the file fetching methods:

  • For files logged as a series, use fetch_series() to specify the content containing the files and pass the output to the files argument.
  • For individually assigned files, use the output of fetch_experiments_table().

You can also pass a reference to a single File object or an Iterable of them.

destination
str
optional
default: 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).

note

The Neptune project isn't specified directly for the function call, because the project is encoded in the files argument.

For how to set the project manually, see the example.

Returns

DataFrame mapping experiments and attributes to the paths of downloaded files.

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 destination parameter 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

Specify files from a given step range of a series:

import neptune_query as nq


interesting_files = nq.fetch_series(
project="team-alpha/project-x",
experiments=["seagull-week1", "seagull-week2"],
attributes=r"^predictions/",
step_range=(2050.0, 2056.0),
)

nq.download_files(files=interesting_files)

Download from runs

To target individual runs by ID instead of experiment name, import the runs API:

import neptune_query.runs as nq_runs

Then call the corresponding querying method and replace the experiments parameter with runs:

interesting_files = nq_runs.fetch_series(
project="team-alpha/project-x",
runs=["prompt-wolf-20250605132116671-2g2r1"], # run ID
attributes=r"^predictions/",
step_range=(2050.0, 2056.0),
)

nq_runs.download_files(files=interesting_files)