Skip to content

Unofficial minimal python wrapper for waifu.pics API.

License

Notifications You must be signed in to change notification settings

teixeirazeus/waifupy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

banner
Codacy Badge

Unofficial minimal python wrapper for waifu.pics API.

Installation

pip install git+https://github.com/teixeirazeus/waifupy

Usage

Example 1

from waifupy import WaifuPyClient, WaifuCategory

# Create a WaifuPyClient object
client = WaifuPyClient()

# Get your waifu
waifu = client.get_sfw_image()

# Open the image in the web browser
waifu.display_in_webbrowser()

# Print all waifus categories
print(WaifuCategory.sfw)
print(WaifuCategory.nsfw)

# Get your waifu in a specific category
waifu = client.get_sfw_image("smile")

# Download the image to a file
waifu.download(image_name="my_waifu")

# Close the client
client.close()

Example 2

Asynchronous usage

import asyncio
from waifupy import AioWaifuPyClient

async def main():
    client = AioWaifuPyClient()
    waifu = await client.get_nsfw_image()
    waifu.download(image_name="my_waifu")
    await client.close()

asyncio.run(main())

About

Unofficial minimal python wrapper for waifu.pics API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages