From 9f2319a3a92243ac313f016f498ae469402bb2a7 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 10 May 2023 08:32:32 +0000 Subject: automatic import of python-pygelbooru --- .gitignore | 1 + python-pygelbooru.spec | 309 +++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 311 insertions(+) create mode 100644 python-pygelbooru.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..62952fe 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/pygelbooru-0.5.0.tar.gz diff --git a/python-pygelbooru.spec b/python-pygelbooru.spec new file mode 100644 index 0000000..951b393 --- /dev/null +++ b/python-pygelbooru.spec @@ -0,0 +1,309 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pygelbooru +Version: 0.5.0 +Release: 1 +Summary: PyGelbooru is an unofficial and lightweight asynchronous library for Gelbooru compatible API's. +License: gpl-3.0 +URL: https://github.com/FujiMakoto/pygelbooru +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3e/c4/e3291d3e7985d9269c02832fcc9863682ca4456c187d033a5597761fb8f2/pygelbooru-0.5.0.tar.gz +BuildArch: noarch + +Requires: python3-aiohttp +Requires: python3-furl +Requires: python3-xmltodict + +%description +# PyGelbooru +![GitHub](https://img.shields.io/github/license/FujiMakoto/pygelbooru) + +PyGelbooru is an unofficial and lightweight asynchronous library for the [Gelbooru](https://gelbooru.com/) API. + +# Installation +This library requires [Python 3.6](https://www.python.org) or above. + +You can install the library through pip as follows, +```shell script +pip install pygelbooru +``` + +## Usage + +### Searching +The primary use for this library is, naturally, to search for images with specific tags. + +This can be done as so: +```python +from pygelbooru import Gelbooru + +# API key/user ID is optional, but access may be limited without them +gelbooru = Gelbooru('API_KEY', 'USER_ID') + +results = await gelbooru.search_posts(tags=['dog ears', '1girl'], exclude_tags=['nude']) +[, + , + , + , + , + ... + ``` +Tags **can** contain spaces when passed as arguments, they will simply be reformated with underscores before being queried, so you don't need to reformat them yourself. + +Results are returned as a list of GelbooruImage containers. When cast to a string, this will return the image_url, +```python +str(results[0]) +'https://img2.gelbooru.com/images/b7/7e/b77e69be0a4b581eac597527dde071dc.jpeg' +``` + +You can also pull other information returned by the API, +https://github.com/FujiMakoto/pygelbooru/blob/master/pygelbooru/gelbooru.py#L32-L47 + +### Searching (Random) +In addition to searching for a large list of images, PyGelbooru also provides a helper method for when you're really just after a single, random image that matches the specified tags. + +This method will automatically pull a random image from the last 20,000 Gelbooru image submissions. + +```python +result = await gelbooru.random_post(tags=['cat ears', '1girl', 'cat hood', 'bell'], exclude_tags=['nude']) + +``` + +### Comments + +You can fetch post comments directly from the GelbooruImage container, +```python +post = await gelbooru.get_post(5099841) +await post.get_comments() +[] +``` + +### Tags +Besides searching for images, you can also pull information on tags as follows, +```python +await gelbooru.tag_list(name='dog ears') + + +# Use "name_pattern" to search for partial matches to a specified tag +await gelbooru.tag_list(name_pattern='%splatoon%', limit=4) +[, + , + , + ] +``` + + + + +%package -n python3-pygelbooru +Summary: PyGelbooru is an unofficial and lightweight asynchronous library for Gelbooru compatible API's. +Provides: python-pygelbooru +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pygelbooru +# PyGelbooru +![GitHub](https://img.shields.io/github/license/FujiMakoto/pygelbooru) + +PyGelbooru is an unofficial and lightweight asynchronous library for the [Gelbooru](https://gelbooru.com/) API. + +# Installation +This library requires [Python 3.6](https://www.python.org) or above. + +You can install the library through pip as follows, +```shell script +pip install pygelbooru +``` + +## Usage + +### Searching +The primary use for this library is, naturally, to search for images with specific tags. + +This can be done as so: +```python +from pygelbooru import Gelbooru + +# API key/user ID is optional, but access may be limited without them +gelbooru = Gelbooru('API_KEY', 'USER_ID') + +results = await gelbooru.search_posts(tags=['dog ears', '1girl'], exclude_tags=['nude']) +[, + , + , + , + , + ... + ``` +Tags **can** contain spaces when passed as arguments, they will simply be reformated with underscores before being queried, so you don't need to reformat them yourself. + +Results are returned as a list of GelbooruImage containers. When cast to a string, this will return the image_url, +```python +str(results[0]) +'https://img2.gelbooru.com/images/b7/7e/b77e69be0a4b581eac597527dde071dc.jpeg' +``` + +You can also pull other information returned by the API, +https://github.com/FujiMakoto/pygelbooru/blob/master/pygelbooru/gelbooru.py#L32-L47 + +### Searching (Random) +In addition to searching for a large list of images, PyGelbooru also provides a helper method for when you're really just after a single, random image that matches the specified tags. + +This method will automatically pull a random image from the last 20,000 Gelbooru image submissions. + +```python +result = await gelbooru.random_post(tags=['cat ears', '1girl', 'cat hood', 'bell'], exclude_tags=['nude']) + +``` + +### Comments + +You can fetch post comments directly from the GelbooruImage container, +```python +post = await gelbooru.get_post(5099841) +await post.get_comments() +[] +``` + +### Tags +Besides searching for images, you can also pull information on tags as follows, +```python +await gelbooru.tag_list(name='dog ears') + + +# Use "name_pattern" to search for partial matches to a specified tag +await gelbooru.tag_list(name_pattern='%splatoon%', limit=4) +[, + , + , + ] +``` + + + + +%package help +Summary: Development documents and examples for pygelbooru +Provides: python3-pygelbooru-doc +%description help +# PyGelbooru +![GitHub](https://img.shields.io/github/license/FujiMakoto/pygelbooru) + +PyGelbooru is an unofficial and lightweight asynchronous library for the [Gelbooru](https://gelbooru.com/) API. + +# Installation +This library requires [Python 3.6](https://www.python.org) or above. + +You can install the library through pip as follows, +```shell script +pip install pygelbooru +``` + +## Usage + +### Searching +The primary use for this library is, naturally, to search for images with specific tags. + +This can be done as so: +```python +from pygelbooru import Gelbooru + +# API key/user ID is optional, but access may be limited without them +gelbooru = Gelbooru('API_KEY', 'USER_ID') + +results = await gelbooru.search_posts(tags=['dog ears', '1girl'], exclude_tags=['nude']) +[, + , + , + , + , + ... + ``` +Tags **can** contain spaces when passed as arguments, they will simply be reformated with underscores before being queried, so you don't need to reformat them yourself. + +Results are returned as a list of GelbooruImage containers. When cast to a string, this will return the image_url, +```python +str(results[0]) +'https://img2.gelbooru.com/images/b7/7e/b77e69be0a4b581eac597527dde071dc.jpeg' +``` + +You can also pull other information returned by the API, +https://github.com/FujiMakoto/pygelbooru/blob/master/pygelbooru/gelbooru.py#L32-L47 + +### Searching (Random) +In addition to searching for a large list of images, PyGelbooru also provides a helper method for when you're really just after a single, random image that matches the specified tags. + +This method will automatically pull a random image from the last 20,000 Gelbooru image submissions. + +```python +result = await gelbooru.random_post(tags=['cat ears', '1girl', 'cat hood', 'bell'], exclude_tags=['nude']) + +``` + +### Comments + +You can fetch post comments directly from the GelbooruImage container, +```python +post = await gelbooru.get_post(5099841) +await post.get_comments() +[] +``` + +### Tags +Besides searching for images, you can also pull information on tags as follows, +```python +await gelbooru.tag_list(name='dog ears') + + +# Use "name_pattern" to search for partial matches to a specified tag +await gelbooru.tag_list(name_pattern='%splatoon%', limit=4) +[, + , + , + ] +``` + + + + +%prep +%autosetup -n pygelbooru-0.5.0 + +%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-pygelbooru -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot - 0.5.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..f1a02f0 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +a56cf93182a26927c60527ef8a221ffe pygelbooru-0.5.0.tar.gz -- cgit v1.2.3