A Python wrapper for the Wallhaven.cc API v1.
Project description
Wallhaven API v1 Python Wrapper
Overview
This module provides a Python wrapper for the Wallhaven.cc API (v1), enabling users to programmatically search for wallpapers, fetch wallpaper metadata, download images, and interact with user collections.
It is suitable for building custom tools or integrations around the Wallhaven API.
[!Note] This project is unofficial and not affiliated with Wallhaven.cc. Use at your own discretion and in accordance with the site's terms of service.
📦 Installation
This module can be installed from PyPI (recommended), or manually by cloning the repo and moving it to your project's root directory.
If installing manually, be sure to clone the latest release and not the main branch. The latest release is identical to that on PyPI.
Additionally, the requests library will also need to be installed from PyPI or your preferred method.
- PyPI Install
pip install wallhavenapi
- Manual Install
git clone --depth=1 https://github.com/raycadle/WallhavenAPI.git && cd WallhavenAPI
pip install -r requirements.txt
🚀 Quick Start
from wallhavenapi import WallhavenAPI, Category, Purity
api = WallhavenAPI(api_key="your_api_key")
results = api.search(q="nature", categories=[Category.general], purities=[Purity.sfw])
# Download a specific wallpaper
wallpaper_id = results["data"][0]["id"]
api.download_wallpaper(wallpaper_id, "wallpaper.jpg")
🐛 Issue Reporting
Report bugs here.
Notes
- All API interaction is wrapped in safe error handling with custom exceptions.
- The wrapper is designed to respect Wallhaven API rate limits if configured via
requestslimit_timeout.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wallhavenapi-0.1.0.tar.gz.
File metadata
- Download URL: wallhavenapi-0.1.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f83fe5948c102eeea59e7682a77affa880f5afdbf94d2dabda48daf4c977c09
|
|
| MD5 |
103101d23675ddea103ba565e4362014
|
|
| BLAKE2b-256 |
91dc21851641444883313a85fb4bf09464dce8b65e941cd2564a7e31a27bc282
|
File details
Details for the file wallhavenapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wallhavenapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea12e8637a8f9110e0e2452ae4b0c7e2015ab5cd66e3ec525d23fd51df391159
|
|
| MD5 |
d78072e6d213c35b8ac3b440618c6049
|
|
| BLAKE2b-256 |
7144eee556dadec48b0ec8b6997fd7139caf4ebf38150b3c9ece37dd7107859f
|