Skip to main content

Python library to get pictures from source.unsplash.com

Project description

py_unsplash_source is a really really simple library to easily interface with the source.unsplash.com service. Typical usage often looks like this:

#!/usr/bin/env python

from py_unsplash_source import PyUnsplashSourceClient

su = PyUnsplashSourceClient(width=1920, height=1080)

# Random √
image = (su.random_image()
         .daily()       # Or .weekly()
         .search('nature,landscape')).get()

image.save_as('/tmp/random.jpg')

# Random from a specific user √
image = (su.image_from_user('gangdise')
         .from_likes()).get()

image.save_as('/tmp/user.jpg')

# Random from a collection √
image = su.image_from_collection(145698).get()

image.save_as('/tmp/collection.jpg')

# Random from featured collection √
image = (su.image_from_featured()
         .search('nature,landscape', 'sunset')).get()

image.save_as('/tmp/featured.jpg')

# Speficic image √
image = su.image("ieic5Tq8YMk").get()

image.save_as('/tmp/item.jpg')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_unsplash_source-0.9.0.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

py_unsplash_source-0.9.0-py3-none-any.whl (34.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page