Some examples
Download user's photos
The bellow code will allow you to download all the user's published photos. One difference from the "Quick start" example is that this will take much more time downloading all pictures because this part doesn't make use of multithreading. We'll see another example on how to make this in a much more efficient way.
Another thing to know is that, by default, all the images downloaded will have a regular resolution.
from unsplashpy import User username = input('Tell me a username: ') u = User(username) for p in u.photos: p.download(download_location=username)
Download user's photos (multithreading way)
As said before, this is a more efficient way to download photos. It takes much less time than the above example.
from unsplashpy import User username = input('Tell me a username: ') u = User(username) u.download_all_photos()
Download random photo
from unsplashpy import Photo p = Photo.random() p.download()
To get a more detailed description about classes and methods included in this module, check out the API section.