%global _empty_manifest_terminate_build 0 Name: python-waifu-py Version: 1.0.3 Release: 1 Summary: A simple Python wrapper for the waifu.pics API License: MIT URL: https://github.com/IchBinLeoon/waifu-py Source0: https://mirrors.aliyun.com/pypi/web/packages/9c/57/fe104e9f11ca8ffae879d575a42fa889bdb786d397780a66cb3a6328a647/waifu-py-1.0.3.tar.gz BuildArch: noarch Requires: python3-requests Requires: python3-aiohttp %description # waifu-py [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![PyPI](https://img.shields.io/pypi/v/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![License](https://img.shields.io/github/license/IchBinLeoon/waifu-py?style=flat-square)](https://github.com/IchBinLeoon/waifu-py/blob/main/LICENSE) A simple Python wrapper for the waifu.pics API. ## Table of Contents - [Installation](#Installation) - [Usage](#Usage) - [Contribute](#Contribute) - [License](#License) ## Installation **Python 3.6 or higher is required.** Install from PyPI ```shell $ pip install waifu-py ``` Install from source ```shell $ pip install git+https://github.com/IchBinLeoon/waifu-py ``` ## Usage You can use either WaifuClient or WaifuAioClient, depending on whether you want a synchronous wrapper class, or an asynchronous wrapper class. Below are some examples of how to use WaifuClient and WaifuAioClient. ### Usage Examples with WaifuClient ```python from waifu import WaifuClient client = WaifuClient() # Get one SFW image sfw_waifu: str = client.sfw(category='waifu') # Get 30 unique SFW images sfw_megumin_list: list = client.sfw(category='megumin', many=True) # Get 30 unique SFW images and exclude images in list sfw_megumin_list_exclude: list = client.sfw(category='megumin', many=True, exclude=['https://i.waifu.pics/IqD8csE.png', 'https://i.waifu.pics/NV-dfTH.png']) # Get one NSFW image nsfw_neko: str = client.nsfw(category='neko') # Get 30 unique NSFW images nsfw_trap_list: list = client.nsfw(category='trap', many=True) ``` ### Async Usage Examples with WaifuAioClient ```python import asyncio from waifu import WaifuAioClient async def main(): async with WaifuAioClient() as client: # Get one SFW image sfw_neko: str = await client.sfw(category='neko') # Get 30 unique SFW images sfw_shinobu_list: list = await client.sfw(category='shinobu', many=True) # Get one NSFW image nsfw_waifu: str = await client.nsfw(category='waifu') # Get 30 unique NSFW images nsfw_neko_list: list = await client.nsfw(category='neko', many=True) asyncio.run(main()) ``` ```python import asyncio from waifu import WaifuAioClient async def main(): client = WaifuAioClient() # Get one SFW image sfw_waifu: str = await client.sfw(category='waifu') # Get 30 unique NSFW images nsfw_waifu_list: list = await client.nsfw(category='waifu', many=True) await client.close() asyncio.run(main()) ``` ### Usage Examples with own Session If you want to use your own requests or aiohttp session, you can do that too. #### WaifuClient ```python import requests from waifu import WaifuClient session = requests.Session() client = WaifuClient(session=session) # ... ``` #### WaifuAioClient ```python import asyncio import aiohttp from waifu import WaifuAioClient async def main(): session = aiohttp.ClientSession() async with WaifuAioClient(session=session) as client: # ... asyncio.run(main()) ``` ```python import asyncio import aiohttp from waifu import WaifuAioClient async def main(): session = aiohttp.ClientSession() client = WaifuAioClient(session=session) # ... await client.close() asyncio.run(main()) ``` ### Image Categories You can also view all valid image categories. ```python from waifu import ImageCategories print(ImageCategories) ``` Output: ```shell { "sfw":[ "waifu", "neko", "shinobu", "megumin", "bully", "cuddle", "cry", "hug", "awoo", "kiss", "lick", "pat", "smug", "bonk", "yeet", "blush", "smile", "wave", "highfive", "handhold", "nom", "bite", "glomp", "slap". "kill", "kick", "happy", "wink", "poke", "dance", "cringe" ], "nsfw":[ "waifu", "neko", "trap", "blowjob" ] } ``` ## Contribute Contributions are welcome! Feel free to open issues or submit pull requests! ## License MIT © [IchBinLeoon](https://github.com/IchBinLeoon/waifu-py/blob/main/LICENSE) %package -n python3-waifu-py Summary: A simple Python wrapper for the waifu.pics API Provides: python-waifu-py BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-waifu-py # waifu-py [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![PyPI](https://img.shields.io/pypi/v/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![License](https://img.shields.io/github/license/IchBinLeoon/waifu-py?style=flat-square)](https://github.com/IchBinLeoon/waifu-py/blob/main/LICENSE) A simple Python wrapper for the waifu.pics API. ## Table of Contents - [Installation](#Installation) - [Usage](#Usage) - [Contribute](#Contribute) - [License](#License) ## Installation **Python 3.6 or higher is required.** Install from PyPI ```shell $ pip install waifu-py ``` Install from source ```shell $ pip install git+https://github.com/IchBinLeoon/waifu-py ``` ## Usage You can use either WaifuClient or WaifuAioClient, depending on whether you want a synchronous wrapper class, or an asynchronous wrapper class. Below are some examples of how to use WaifuClient and WaifuAioClient. ### Usage Examples with WaifuClient ```python from waifu import WaifuClient client = WaifuClient() # Get one SFW image sfw_waifu: str = client.sfw(category='waifu') # Get 30 unique SFW images sfw_megumin_list: list = client.sfw(category='megumin', many=True) # Get 30 unique SFW images and exclude images in list sfw_megumin_list_exclude: list = client.sfw(category='megumin', many=True, exclude=['https://i.waifu.pics/IqD8csE.png', 'https://i.waifu.pics/NV-dfTH.png']) # Get one NSFW image nsfw_neko: str = client.nsfw(category='neko') # Get 30 unique NSFW images nsfw_trap_list: list = client.nsfw(category='trap', many=True) ``` ### Async Usage Examples with WaifuAioClient ```python import asyncio from waifu import WaifuAioClient async def main(): async with WaifuAioClient() as client: # Get one SFW image sfw_neko: str = await client.sfw(category='neko') # Get 30 unique SFW images sfw_shinobu_list: list = await client.sfw(category='shinobu', many=True) # Get one NSFW image nsfw_waifu: str = await client.nsfw(category='waifu') # Get 30 unique NSFW images nsfw_neko_list: list = await client.nsfw(category='neko', many=True) asyncio.run(main()) ``` ```python import asyncio from waifu import WaifuAioClient async def main(): client = WaifuAioClient() # Get one SFW image sfw_waifu: str = await client.sfw(category='waifu') # Get 30 unique NSFW images nsfw_waifu_list: list = await client.nsfw(category='waifu', many=True) await client.close() asyncio.run(main()) ``` ### Usage Examples with own Session If you want to use your own requests or aiohttp session, you can do that too. #### WaifuClient ```python import requests from waifu import WaifuClient session = requests.Session() client = WaifuClient(session=session) # ... ``` #### WaifuAioClient ```python import asyncio import aiohttp from waifu import WaifuAioClient async def main(): session = aiohttp.ClientSession() async with WaifuAioClient(session=session) as client: # ... asyncio.run(main()) ``` ```python import asyncio import aiohttp from waifu import WaifuAioClient async def main(): session = aiohttp.ClientSession() client = WaifuAioClient(session=session) # ... await client.close() asyncio.run(main()) ``` ### Image Categories You can also view all valid image categories. ```python from waifu import ImageCategories print(ImageCategories) ``` Output: ```shell { "sfw":[ "waifu", "neko", "shinobu", "megumin", "bully", "cuddle", "cry", "hug", "awoo", "kiss", "lick", "pat", "smug", "bonk", "yeet", "blush", "smile", "wave", "highfive", "handhold", "nom", "bite", "glomp", "slap". "kill", "kick", "happy", "wink", "poke", "dance", "cringe" ], "nsfw":[ "waifu", "neko", "trap", "blowjob" ] } ``` ## Contribute Contributions are welcome! Feel free to open issues or submit pull requests! ## License MIT © [IchBinLeoon](https://github.com/IchBinLeoon/waifu-py/blob/main/LICENSE) %package help Summary: Development documents and examples for waifu-py Provides: python3-waifu-py-doc %description help # waifu-py [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![PyPI](https://img.shields.io/pypi/v/waifu-py?style=flat-square)](https://pypi.org/project/waifu-py/) [![License](https://img.shields.io/github/license/IchBinLeoon/waifu-py?style=flat-square)](https://github.com/IchBinLeoon/waifu-py/blob/main/LICENSE) A simple Python wrapper for the waifu.pics API. ## Table of Contents - [Installation](#Installation) - [Usage](#Usage) - [Contribute](#Contribute) - [License](#License) ## Installation **Python 3.6 or higher is required.** Install from PyPI ```shell $ pip install waifu-py ``` Install from source ```shell $ pip install git+https://github.com/IchBinLeoon/waifu-py ``` ## Usage You can use either WaifuClient or WaifuAioClient, depending on whether you want a synchronous wrapper class, or an asynchronous wrapper class. Below are some examples of how to use WaifuClient and WaifuAioClient. ### Usage Examples with WaifuClient ```python from waifu import WaifuClient client = WaifuClient() # Get one SFW image sfw_waifu: str = client.sfw(category='waifu') # Get 30 unique SFW images sfw_megumin_list: list = client.sfw(category='megumin', many=True) # Get 30 unique SFW images and exclude images in list sfw_megumin_list_exclude: list = client.sfw(category='megumin', many=True, exclude=['https://i.waifu.pics/IqD8csE.png', 'https://i.waifu.pics/NV-dfTH.png']) # Get one NSFW image nsfw_neko: str = client.nsfw(category='neko') # Get 30 unique NSFW images nsfw_trap_list: list = client.nsfw(category='trap', many=True) ``` ### Async Usage Examples with WaifuAioClient ```python import asyncio from waifu import WaifuAioClient async def main(): async with WaifuAioClient() as client: # Get one SFW image sfw_neko: str = await client.sfw(category='neko') # Get 30 unique SFW images sfw_shinobu_list: list = await client.sfw(category='shinobu', many=True) # Get one NSFW image nsfw_waifu: str = await client.nsfw(category='waifu') # Get 30 unique NSFW images nsfw_neko_list: list = await client.nsfw(category='neko', many=True) asyncio.run(main()) ``` ```python import asyncio from waifu import WaifuAioClient async def main(): client = WaifuAioClient() # Get one SFW image sfw_waifu: str = await client.sfw(category='waifu') # Get 30 unique NSFW images nsfw_waifu_list: list = await client.nsfw(category='waifu', many=True) await client.close() asyncio.run(main()) ``` ### Usage Examples with own Session If you want to use your own requests or aiohttp session, you can do that too. #### WaifuClient ```python import requests from waifu import WaifuClient session = requests.Session() client = WaifuClient(session=session) # ... ``` #### WaifuAioClient ```python import asyncio import aiohttp from waifu import WaifuAioClient async def main(): session = aiohttp.ClientSession() async with WaifuAioClient(session=session) as client: # ... asyncio.run(main()) ``` ```python import asyncio import aiohttp from waifu import WaifuAioClient async def main(): session = aiohttp.ClientSession() client = WaifuAioClient(session=session) # ... await client.close() asyncio.run(main()) ``` ### Image Categories You can also view all valid image categories. ```python from waifu import ImageCategories print(ImageCategories) ``` Output: ```shell { "sfw":[ "waifu", "neko", "shinobu", "megumin", "bully", "cuddle", "cry", "hug", "awoo", "kiss", "lick", "pat", "smug", "bonk", "yeet", "blush", "smile", "wave", "highfive", "handhold", "nom", "bite", "glomp", "slap". "kill", "kick", "happy", "wink", "poke", "dance", "cringe" ], "nsfw":[ "waifu", "neko", "trap", "blowjob" ] } ``` ## Contribute Contributions are welcome! Feel free to open issues or submit pull requests! ## License MIT © [IchBinLeoon](https://github.com/IchBinLeoon/waifu-py/blob/main/LICENSE) %prep %autosetup -n waifu-py-1.0.3 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-waifu-py -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue Jun 20 2023 Python_Bot - 1.0.3-1 - Package Spec generated