Iterate through paginated results with Walker
masterThe Walker utility class automatically handles pagination when iterating through large result sets returned by methods that return a FlickrList. You can pass the method itself and its arguments to the Walker constructor. It supports slicing to limit the number of results processed.
from flickr_api import Walker
# Create a walker for any method that returns paginated results
walker = Walker(flickr_api.Photo.search, tags="nature")
# Iterate through ALL results (handles pagination automatically)
for photo in walker:
print(photo.title)
# Get total count
print(f"Total results: {len(walker)}")
# Use slicing to limit results
for photo in walker[:100]: # First 100 only
print(photo.title)