diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-29 12:18:29 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-29 12:18:29 +0000 |
| commit | 2296efc9b85ea57ee08574db4b912f3753471342 (patch) | |
| tree | db6d4f39b4355ae521868f27b40550d4ce35956a | |
| parent | 49780eaa51efe9018c783143c3baeea9137b66cf (diff) | |
automatic import of python-waifuim-py
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-waifuim-py.spec | 450 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 452 insertions, 0 deletions
@@ -0,0 +1 @@ +/waifuim.py-4.2.3.tar.gz diff --git a/python-waifuim-py.spec b/python-waifuim-py.spec new file mode 100644 index 0000000..b9b752f --- /dev/null +++ b/python-waifuim-py.spec @@ -0,0 +1,450 @@ +%global _empty_manifest_terminate_build 0 +Name: python-waifuim.py +Version: 4.2.3 +Release: 1 +Summary: A Python wrapper for waifu.im API. +License: MIT +URL: https://github.com/Waifu-im/waifuim.py +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b6/b3/e0f03ed1f27ccd2cb66ba83fb0214ecbcaa7161da412c246e3bee2d33872/waifuim.py-4.2.3.tar.gz +BuildArch: noarch + + +%description +# waifuim.py
+[](https://pypi.org/project/waifuim.py/)
+[](https://pypi.org/project/waifuim.py/)
+[](https://github.com/Waifu-im/waifuim.py/blob/main/LICENSE)
+
+A Python wrapper for waifu.im API.
+
+## Table of Contents
+- [Installation](#Installation)
+- [Usage](#Usage)
+- [License](#License)
+
+## Installation
+**Python 3.6 or higher is required.**
+
+Install from PyPI
+```shell
+$ pip install waifuim.py
+```
+
+Install from source
+```shell
+$ pip install git+https://github.com/Waifu-im/waifuim.py
+```
+
+## Usage
+For now, you can only use WaifuAioClient which is async. Maybe a sync client will be released in the future.
+Most of the methods returns an `Image` instance, the attributes are the same from the ones returned by the API.
+
+### Examples with WaifuAioClient
+```python
+import asyncio
+
+from waifuim import WaifuAioClient
+
+async def main():
+
+ wf = WaifuAioClient()
+
+ # Get a completely random image
+ image = await wf.search()
+
+ # Get an image by tags
+ image = await wf.search(
+ included_tags=['waifu','maid'],
+ excluded_tags=['ero'],
+ )
+
+ image = await wf.search(
+ excluded_tags=['maid'],
+ is_nsfw='null',
+ height="<=252"
+ )
+
+ # Get sfw waifu images ordered by FAVORITES
+ images = await wf.search(
+ included_tags=['waifu'],
+ is_nsfw='null',
+ many=True,
+ order_by='FAVORITES',
+ )
+
+ # Get a user favorites
+ favorites = await wf.fav(
+ token='if not provided, use the one in the client constructor',
+ )
+
+ # Edit your favorites
+ await wf.fav_delete(3133)
+ await wf.fav_insert(
+ 3133,
+ user_id=11243585148445,
+ token='user_id and token are optional',
+ )
+ fav_state = await wf.fav_toggle(4401)
+ # will be equal to 'INSERTED' or 'DELETED'
+
+ await wf.close()
+
+ # You can also use a context manager but for multiple request it is not recommended
+
+ async with WaifuAioClient() as wf:
+ # Do your stuff
+
+asyncio.run(main())
+```
+
+### The Image and Tag instance
+In most of the case the methods will return an `Image` instance.
+The attributes are the same as the json keys that the api returns.
+```python
+
+image = await wf.search()
+>>> <waifuim.types.Image object at 0x76217ccf10>
+
+image.url
+>>> 'https://cdn.waifu.im/1982.jpg'
+
+str(image)
+>>> 'https://cdn.waifu.im/1982.jpg'
+
+image.signature
+>>> aa48cd9dc6b64367
+
+image.tags[0]
+>>> <waifuim.types.Tag object at 0x73214ccf10>
+
+image.tags[0].name
+>>> 'waifu'
+```
+
+### Some useful kwargs in the constructor
+```python
+from waifuim import WaifuAioClient
+
+wf = WaifuAioClient(
+ session=an_aiohttpClientSession_created_asynchronously,
+ app_name="TheNameOfYourApplication",
+ token="The default token to use in routes requiring authentication.",
+)
+
+# ...
+```
+
+## License
+MIT © [Buco](https://github.com/Waifu-im/waifuim.py/blob/main/LICENSE)
+ + +%package -n python3-waifuim.py +Summary: A Python wrapper for waifu.im API. +Provides: python-waifuim.py +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-waifuim.py +# waifuim.py
+[](https://pypi.org/project/waifuim.py/)
+[](https://pypi.org/project/waifuim.py/)
+[](https://github.com/Waifu-im/waifuim.py/blob/main/LICENSE)
+
+A Python wrapper for waifu.im API.
+
+## Table of Contents
+- [Installation](#Installation)
+- [Usage](#Usage)
+- [License](#License)
+
+## Installation
+**Python 3.6 or higher is required.**
+
+Install from PyPI
+```shell
+$ pip install waifuim.py
+```
+
+Install from source
+```shell
+$ pip install git+https://github.com/Waifu-im/waifuim.py
+```
+
+## Usage
+For now, you can only use WaifuAioClient which is async. Maybe a sync client will be released in the future.
+Most of the methods returns an `Image` instance, the attributes are the same from the ones returned by the API.
+
+### Examples with WaifuAioClient
+```python
+import asyncio
+
+from waifuim import WaifuAioClient
+
+async def main():
+
+ wf = WaifuAioClient()
+
+ # Get a completely random image
+ image = await wf.search()
+
+ # Get an image by tags
+ image = await wf.search(
+ included_tags=['waifu','maid'],
+ excluded_tags=['ero'],
+ )
+
+ image = await wf.search(
+ excluded_tags=['maid'],
+ is_nsfw='null',
+ height="<=252"
+ )
+
+ # Get sfw waifu images ordered by FAVORITES
+ images = await wf.search(
+ included_tags=['waifu'],
+ is_nsfw='null',
+ many=True,
+ order_by='FAVORITES',
+ )
+
+ # Get a user favorites
+ favorites = await wf.fav(
+ token='if not provided, use the one in the client constructor',
+ )
+
+ # Edit your favorites
+ await wf.fav_delete(3133)
+ await wf.fav_insert(
+ 3133,
+ user_id=11243585148445,
+ token='user_id and token are optional',
+ )
+ fav_state = await wf.fav_toggle(4401)
+ # will be equal to 'INSERTED' or 'DELETED'
+
+ await wf.close()
+
+ # You can also use a context manager but for multiple request it is not recommended
+
+ async with WaifuAioClient() as wf:
+ # Do your stuff
+
+asyncio.run(main())
+```
+
+### The Image and Tag instance
+In most of the case the methods will return an `Image` instance.
+The attributes are the same as the json keys that the api returns.
+```python
+
+image = await wf.search()
+>>> <waifuim.types.Image object at 0x76217ccf10>
+
+image.url
+>>> 'https://cdn.waifu.im/1982.jpg'
+
+str(image)
+>>> 'https://cdn.waifu.im/1982.jpg'
+
+image.signature
+>>> aa48cd9dc6b64367
+
+image.tags[0]
+>>> <waifuim.types.Tag object at 0x73214ccf10>
+
+image.tags[0].name
+>>> 'waifu'
+```
+
+### Some useful kwargs in the constructor
+```python
+from waifuim import WaifuAioClient
+
+wf = WaifuAioClient(
+ session=an_aiohttpClientSession_created_asynchronously,
+ app_name="TheNameOfYourApplication",
+ token="The default token to use in routes requiring authentication.",
+)
+
+# ...
+```
+
+## License
+MIT © [Buco](https://github.com/Waifu-im/waifuim.py/blob/main/LICENSE)
+ + +%package help +Summary: Development documents and examples for waifuim.py +Provides: python3-waifuim.py-doc +%description help +# waifuim.py
+[](https://pypi.org/project/waifuim.py/)
+[](https://pypi.org/project/waifuim.py/)
+[](https://github.com/Waifu-im/waifuim.py/blob/main/LICENSE)
+
+A Python wrapper for waifu.im API.
+
+## Table of Contents
+- [Installation](#Installation)
+- [Usage](#Usage)
+- [License](#License)
+
+## Installation
+**Python 3.6 or higher is required.**
+
+Install from PyPI
+```shell
+$ pip install waifuim.py
+```
+
+Install from source
+```shell
+$ pip install git+https://github.com/Waifu-im/waifuim.py
+```
+
+## Usage
+For now, you can only use WaifuAioClient which is async. Maybe a sync client will be released in the future.
+Most of the methods returns an `Image` instance, the attributes are the same from the ones returned by the API.
+
+### Examples with WaifuAioClient
+```python
+import asyncio
+
+from waifuim import WaifuAioClient
+
+async def main():
+
+ wf = WaifuAioClient()
+
+ # Get a completely random image
+ image = await wf.search()
+
+ # Get an image by tags
+ image = await wf.search(
+ included_tags=['waifu','maid'],
+ excluded_tags=['ero'],
+ )
+
+ image = await wf.search(
+ excluded_tags=['maid'],
+ is_nsfw='null',
+ height="<=252"
+ )
+
+ # Get sfw waifu images ordered by FAVORITES
+ images = await wf.search(
+ included_tags=['waifu'],
+ is_nsfw='null',
+ many=True,
+ order_by='FAVORITES',
+ )
+
+ # Get a user favorites
+ favorites = await wf.fav(
+ token='if not provided, use the one in the client constructor',
+ )
+
+ # Edit your favorites
+ await wf.fav_delete(3133)
+ await wf.fav_insert(
+ 3133,
+ user_id=11243585148445,
+ token='user_id and token are optional',
+ )
+ fav_state = await wf.fav_toggle(4401)
+ # will be equal to 'INSERTED' or 'DELETED'
+
+ await wf.close()
+
+ # You can also use a context manager but for multiple request it is not recommended
+
+ async with WaifuAioClient() as wf:
+ # Do your stuff
+
+asyncio.run(main())
+```
+
+### The Image and Tag instance
+In most of the case the methods will return an `Image` instance.
+The attributes are the same as the json keys that the api returns.
+```python
+
+image = await wf.search()
+>>> <waifuim.types.Image object at 0x76217ccf10>
+
+image.url
+>>> 'https://cdn.waifu.im/1982.jpg'
+
+str(image)
+>>> 'https://cdn.waifu.im/1982.jpg'
+
+image.signature
+>>> aa48cd9dc6b64367
+
+image.tags[0]
+>>> <waifuim.types.Tag object at 0x73214ccf10>
+
+image.tags[0].name
+>>> 'waifu'
+```
+
+### Some useful kwargs in the constructor
+```python
+from waifuim import WaifuAioClient
+
+wf = WaifuAioClient(
+ session=an_aiohttpClientSession_created_asynchronously,
+ app_name="TheNameOfYourApplication",
+ token="The default token to use in routes requiring authentication.",
+)
+
+# ...
+```
+
+## License
+MIT © [Buco](https://github.com/Waifu-im/waifuim.py/blob/main/LICENSE)
+ + +%prep +%autosetup -n waifuim.py-4.2.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-waifuim.py -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 4.2.3-1 +- Package Spec generated @@ -0,0 +1 @@ +14f63b5c452c30c2c0a5fda641829856 waifuim.py-4.2.3.tar.gz |
