Skip to main content

A basic API wrapper for Unsplash.

Project description

https://raw.githubusercontent.com/Ombucha/unsplash.py/main/banner.png PyPI version PyPI downloads Lines of code Repository size

A modern, Pythonic client for the Unsplash API.

Features

  • Search for photos, users, and collections

  • Download and trigger downloads for Unsplash images

  • Get random photos or curated collections

  • Access user profiles and statistics

  • Manage and create collections

  • List and explore Unsplash topics

  • Fully typed and Pythonic interface

  • Handles Unsplash API rate limits and errors gracefully

Requirements

Installation

Install the latest stable release from PyPI:

# For Unix / macOS
python3 -m pip install "unsplash.py"

# For Windows
py -m pip install "unsplash.py"

To install the latest development version:

git clone https://github.com/Ombucha/unsplash.py
cd unsplash.py
pip install -e .

Quick Start

Here’s how to use unsplash.py:

import unsplash

# Initialize the client with your Unsplash API access key
client = unsplash.Client(access_key="YOUR_ACCESS_KEY")

# Search for photos
photos = client.search_photos("mountains")
for photo in photos:
    print(photo.urls["regular"])

# Get a random photo
random_photo = client.get_random_photo()
print(random_photo[0].urls["full"])

# Get user profile
user = client.get_user("unsplash")
print(user.name, user.bio)

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub. For major changes, please open an issue first to discuss what you would like to change.

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

unsplash_client-1.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unsplash_client-1.0.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file unsplash_client-1.0.0.tar.gz.

File metadata

  • Download URL: unsplash_client-1.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for unsplash_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 67e7737a0e296c9b2d38de625470edd4254e344f3072ef6d012a6f5880161c91
MD5 5c045dbdcb73c1d7814c3bf33eba12d6
BLAKE2b-256 3ceebc81f964143ada66e523929982b2e1d7b8ab4e7e24fb629fd28ee63609ba

See more details on using hashes here.

File details

Details for the file unsplash_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unsplash_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 440a2e662e968ac35bf00e306e532a7aca84d9a4f6ae64b45c0de4a2c64ec116
MD5 cf4ab4dc071f7777c5b5b60167feac10
BLAKE2b-256 a442d6b8b4436cf4ced9894fd9b627698ba92830fdc8ecb8283e9a57c86abf14

See more details on using hashes here.

Supported by

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