{ "info": { "author": "wushuyi", "author_email": "wushuyi541@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved", "License :: OSI Approved :: BSD License", "Operating System :: MacOS", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython" ], "description": "wsy_captcha\r\n===================\r\n\r\nA library that generates image captcha.\r\n\r\n.. image:: https://raw.githubusercontent.com/wushuyi/wsy_captcha/master/test.png\r\n\r\nInstallation\r\n------------\r\n\r\nInstall wsy_captcha with pip::\r\n\r\n $ pip install wsy_captcha\r\n \r\nBase Usage\r\n-----\r\n.. code:: python\r\n\r\n from wsy_captcha.comp import print_\r\n from wsy_captcha.captcha import Captcha\r\n\r\n captcha = Captcha()\r\n code = captcha.randomCode()\r\n print_(code)\r\n captcha.write(code, 'test.png')\r\n\r\nAdvanced Usage\r\n-----\r\n.. code:: python\r\n\r\n from wsy_captcha.comp import print_\r\n from wsy_captcha.captcha import Captcha\r\n import wsy_captcha.image as image\r\n\r\n\r\n class MyCaptcha(Captcha):\r\n def generate_image(self, chars):\r\n text_drawings = [\r\n image.warp(),\r\n image.rotate(),\r\n image.offset(),\r\n ]\r\n fn = image.captcha(\r\n drawings=[\r\n image.background(color='#FFFFFF'),\r\n image.text(fonts=self._fonts, drawings=text_drawings),\r\n image.curve(width=2),\r\n image.curve(width=2),\r\n image.curve(width=2),\r\n image.noise(number=60, color='#5C87B2', level=2),\r\n image.smooth(),\r\n ],\r\n width=self._width,\r\n height=self._height,\r\n )\r\n return fn(chars)\r\n\r\n\r\n captcha = MyCaptcha()\r\n code = captcha.randomCode()\r\n img = captcha.generate(code)\r\n print_(code)\r\n f = open('test.png', 'wb')\r\n f.write(img.read())\r\n f.close()", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wushuyi/wsy_captcha", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "wsy_captcha", "package_url": "https://pypi.org/project/wsy_captcha/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/wsy_captcha/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/wushuyi/wsy_captcha" }, "release_url": "https://pypi.org/project/wsy_captcha/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "A library that generates image captcha.", "version": "1.0.0" }, "last_serial": 1757736, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4e0a3e97b547bce34304a0d62bfa45f7", "sha256": "511724420e362566d7a4c85f42e86ff57a0364176a628954d796dd6f342081e0" }, "downloads": -1, "filename": "wsy_captcha-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4e0a3e97b547bce34304a0d62bfa45f7", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 61646, "upload_time": "2015-10-07T06:08:36", "url": "https://files.pythonhosted.org/packages/f4/f4/8fbb4ee5b03be4a497bea513e8f289c3fab2c978b26c056098cdca4f9f1a/wsy_captcha-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "087e2d807980670647c43b575bc7b4a1", "sha256": "cabe1ed099563d547c6f87d5940d40c46b57e2eff8a4abfc9cde3ecd7d6e7527" }, "downloads": -1, "filename": "wsy_captcha-1.0.0.tar.gz", "has_sig": false, "md5_digest": "087e2d807980670647c43b575bc7b4a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59807, "upload_time": "2015-10-07T05:54:49", "url": "https://files.pythonhosted.org/packages/14/75/09f4bcf57e6de679bca149600cdba53aad7b076446eec2965e0e95262378/wsy_captcha-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4e0a3e97b547bce34304a0d62bfa45f7", "sha256": "511724420e362566d7a4c85f42e86ff57a0364176a628954d796dd6f342081e0" }, "downloads": -1, "filename": "wsy_captcha-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4e0a3e97b547bce34304a0d62bfa45f7", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 61646, "upload_time": "2015-10-07T06:08:36", "url": "https://files.pythonhosted.org/packages/f4/f4/8fbb4ee5b03be4a497bea513e8f289c3fab2c978b26c056098cdca4f9f1a/wsy_captcha-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "087e2d807980670647c43b575bc7b4a1", "sha256": "cabe1ed099563d547c6f87d5940d40c46b57e2eff8a4abfc9cde3ecd7d6e7527" }, "downloads": -1, "filename": "wsy_captcha-1.0.0.tar.gz", "has_sig": false, "md5_digest": "087e2d807980670647c43b575bc7b4a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59807, "upload_time": "2015-10-07T05:54:49", "url": "https://files.pythonhosted.org/packages/14/75/09f4bcf57e6de679bca149600cdba53aad7b076446eec2965e0e95262378/wsy_captcha-1.0.0.tar.gz" } ] }