https://github.com/sauldom102/unsplashpy
An Unsplash client for Python without the need for an api key
https://github.com/sauldom102/unsplashpy
client python python3 unsplash unsplash-client unsplashdownloader
Last synced: about 2 months ago
JSON representation
An Unsplash client for Python without the need for an api key
- Host: GitHub
- URL: https://github.com/sauldom102/unsplashpy
- Owner: sauldom102
- License: mit
- Created: 2018-10-19T19:05:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-11T17:31:24.000Z (over 6 years ago)
- Last Synced: 2025-03-28T11:38:03.935Z (2 months ago)
- Topics: client, python, python3, unsplash, unsplash-client, unsplashdownloader
- Language: Python
- Homepage:
- Size: 1.24 MB
- Stars: 10
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unsplashpy
## Description
An Unsplash client without the need for an api key. For a full documentation visit .
## Getting started
You can try out how this module works by importing the Unsplash class, which will help you with some user regular actions as searching for a keyword and then download a certain number of image pages of that results.
```python
from unsplashpy import Unsplashu = Unsplash()
search_text = input('Tell me what are you searching for: ')
u.search(search_text)num_pages = input('Pages to download [10]: ')
num_pages = 5 if num_pages == '' else int(num_pages)image_size = input('Image size to download [regular]: ')
image_size = 'regular' if image_size == '' else image_sizeu.download_last_search(num_pages=num_pages, image_size=image_size)
```## 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.
``` py3
from unsplashpy import Userusername = 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.
``` py3
from unsplashpy import Userusername = input('Tell me a username: ')
u = User(username)
u.download_all_photos()
```### Download random photo
``` py3
from unsplashpy import Photop = Photo.random()
p.download()
```