Skip to main content

Python Waifu Pics API Client

WaifuPics is a Python client for the Waifu Pics API, providing a simple and convenient way to retrieve SFW and NSFW images of various categories.

Installation

You can install WaifuPics using pip:

pip install picswaifu

Usage

from picswaifu import Waifu, ApiTypes, SFWCats, NSFWCats

# Create an instance of WaifuPics

waifu_client = Waifu()

# Get a single SFW image URL
sfw_url = await waifu_client.get()
print(f"SFW Image URL: {sfw_url}")

# Get multiple SFW images URLs as a list
sfw_urls = await waifu_client.get_sfw(category=SFWCats.NEKO, multi=True)
for url in sfw_urls:
    print(f"SFW Image URL: {url}")

Errors

  • InvalidResponse: Raised when the API returns an invalid response.
  • InvalidInput: Raised when the client is not configured properly.

# Notes This package uses the Waifu Pics API. Make sure to review and comply with the API's terms of service.

Contributing

Feel free to contribute by opening issues or submitting pull requests on the GitHub repository.

# License This project is licensed under the GPLv3 License - see the LICENSE file for details.

Release files for picswaifu 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for picswaifu 1.1.0
File Size Uploaded
picswaifu-1.1.0.tar.gz 3.3 kB Details

Release files / picswaifu-1.1.0.tar.gz

Download URL picswaifu-1.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e4ff830e14e0718be32d896e16e7683726ad3951f171f9310e5879f84e5a245d
BLAKE2b-256 checksum
How to use checksums
6ed0191970b0619db6ad3383405c3b13bcc5d2957c57362a4b13f42f40053f31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page