{ "info": { "author": "Zero Piraeus", "author_email": "z@etiol.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Plugins", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "\n=============================================\nook - Python-version-sensitive monkeypatching\n=============================================\n\n:Author: Zero Piraeus\n:Contact: z@etiol.net\n\n**ook** is a simple library to assist with monkeypatching Python methods and\nfunctions on a per-Python-version basis. It provides one decorator, ``patch``,\nwhich conditionally patches callables depending on which version of Python is\nrunning.\n\n\nExample\n-------\n\nAdding the ``compress()`` function to Python 2.6's ``itertools`` module::\n\n import itertools\n from ook import patch\n\n # http://docs.python.org/2.7/library/itertools.html#itertools.compress\n\n @patch(itertools, 2.6)\n def compress(data, selectors):\n # compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F\n return (d for d, s in itertools.izip(data, selectors) if s)\n\n\nUsage\n-----\n\n``patch`` accepts an arbitrary number of version arguments, in a variety of\nformats::\n\n @patch(some.module.or.class, 2.7, \"2.6.8\", (3, 2, 5), 3)\n def method_or_function(signature):\n \"\"\"Do something.\"\"\"\n pass\n\n... as well as ``min`` and ``max`` keyword arguments::\n\n @patch(some.module.or.class, min=\"2.6.5\", max=2.7)\n def method_or_function(signature):\n \"\"\"Do something.\"\"\"\n pass\n\n... which can be combined::\n\n @patch(some.module.or.class, \"3.3.5\", max=3.3)\n def method_or_function(signature):\n \"\"\"Do something.\"\"\"\n pass\n\n**Note**: If you specify both keyword and non-keyword version arguments, the\npatch will only take effect if both the explicitly specified versions and the\nimplied version ranges are satisfied.\n\nWith no arguments other than the module or class to be patched, ``patch``\napplies the patch regardless of Python version::\n\n @patch(some.module.or.class)\n def method_or_function(signature):\n \"\"\"Do something, no matter what.\"\"\"\n pass\n\n\nInstallation\n------------\n\nThis should do the trick::\n\n pip install ook\n\n\nCredits / Copyright\n-------------------\n\n**ook** was (cough) \"inspired\" by Guido van Rossum's monkeypatch_ recipe.\nThanks, Guido :-)\n\nIt's released under the GNU General Public License (version 3 or later), a copy\nof which is included with this distribution in the file **COPYING**.\n\n\n.. _monkeypatch: http://mail.python.org/pipermail/python-dev/2008-January/076194.html\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/schesis/ook", "keywords": "version sensitive monkey patch", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "ook", "package_url": "https://pypi.org/project/ook/", "platform": "", "project_url": "https://pypi.org/project/ook/", "project_urls": { "Homepage": "https://bitbucket.org/schesis/ook" }, "release_url": "https://pypi.org/project/ook/1.0.2/", "requires_dist": [ "six" ], "requires_python": "", "summary": "Python-version-sensitive monkeypatching.", "version": "1.0.2" }, "last_serial": 2770350, "releases": { "0.12.08a1": [ { "comment_text": "", "digests": { "md5": "8f66cafa5bd22749e76bb7c8c9f862b9", "sha256": "f9108615351b9a62b6ad50e6660fb06b23b93bf05f7e82ac032520f7c36d3b27" }, "downloads": -1, "filename": "ook-0.12.08a1.tar.gz", "has_sig": false, "md5_digest": "8f66cafa5bd22749e76bb7c8c9f862b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18356, "upload_time": "2012-08-17T07:29:30", "url": "https://files.pythonhosted.org/packages/d1/65/73fa4dbca8b817d24fc6a64c8a9978c07f638da7c901dac2422e6384deaa/ook-0.12.08a1.tar.gz" } ], "0.12.08a2": [ { "comment_text": "", "digests": { "md5": "aaca8a069e552fe48ffb3013ed9ed268", "sha256": "1f680c51c11c5a8b92a2ee7038d21c86edee69a56da12820943a02291d86cf7a" }, "downloads": -1, "filename": "ook-0.12.08a2.tar.gz", "has_sig": false, "md5_digest": "aaca8a069e552fe48ffb3013ed9ed268", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18356, "upload_time": "2012-08-19T19:15:24", "url": "https://files.pythonhosted.org/packages/0b/4f/7721d6ce8a073d24eee8d1f8ad5d77cbd11dff92bfc96304d3a492159b9b/ook-0.12.08a2.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "e050a130ff1206e66e40f0e7819734c3", "sha256": "d21667f52ea58802e521847d014eba69654a1e3500df12f2879d1e0ea9d3e257" }, "downloads": -1, "filename": "ook-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e050a130ff1206e66e40f0e7819734c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19210, "upload_time": "2015-02-25T18:12:39", "url": "https://files.pythonhosted.org/packages/99/34/f39b1ce69251977432405a42dfcdd11a9133af30c836bd136dbb1f051cc8/ook-1.0.0.tar.gz" } ], "1.0.0a1": [ { "comment_text": "", "digests": { "md5": "cbd079d9157a62cdecfbbe5987bd3319", "sha256": "928e0e703c46957a462dde98146cf362cac6d8d7ea072f717795130ee828c350" }, "downloads": -1, "filename": "ook-1.0.0a1.tar.gz", "has_sig": false, "md5_digest": "cbd079d9157a62cdecfbbe5987bd3319", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18327, "upload_time": "2013-08-31T23:45:44", "url": "https://files.pythonhosted.org/packages/f3/e8/e787d65af12e8882a03e5ecf0efa4c7aba2410e7a4de15ee1853a961a812/ook-1.0.0a1.tar.gz" } ], "1.0.0a2": [ { "comment_text": "", "digests": { "md5": "b8e7a33680da36a3ac2676a161cc0deb", "sha256": "82f5603a750d5c27e0163d3a7692d303f9ae0e0926dbb732e551364bd8aaf057" }, "downloads": -1, "filename": "ook-1.0.0a2.tar.gz", "has_sig": false, "md5_digest": "b8e7a33680da36a3ac2676a161cc0deb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18476, "upload_time": "2013-09-01T00:18:02", "url": "https://files.pythonhosted.org/packages/fa/80/4de468341f5e7366e4a1d8586e8c1602a62a551f1e2aa361d7b5e69a317e/ook-1.0.0a2.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "822c6525c897fec7bf9727f3d20523cb", "sha256": "ac15df2765312e5860d377193f55140929e20458c43dc5b4e7fd27d63e2ce857" }, "downloads": -1, "filename": "ook-1.0.1.tar.gz", "has_sig": false, "md5_digest": "822c6525c897fec7bf9727f3d20523cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19223, "upload_time": "2015-03-11T21:53:30", "url": "https://files.pythonhosted.org/packages/a1/93/12c11f5c370c31c8a61c06732238566b6ee4c65ccf32adf32f409c0ab71b/ook-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "0e6b97c53ce20d0e20c131179c58e86a", "sha256": "7d26a1f6f7d2b707c313e263622793ecbce5345483b87eccf0d8a7247ffd286e" }, "downloads": -1, "filename": "ook-1.0.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "0e6b97c53ce20d0e20c131179c58e86a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6073, "upload_time": "2017-04-11T00:19:52", "url": "https://files.pythonhosted.org/packages/8e/ec/682b4996085fafe9e612f6d3cb87f237bb38eebcc82dfaf1d998c3ce7898/ook-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b219107016109f81a619a237d8d0610", "sha256": "e693d58fb3e8c804228a5bb22f64e601569b54bec448d6cabdf9e5beb1cfc844" }, "downloads": -1, "filename": "ook-1.0.2.tar.gz", "has_sig": true, "md5_digest": "3b219107016109f81a619a237d8d0610", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18023, "upload_time": "2017-04-11T00:20:18", "url": "https://files.pythonhosted.org/packages/36/22/1b0f2d4de75b3af470f4e05c4de6970d16ab08815c4150d335113a46faa4/ook-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e6b97c53ce20d0e20c131179c58e86a", "sha256": "7d26a1f6f7d2b707c313e263622793ecbce5345483b87eccf0d8a7247ffd286e" }, "downloads": -1, "filename": "ook-1.0.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "0e6b97c53ce20d0e20c131179c58e86a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6073, "upload_time": "2017-04-11T00:19:52", "url": "https://files.pythonhosted.org/packages/8e/ec/682b4996085fafe9e612f6d3cb87f237bb38eebcc82dfaf1d998c3ce7898/ook-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b219107016109f81a619a237d8d0610", "sha256": "e693d58fb3e8c804228a5bb22f64e601569b54bec448d6cabdf9e5beb1cfc844" }, "downloads": -1, "filename": "ook-1.0.2.tar.gz", "has_sig": true, "md5_digest": "3b219107016109f81a619a237d8d0610", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18023, "upload_time": "2017-04-11T00:20:18", "url": "https://files.pythonhosted.org/packages/36/22/1b0f2d4de75b3af470f4e05c4de6970d16ab08815c4150d335113a46faa4/ook-1.0.2.tar.gz" } ] }