summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-12 01:59:02 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-12 01:59:02 +0000
commit9502c1eecb9bbf48c8de92d316343d4ec1008d67 (patch)
treeee43735b6a4166866c5f91643df01e8383f7d8f1
parentd3a7523573ccc498574bd8ff342b19f4752016cb (diff)
automatic import of python-prsaw2
-rw-r--r--.gitignore1
-rw-r--r--python-prsaw2.spec288
-rw-r--r--sources1
3 files changed, 290 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..90ef6df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/prsaw2-0.42.tar.gz
diff --git a/python-prsaw2.spec b/python-prsaw2.spec
new file mode 100644
index 0000000..7148c4e
--- /dev/null
+++ b/python-prsaw2.spec
@@ -0,0 +1,288 @@
+%global _empty_manifest_terminate_build 0
+Name: python-prsaw2
+Version: 0.42
+Release: 1
+Summary: Stands for Python random api wrapper version 2.
+License: MIT License
+URL: https://github.com/FlamptX/prsaw2
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/94/47/ead42f4df0f2e1403afa89443a162deb619ac5105ebc3403719906ccf907/prsaw2-0.42.tar.gz
+BuildArch: noarch
+
+
+%description
+# prsaw2
+Simple python API wrapper for the Random Stuff API.
+
+- Easy to use
+- Wraps the entire API
+- Supports both async and sync
+- Supports v2, v3 and v4 version of API
+
+- **[PyPi Package](https://pypi.org/project/prsaw2)**
+- **[Documentation](https://flampt.gitbook.io/prsaw2)**
+
+## Installation
+Installation can be done easily using the python package manager `pip`
+```bash
+pip install prsaw2
+```
+
+## Quickstart
+Firstly make sure to [get the API key from here](https://api.pgamerx.com/register)
+
+Here are few examples to get you started.
+
+### Getting AI response
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_ai_response("Hi there")
+client.close() # Not necessary
+print(response)
+```
+
+### Getting random joke
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_joke(type="any")
+client.close() # Not necessary
+print(response.joke)
+```
+
+### Getting random image
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_image(type="any")
+client.close()
+print(response)
+```
+
+## Async Support
+The library also supports async usage.
+```py
+import prsaw2
+import asyncio
+
+client = prsaw2.AsyncClient(key="api-key-here")
+
+async def coro():
+ response = await client.get_ai_response("Hello world")
+ await client.close()
+ print(response)
+
+loop = asyncio.get_event_loop()
+loop.run_until_complete(coro())
+```
+
+
+
+%package -n python3-prsaw2
+Summary: Stands for Python random api wrapper version 2.
+Provides: python-prsaw2
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-prsaw2
+# prsaw2
+Simple python API wrapper for the Random Stuff API.
+
+- Easy to use
+- Wraps the entire API
+- Supports both async and sync
+- Supports v2, v3 and v4 version of API
+
+- **[PyPi Package](https://pypi.org/project/prsaw2)**
+- **[Documentation](https://flampt.gitbook.io/prsaw2)**
+
+## Installation
+Installation can be done easily using the python package manager `pip`
+```bash
+pip install prsaw2
+```
+
+## Quickstart
+Firstly make sure to [get the API key from here](https://api.pgamerx.com/register)
+
+Here are few examples to get you started.
+
+### Getting AI response
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_ai_response("Hi there")
+client.close() # Not necessary
+print(response)
+```
+
+### Getting random joke
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_joke(type="any")
+client.close() # Not necessary
+print(response.joke)
+```
+
+### Getting random image
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_image(type="any")
+client.close()
+print(response)
+```
+
+## Async Support
+The library also supports async usage.
+```py
+import prsaw2
+import asyncio
+
+client = prsaw2.AsyncClient(key="api-key-here")
+
+async def coro():
+ response = await client.get_ai_response("Hello world")
+ await client.close()
+ print(response)
+
+loop = asyncio.get_event_loop()
+loop.run_until_complete(coro())
+```
+
+
+
+%package help
+Summary: Development documents and examples for prsaw2
+Provides: python3-prsaw2-doc
+%description help
+# prsaw2
+Simple python API wrapper for the Random Stuff API.
+
+- Easy to use
+- Wraps the entire API
+- Supports both async and sync
+- Supports v2, v3 and v4 version of API
+
+- **[PyPi Package](https://pypi.org/project/prsaw2)**
+- **[Documentation](https://flampt.gitbook.io/prsaw2)**
+
+## Installation
+Installation can be done easily using the python package manager `pip`
+```bash
+pip install prsaw2
+```
+
+## Quickstart
+Firstly make sure to [get the API key from here](https://api.pgamerx.com/register)
+
+Here are few examples to get you started.
+
+### Getting AI response
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_ai_response("Hi there")
+client.close() # Not necessary
+print(response)
+```
+
+### Getting random joke
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_joke(type="any")
+client.close() # Not necessary
+print(response.joke)
+```
+
+### Getting random image
+```py
+import prsaw2
+
+client = prsaw2.Client(key='api-key-here')
+
+response = client.get_image(type="any")
+client.close()
+print(response)
+```
+
+## Async Support
+The library also supports async usage.
+```py
+import prsaw2
+import asyncio
+
+client = prsaw2.AsyncClient(key="api-key-here")
+
+async def coro():
+ response = await client.get_ai_response("Hello world")
+ await client.close()
+ print(response)
+
+loop = asyncio.get_event_loop()
+loop.run_until_complete(coro())
+```
+
+
+
+%prep
+%autosetup -n prsaw2-0.42
+
+%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-prsaw2 -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 0.42-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..1cc88f8
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+3889f0894d48b8b6e3a7529c214ebfc4 prsaw2-0.42.tar.gz