Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wb-21fd5541-python-sdk-testing.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Description

A lazy iterator over a collection of File objects. Access and manage files uploaded to W&B during a run. Handles pagination automatically when iterating through large collections of files.

Examples:

from wandb.apis.public.files import Files
from wandb.apis.public.api import Api

# Example run object
run = Api().run("entity/project/run-id")

# Create a Files object to iterate over files in the run
files = Files(api.client, run)

# Iterate over files
for file in files:
    print(file.name)
    print(file.url)
    print(file.size)

    # Download the file
    file.download(root="download_directory", replace=True)

Args:

  • client: The API client instance to use for querying W&B.
  • run: The run object that contains the files.
  • names: Optional list of file names to filter by. If None, fetches all files.
  • per_page: The number of files to fetch per page. Default is 50.
  • upload: If True, fetch the upload URL for each file. Default is False.
  • pattern: Pattern to match when returning files from W&B. This pattern uses mySQL’s LIKE syntax, so matching all files that end with .json would be “%.json”.

Methods:

next

Return the next item from the iterator. When exhausted, raise StopIteration