%global _empty_manifest_terminate_build 0 Name: python-multicolorcaptcha Version: 1.2.0 Release: 1 Summary: Python random image-captcha generator library. License: GPLv3 URL: https://github.com/J-Rios/multicolorcaptcha Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2e/97/7b47adde8e6074b6020454dea3f44b9ad21e4d2a3272de7fb4e431089257/multicolorcaptcha-1.2.0.tar.gz BuildArch: noarch Requires: python3-Pillow %description # multicolorcaptcha Python random image-captcha generator library. ## Installation To generate the images of the Captchas, the library uses Pillow module. - For Linux systems, it is necessary to install Pillow prerequisites (also, Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL): ```bash sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk ``` - Install the module ```bash pip3 install multicolorcaptcha ``` ## API Usage ```py from multicolorcaptcha import CaptchaGenerator # Captcha image size number (2 -> 640x360) CAPCTHA_SIZE_NUM = 2 # Create Captcha Generator object of specified size generator = CaptchaGenerator(CAPCTHA_SIZE_NUM) # Generate a captcha image captcha = generator.gen_captcha_image(difficult_level=3) math_captcha = generator.gen_math_captcha_image(difficult_level=2) # Get information of standard captcha image = captcha.image characters = captcha.characters # Get information of math captcha math_image = math_captcha.image math_equation_string = math_captcha.equation_str math_equation_result = math_captcha.equation_result # Save the images to files image.save("captcha.png", "png") math_image.save("captcha.png", "png") ``` ## Generated Captchas Examples ### Monocolor Background Captchas ![Monocolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Monocolor_Background.png) ### Multicolor Background Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Multicolor_Background.png) ### ASCII Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Ascii.png) ### Modificable Difficult Level Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Max_Complex.png) ### Math Equation Captchas ![Math Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Math.png) %package -n python3-multicolorcaptcha Summary: Python random image-captcha generator library. Provides: python-multicolorcaptcha BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-multicolorcaptcha # multicolorcaptcha Python random image-captcha generator library. ## Installation To generate the images of the Captchas, the library uses Pillow module. - For Linux systems, it is necessary to install Pillow prerequisites (also, Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL): ```bash sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk ``` - Install the module ```bash pip3 install multicolorcaptcha ``` ## API Usage ```py from multicolorcaptcha import CaptchaGenerator # Captcha image size number (2 -> 640x360) CAPCTHA_SIZE_NUM = 2 # Create Captcha Generator object of specified size generator = CaptchaGenerator(CAPCTHA_SIZE_NUM) # Generate a captcha image captcha = generator.gen_captcha_image(difficult_level=3) math_captcha = generator.gen_math_captcha_image(difficult_level=2) # Get information of standard captcha image = captcha.image characters = captcha.characters # Get information of math captcha math_image = math_captcha.image math_equation_string = math_captcha.equation_str math_equation_result = math_captcha.equation_result # Save the images to files image.save("captcha.png", "png") math_image.save("captcha.png", "png") ``` ## Generated Captchas Examples ### Monocolor Background Captchas ![Monocolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Monocolor_Background.png) ### Multicolor Background Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Multicolor_Background.png) ### ASCII Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Ascii.png) ### Modificable Difficult Level Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Max_Complex.png) ### Math Equation Captchas ![Math Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Math.png) %package help Summary: Development documents and examples for multicolorcaptcha Provides: python3-multicolorcaptcha-doc %description help # multicolorcaptcha Python random image-captcha generator library. ## Installation To generate the images of the Captchas, the library uses Pillow module. - For Linux systems, it is necessary to install Pillow prerequisites (also, Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL): ```bash sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk ``` - Install the module ```bash pip3 install multicolorcaptcha ``` ## API Usage ```py from multicolorcaptcha import CaptchaGenerator # Captcha image size number (2 -> 640x360) CAPCTHA_SIZE_NUM = 2 # Create Captcha Generator object of specified size generator = CaptchaGenerator(CAPCTHA_SIZE_NUM) # Generate a captcha image captcha = generator.gen_captcha_image(difficult_level=3) math_captcha = generator.gen_math_captcha_image(difficult_level=2) # Get information of standard captcha image = captcha.image characters = captcha.characters # Get information of math captcha math_image = math_captcha.image math_equation_string = math_captcha.equation_str math_equation_result = math_captcha.equation_result # Save the images to files image.save("captcha.png", "png") math_image.save("captcha.png", "png") ``` ## Generated Captchas Examples ### Monocolor Background Captchas ![Monocolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Monocolor_Background.png) ### Multicolor Background Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Multicolor_Background.png) ### ASCII Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Ascii.png) ### Modificable Difficult Level Captchas ![Multicolor Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Max_Complex.png) ### Math Equation Captchas ![Math Captcha](https://github.com/J-Rios/multicolorcaptcha/raw/master/images/Math.png) %prep %autosetup -n multicolorcaptcha-1.2.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-multicolorcaptcha -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 1.2.0-1 - Package Spec generated