wallfetch
A simple command-line tool for searching and downloading wallpapers from Wallhaven.cc.
wallfetch lets you search and download wallpapers directly from the terminal without having to open Wallhaven in a browser.
Demo
https://github.com/user-attachments/assets/512eb70d-b4b5-4091-8ef2-7de765692f51
Features
-
Search wallpapers directly from the terminal
-
Download multiple wallpapers at once
-
Progress bars for downloads
-
Sort wallpapers by relevance, views, favorites, etc.
-
Filter wallpapers by category and purity
-
Choose how many wallpapers you want to download
-
Save wallpapers to
~/Pictures/wallfetchby default -
Specify a custom download directory
-
Support for Wallhaven API keys
Installation
Install from PyPI:
pip install wallfetch
or from source:
Clone the repository:
git clone https://github.com/Aditya1770/wallfetch.git
cd wallfetch
Make a Python virtual environment:
python -m venv .venv
source .venv/bin/activate
Install wallfetch in the virtual environment:
python -m pip install .
python -m pip install -e . #for editable installation
You can now use:
wallfetch -h
Usage
Search for wallpapers:
wallfetch <query>
For example:
wallfetch cyberpunk
You can also use queries with spaces:
wallfetch "dark forest"
By default, wallpapers are downloaded to:
~/Pictures/wallfetch
Options
| Option | Description |
|---|---|
-n, --count N |
Number of wallpapers to download |
-f, --folder FOLDER |
Folder to download wallpapers to |
-s, --sorting SORT |
Sort the search results |
-o, --order {asc,desc} |
Sorting order |
-p, --purity PURITY |
SFW/Sketchy/NSFW filter |
-c, --categories CATS |
General/Anime/People filter |
--page PAGE |
Page of search results |
--set-api-key KEY |
Set your Wallhaven API key |
--config |
Check the current wallfetch configuration |
-h, --help |
Show the help menu |
Number of wallpapers
Use -n to specify how many wallpapers you want to download:
wallfetch cyberpunk -n 5
Custom download directory
Use -f to specify where the wallpapers should be saved:
wallfetch cyberpunk -f ~/Pictures/cyberpunk
Sorting
Wallpapers can be sorted using:
| Value | Sort by |
|---|---|
date_added |
Date added |
relevance |
Relevance |
random |
Random |
views |
Views |
favorites |
Favorites |
toplist |
Toplist |
hot |
Hot |
For example:
wallfetch cyberpunk -s favorites
You can also change the sorting order:
wallfetch cyberpunk -s views -o desc
Categories
Wallhaven uses three digits for its category filters:
General / Anime / People
1 enables a category and 0 disables it.
| Value | Categories |
|---|---|
100 |
General |
010 |
Anime |
001 |
People |
110 |
General + Anime |
101 |
General + People |
011 |
Anime + People |
111 |
All |
For example, to only search for anime wallpapers:
wallfetch cyberpunk -c 010
The default is 111.
Purity
Purity works the same way:
SFW / Sketchy / NSFW
| Value | Purity |
|---|---|
100 |
SFW |
010 |
Sketchy |
001 |
NSFW |
110 |
SFW + Sketchy |
101 |
SFW + NSFW |
011 |
Sketchy + NSFW |
111 |
All |
The default is 100.
For example:
wallfetch cyberpunk -p 110
Some filters may require a Wallhaven API key.
Pages
Use --page to get wallpapers from another page of the search results:
wallfetch cyberpunk --page 2
Additionally you can provide a range to to get wallpapers from certain range:
wallfetch cyberpunk --page 3:5 #will get wallpaper from page 3 to 5
API Key
You can get your Wallhaven API key through your Account Settings and going to Account:
You can save your Wallhaven API key using:
wallfetch --set-api-key <key>
The key is stored in:
~/.config/wallfetch/config.toml
To check if an API key is configured:
wallfetch --config
Examples
Download 5 cyberpunk wallpapers:
wallfetch cyberpunk -n 5
Download 10 anime wallpapers sorted by favorites:
wallfetch anime -n 10 -c 010 -s favorites
Download wallpapers to a different folder:
wallfetch mountains -n 5 -f ~/Pictures/mountains
You can combine the options however you want:
wallfetch "night city" -n 10 -s favorites -o desc -c 111 -p 100 --page 2
Dependencies
wallfetch requires Python 3 and uses:
-
Requests for API requests and downloads
-
Rich for download progress bars
-
tomli_w for editing .toml files
The dependencies are installed automatically when running:
python -m pip install .
Uninstall
Since wallfetch is installed inside the virtual environment, you can uninstall it with:
python -m pip uninstall wallfetch
Or just remove the virtual environment:
rm -rf .venv
Contributing
Contributions, bug reports and suggestions are welcome.
If you want to improve wallfetch, fork the repository, make your changes and open a pull request.
License
This project is licensed under the MIT License. See LICENSE for more information.
Metadata
Release files for wallfetch 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wallfetch-0.1.0.tar.gz | 10.2 kB | Without provenance | Details for wallfetch-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wallfetch-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for wallfetch-0.1.0-py3-none-any.whl |
Total release size: 18.2 kB
Release files / wallfetch-0.1.0.tar.gz
| Download URL | wallfetch-0.1.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
999d947ba0c85a1bf7ab40dedf3eebd8b7341bc1a30068470ea29c3b3e0430a6
|
|
BLAKE2b-256 checksum How to use checksums |
a0261b84b7af6c4f0b5cbc87490e74e63355a6b6ee8e50d738a4348972863c8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / wallfetch-0.1.0-py3-none-any.whl
| Download URL | wallfetch-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f478138a9b680514199fdb3da5475dc40221e5e702c1de0c4f2aa6fef92dabee
|
|
BLAKE2b-256 checksum How to use checksums |
fed28929d2339e301acbce467a121011683f1c9ccd53e4db24bd54643859d2de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for wallfetch 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.