summaryrefslogtreecommitdiff
path: root/python-udpy.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-15 08:07:51 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-15 08:07:51 +0000
commit54c44d33d8e7b6ea8185f60de3c9785f8967ec87 (patch)
tree334f7834d01a4410c317be9e3946391ca4e485a5 /python-udpy.spec
parent5d18976e17c8ecd4dd3b3484af0007a6a06f37ef (diff)
automatic import of python-udpy
Diffstat (limited to 'python-udpy.spec')
-rw-r--r--python-udpy.spec272
1 files changed, 272 insertions, 0 deletions
diff --git a/python-udpy.spec b/python-udpy.spec
new file mode 100644
index 0000000..7a0f672
--- /dev/null
+++ b/python-udpy.spec
@@ -0,0 +1,272 @@
+%global _empty_manifest_terminate_build 0
+Name: python-udpy
+Version: 2.0.0
+Release: 1
+Summary: Urban dictionary API wrapper for Python
+License: MIT
+URL: https://pypi.org/project/udpy/
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/30/6a/f042fa77b28e29ea59803816e14e43c16859341d2305b5fa07e0f5191413/udpy-2.0.0.tar.gz
+BuildArch: noarch
+
+Requires: python3-requests
+Requires: python3-aiohttp
+
+%description
+# urbandictionary-py
+Simple Python wrapper for Urban Dictionary API.
+
+## Installation
+
+With PyPI:
+```
+pip install udpy
+```
+
+## Usage
+
+### UrbanDefinition
+
+This module defines **UrbanDefinition**, an object to represent each Urban Dictionary definition.
+**UrbanDefinition** has the following accessible attributes:
+* **word**: the word being defined,
+* **definition**: the word's definition,
+* **example**: usage example,
+* **upvotes**: number of upvotes on Urban Dictionary,
+* **downvotes**: number of downvotes on Urban Dictionary
+
+### Examples
+
+Create client:
+```python
+from udpy import UrbanClient
+
+client = UrbanClient()
+```
+
+Lookup by word:
+```python
+defs = client.get_definition('netflix and chill')
+
+> [List of UrbanDef objects]
+```
+
+Lookup random words:
+```python
+rand = client.get_random_definition()
+
+> [List of UrbanDef objects]
+```
+
+Read definitions:
+```python
+for d in defs:
+ print(d.definition)
+
+> It means that you are going to go over ...
+> code for two people going to each others ...
+> <other Netflix and Chill definitions> ...
+```
+
+UrbanDefinition string representation:
+```python
+for d in defs:
+ print(d)
+
+> Netflix and Chill: It means that you are going to go over to your par... (21776, 7750)
+> netflix and chill: code for two people going to each others houses an... (8056, 2622)
+> <word>: <definition trimmed to 50 characters> (<upvotes>, <downvotes>)
+```
+
+Also it has asynchronous interface. Just use `AsyncUrbanClient` and add awaits.
+
+
+%package -n python3-udpy
+Summary: Urban dictionary API wrapper for Python
+Provides: python-udpy
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-udpy
+# urbandictionary-py
+Simple Python wrapper for Urban Dictionary API.
+
+## Installation
+
+With PyPI:
+```
+pip install udpy
+```
+
+## Usage
+
+### UrbanDefinition
+
+This module defines **UrbanDefinition**, an object to represent each Urban Dictionary definition.
+**UrbanDefinition** has the following accessible attributes:
+* **word**: the word being defined,
+* **definition**: the word's definition,
+* **example**: usage example,
+* **upvotes**: number of upvotes on Urban Dictionary,
+* **downvotes**: number of downvotes on Urban Dictionary
+
+### Examples
+
+Create client:
+```python
+from udpy import UrbanClient
+
+client = UrbanClient()
+```
+
+Lookup by word:
+```python
+defs = client.get_definition('netflix and chill')
+
+> [List of UrbanDef objects]
+```
+
+Lookup random words:
+```python
+rand = client.get_random_definition()
+
+> [List of UrbanDef objects]
+```
+
+Read definitions:
+```python
+for d in defs:
+ print(d.definition)
+
+> It means that you are going to go over ...
+> code for two people going to each others ...
+> <other Netflix and Chill definitions> ...
+```
+
+UrbanDefinition string representation:
+```python
+for d in defs:
+ print(d)
+
+> Netflix and Chill: It means that you are going to go over to your par... (21776, 7750)
+> netflix and chill: code for two people going to each others houses an... (8056, 2622)
+> <word>: <definition trimmed to 50 characters> (<upvotes>, <downvotes>)
+```
+
+Also it has asynchronous interface. Just use `AsyncUrbanClient` and add awaits.
+
+
+%package help
+Summary: Development documents and examples for udpy
+Provides: python3-udpy-doc
+%description help
+# urbandictionary-py
+Simple Python wrapper for Urban Dictionary API.
+
+## Installation
+
+With PyPI:
+```
+pip install udpy
+```
+
+## Usage
+
+### UrbanDefinition
+
+This module defines **UrbanDefinition**, an object to represent each Urban Dictionary definition.
+**UrbanDefinition** has the following accessible attributes:
+* **word**: the word being defined,
+* **definition**: the word's definition,
+* **example**: usage example,
+* **upvotes**: number of upvotes on Urban Dictionary,
+* **downvotes**: number of downvotes on Urban Dictionary
+
+### Examples
+
+Create client:
+```python
+from udpy import UrbanClient
+
+client = UrbanClient()
+```
+
+Lookup by word:
+```python
+defs = client.get_definition('netflix and chill')
+
+> [List of UrbanDef objects]
+```
+
+Lookup random words:
+```python
+rand = client.get_random_definition()
+
+> [List of UrbanDef objects]
+```
+
+Read definitions:
+```python
+for d in defs:
+ print(d.definition)
+
+> It means that you are going to go over ...
+> code for two people going to each others ...
+> <other Netflix and Chill definitions> ...
+```
+
+UrbanDefinition string representation:
+```python
+for d in defs:
+ print(d)
+
+> Netflix and Chill: It means that you are going to go over to your par... (21776, 7750)
+> netflix and chill: code for two people going to each others houses an... (8056, 2622)
+> <word>: <definition trimmed to 50 characters> (<upvotes>, <downvotes>)
+```
+
+Also it has asynchronous interface. Just use `AsyncUrbanClient` and add awaits.
+
+
+%prep
+%autosetup -n udpy-2.0.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-udpy -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.0-1
+- Package Spec generated