Files
less than a minute
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.
Example:
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)
Attributes | |
---|---|
cursor |
Returns the cursor position for pagination of file results. |
more |
Returns whether there are more files to fetch. |
Methods
convert_objects
convert_objects()
Converts GraphQL edges to File objects.
next
next() -> T
Return the next item from the iterator. When exhausted, raise StopIteration
update_variables
update_variables()
Updates the GraphQL query variables for pagination.
__getitem__
__getitem__(
index: (int | slice)
) -> (T | list[T])
__iter__
__iter__() -> Iterator[T]
__len__
__len__() -> int
Class Variables | |
---|---|
QUERY |
None |
Feedback
Was this page helpful?
Glad to hear it! If you have more to say, please let us know.
Sorry to hear that. Please tell us how we can improve.