%global _empty_manifest_terminate_build 0 Name: python-pythonpixels Version: 1.2.14 Release: 1 Summary: An API wrapper for the python discord pixels project License: MIT URL: https://github.com/sebkuip/pythonpixels Source0: https://mirrors.nju.edu.cn/pypi/web/packages/4f/22/ce2a6d91c47ea7c37b09628039e15d6061b3a37f101837cde1c45798a417/pythonpixels-1.2.14.tar.gz BuildArch: noarch Requires: python3-pillow Requires: python3-rich %description # Pythonpixels *An API wrapper for the python discord pixels project* ## Requirements pillow, rich and request are required for this library. These are automatically installed with this library. ## Usage ### Getting started First make an instance of the Client class and pass your token to the contructor. Everything in this library is done from the Client class. ```py import pythonpixels client = pythonpixels.Client("TOKEN") # Your token must be inserted where it says TOKEN ``` ### Methods ```py client.get_pixel(x, y) ``` Returns the hexadecimal color code of the given pixel Params: x: int - The x position of the pixel y: int - The y position of the pixel Returns: int - The color of the requested pixel ```py client.get_canvas(scale) ``` Fetch the entire canvas and returns it as a pillow Image instance. Optionally resize it by a scale factor Params: scale: int - A factor to resize the image by Returns: pillow.Image - The current canvas ```py client.get_size() ``` Returns the size of the canvas Params: None Returns: tuple - The width and height of the canvas ```py client.set_pixel(x, y, color) ``` Sets a pixel on the canvas Params: x: int - The x position of the pixel y: int - The y position of the pixel color: int - the RGB colorcode of the pixel Returns: None ```py client.set_picture(x, y, img) ``` Starts a job to add a picture with offset x an y. Img can either be a file directory, an direct URL (Only HTTP supported) or a pillow.Image Params: x: int - The x offset y: int- The y offset img: typing.Union[str, pillow.Image.Image] - The image to upload. Can either be a path, a HTTP direct image link or a pillow image instance Returns: None ```py client.get_limits() ``` Return the last known rate limits of the API. These are refreshed every request. Params: None Returns: dict - A dictionary with the rate limits formatted as follow "set_pixel": tuple(remaining, timeout) "get_pixel": tuple(remaining, timeout) "get_canvas": tuple(remaining, timeout) %package -n python3-pythonpixels Summary: An API wrapper for the python discord pixels project Provides: python-pythonpixels BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-pythonpixels # Pythonpixels *An API wrapper for the python discord pixels project* ## Requirements pillow, rich and request are required for this library. These are automatically installed with this library. ## Usage ### Getting started First make an instance of the Client class and pass your token to the contructor. Everything in this library is done from the Client class. ```py import pythonpixels client = pythonpixels.Client("TOKEN") # Your token must be inserted where it says TOKEN ``` ### Methods ```py client.get_pixel(x, y) ``` Returns the hexadecimal color code of the given pixel Params: x: int - The x position of the pixel y: int - The y position of the pixel Returns: int - The color of the requested pixel ```py client.get_canvas(scale) ``` Fetch the entire canvas and returns it as a pillow Image instance. Optionally resize it by a scale factor Params: scale: int - A factor to resize the image by Returns: pillow.Image - The current canvas ```py client.get_size() ``` Returns the size of the canvas Params: None Returns: tuple - The width and height of the canvas ```py client.set_pixel(x, y, color) ``` Sets a pixel on the canvas Params: x: int - The x position of the pixel y: int - The y position of the pixel color: int - the RGB colorcode of the pixel Returns: None ```py client.set_picture(x, y, img) ``` Starts a job to add a picture with offset x an y. Img can either be a file directory, an direct URL (Only HTTP supported) or a pillow.Image Params: x: int - The x offset y: int- The y offset img: typing.Union[str, pillow.Image.Image] - The image to upload. Can either be a path, a HTTP direct image link or a pillow image instance Returns: None ```py client.get_limits() ``` Return the last known rate limits of the API. These are refreshed every request. Params: None Returns: dict - A dictionary with the rate limits formatted as follow "set_pixel": tuple(remaining, timeout) "get_pixel": tuple(remaining, timeout) "get_canvas": tuple(remaining, timeout) %package help Summary: Development documents and examples for pythonpixels Provides: python3-pythonpixels-doc %description help # Pythonpixels *An API wrapper for the python discord pixels project* ## Requirements pillow, rich and request are required for this library. These are automatically installed with this library. ## Usage ### Getting started First make an instance of the Client class and pass your token to the contructor. Everything in this library is done from the Client class. ```py import pythonpixels client = pythonpixels.Client("TOKEN") # Your token must be inserted where it says TOKEN ``` ### Methods ```py client.get_pixel(x, y) ``` Returns the hexadecimal color code of the given pixel Params: x: int - The x position of the pixel y: int - The y position of the pixel Returns: int - The color of the requested pixel ```py client.get_canvas(scale) ``` Fetch the entire canvas and returns it as a pillow Image instance. Optionally resize it by a scale factor Params: scale: int - A factor to resize the image by Returns: pillow.Image - The current canvas ```py client.get_size() ``` Returns the size of the canvas Params: None Returns: tuple - The width and height of the canvas ```py client.set_pixel(x, y, color) ``` Sets a pixel on the canvas Params: x: int - The x position of the pixel y: int - The y position of the pixel color: int - the RGB colorcode of the pixel Returns: None ```py client.set_picture(x, y, img) ``` Starts a job to add a picture with offset x an y. Img can either be a file directory, an direct URL (Only HTTP supported) or a pillow.Image Params: x: int - The x offset y: int- The y offset img: typing.Union[str, pillow.Image.Image] - The image to upload. Can either be a path, a HTTP direct image link or a pillow image instance Returns: None ```py client.get_limits() ``` Return the last known rate limits of the API. These are refreshed every request. Params: None Returns: dict - A dictionary with the rate limits formatted as follow "set_pixel": tuple(remaining, timeout) "get_pixel": tuple(remaining, timeout) "get_canvas": tuple(remaining, timeout) %prep %autosetup -n pythonpixels-1.2.14 %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-pythonpixels -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu May 18 2023 Python_Bot - 1.2.14-1 - Package Spec generated