%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 ... > ... ``` 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) > : (, ) ``` 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 ... > ... ``` 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) > : (, ) ``` 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 ... > ... ``` 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) > : (, ) ``` 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 - 2.0.0-1 - Package Spec generated