{ "info": { "author": "Christopher Crouzet", "author_email": "christopher.crouzet@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "Gorilla\n=======\n\n.. image:: https://img.shields.io/travis/christophercrouzet/gorilla/master.svg\n :target: https://travis-ci.org/christophercrouzet/gorilla\n :alt: Build status\n\n.. image:: https://img.shields.io/coveralls/christophercrouzet/gorilla/master.svg\n :target: https://coveralls.io/r/christophercrouzet/gorilla\n :alt: Coverage Status\n\n.. image:: https://img.shields.io/pypi/v/gorilla.svg\n :target: https://pypi.python.org/pypi/gorilla\n :alt: PyPI latest version\n\n.. image:: https://readthedocs.org/projects/gorilla/badge/?version=latest\n :target: https://gorilla.readthedocs.io\n :alt: Documentation status\n\n.. image:: https://img.shields.io/pypi/l/gorilla.svg\n :target: https://pypi.python.org/pypi/gorilla\n :alt: License\n\n\nGorilla is a Python library that provides a convenient approach to monkey\npatching.\n\nMonkey patching is the process of **modifying module and class attributes at\nruntime** with the purpose of replacing or extending third-party code.\n\nAlthough *not* a recommended practice, it is sometimes useful to fix or modify\nthe behaviour of a piece of code from a third-party library, or to extend its\npublic interface while making the additions feel like they are built-in into\nthe library.\n\nThe Python language makes monkey patching extremely easy but the advantages of\nGorilla are multiple, not only in assuring a **consistent behaviour** on both\nPython 2 and Python 3 versions, but also in preventing common source of errors,\nand making the process both **intuitive and convenient** even when faced with\n*large* numbers of patches to create.\n\n\nFeatures\n--------\n\n* intuitive and convenient decorator approach to create patches.\n* can create patches for all class or module members at once.\n* compatible with both Python 2 and Python 3.\n* customizable behaviour.\n\n\nUsage\n-----\n\nThanks to the dynamic nature of Python that makes monkey patching possible, the\nprocess happens at runtime without ever having to directly modify the source\ncode of the third-party library:\n\n.. code-block:: python\n\n >>> import gorilla\n >>> import destination\n >>> @gorilla.patches(destination.Class)\n ... class MyClass(object):\n ... def method(self):\n ... print(\"Hello\")\n ... @classmethod\n ... def class_method(cls):\n ... print(\"world!\")\n\n\nThe code above creates two patches, one for each member of the class\n``MyClass``, but does not apply them yet. In other words, they define the\ninformation required to carry on the operation but are not yet inserted into\nthe specified destination class ``destination.Class``.\n\nSuch patches created with the decorators can then be automatically retrieved by\nrecursively scanning a package or a module, then applied:\n\n.. code-block:: python\n\n >>> import gorilla\n >>> import mypackage\n >>> patches = gorilla.find_patches([mypackage])\n >>> for patch in patches:\n ... gorilla.apply(patch)\n\n\nSee the `Tutorial`_ section from the documentation for more detailed examples\nand explanations on how to use Gorilla.\n\n\nDocumentation\n-------------\n\nRead the documentation online at `gorilla.readthedocs.io`_ or check its source\nin the ``doc`` directory.\n\n\nOut There\n---------\n\nProjects using Gorilla include:\n\n* `bana `_\n\n\nAuthor\n------\n\nChristopher Crouzet\n<`christophercrouzet.com `_>\n\n\n.. _gorilla.readthedocs.io: https://gorilla.readthedocs.io\n.. _Tutorial: https://gorilla.readthedocs.io/en/latest/tutorial.html", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/christophercrouzet/gorilla", "keywords": "gorilla monkey patch", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gorilla", "package_url": "https://pypi.org/project/gorilla/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gorilla/", "project_urls": { "Homepage": "https://github.com/christophercrouzet/gorilla" }, "release_url": "https://pypi.org/project/gorilla/0.3.0/", "requires_dist": [ "coverage; extra == 'dev'", "sphinx (>=1.3); extra == 'dev'", "tox; extra == 'dev'", "sphinx (>=1.3); extra == 'docs'" ], "requires_python": "", "summary": "Convenient approach to monkey patching", "version": "0.3.0" }, "last_serial": 2581499, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a4c07b2a803035b3c9cb621912711f21", "sha256": "d91ec51536bf6f7346df8c5970d6f103562fc4a1b07b0c3753bfc77f74011307" }, "downloads": -1, "filename": "gorilla-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a4c07b2a803035b3c9cb621912711f21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29793, "upload_time": "2014-06-22T01:33:16", "url": "https://files.pythonhosted.org/packages/b4/16/07cdc7768807b8ccf8a255fec8b37482f649fbdc5e9cb644caec08a49635/gorilla-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "1c6c40e24692f268c3a30df9cea3f610", "sha256": "1b1ec8c9c8a2e53dfc71949d253f8232921c5237597cfe7b6284cd22ec13bc33" }, "downloads": -1, "filename": "gorilla-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1c6c40e24692f268c3a30df9cea3f610", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84715, "upload_time": "2014-06-29T15:33:19", "url": "https://files.pythonhosted.org/packages/bb/20/13b493efa78e15f76cf5d3daa60d064c1f0e6b17ab80a66390c17495f193/gorilla-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "459399cf344ff986fa9aa4abc5081631", "sha256": "66a4301f6db3924965f85246e1de64a4e7ec8b98b7b40e97dc01e2d0284cd46b" }, "downloads": -1, "filename": "gorilla-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "459399cf344ff986fa9aa4abc5081631", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8300, "upload_time": "2016-12-20T10:31:11", "url": "https://files.pythonhosted.org/packages/fc/e9/49efd155c21e95df6ee4c05c3b7399cde10d30c86d5b9f164acb36c77253/gorilla-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8101fc4dcad4ef995de57b3d87ff4986", "sha256": "b80ad304f9c48f5ed34c0b705198b871e14b04be647d5df368207e0b10a6cf52" }, "downloads": -1, "filename": "gorilla-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8101fc4dcad4ef995de57b3d87ff4986", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22652, "upload_time": "2016-12-20T10:31:14", "url": "https://files.pythonhosted.org/packages/95/ff/c808620e0edc745fe66fa6c2ef47b3ed856f882181c7ea0be245fcd5f5ee/gorilla-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "955d1453d4359c718dd71f5224ec3f56", "sha256": "01cce2a62e2493cc2a2da28910a4740cdda1a6ef08a1fc4db76b6e637c274a69" }, "downloads": -1, "filename": "gorilla-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "955d1453d4359c718dd71f5224ec3f56", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11400, "upload_time": "2017-01-18T06:22:24", "url": "https://files.pythonhosted.org/packages/e3/56/5a683944cbfc77e429c6f03c636ca50504a785f60ffae91ddd7f5f7bb520/gorilla-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97662e356fa647c7ce09eaabd79860f2", "sha256": "feb2899b923935c25420b94aa8c266ccb5c0315199c685b725303a73195d802c" }, "downloads": -1, "filename": "gorilla-0.3.0.tar.gz", "has_sig": false, "md5_digest": "97662e356fa647c7ce09eaabd79860f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26586, "upload_time": "2017-01-18T06:22:26", "url": "https://files.pythonhosted.org/packages/d0/72/4d778288aa522cf4be81a7c3fffb10dd1982065f0bb63dd83dac5b339ac0/gorilla-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "955d1453d4359c718dd71f5224ec3f56", "sha256": "01cce2a62e2493cc2a2da28910a4740cdda1a6ef08a1fc4db76b6e637c274a69" }, "downloads": -1, "filename": "gorilla-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "955d1453d4359c718dd71f5224ec3f56", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11400, "upload_time": "2017-01-18T06:22:24", "url": "https://files.pythonhosted.org/packages/e3/56/5a683944cbfc77e429c6f03c636ca50504a785f60ffae91ddd7f5f7bb520/gorilla-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97662e356fa647c7ce09eaabd79860f2", "sha256": "feb2899b923935c25420b94aa8c266ccb5c0315199c685b725303a73195d802c" }, "downloads": -1, "filename": "gorilla-0.3.0.tar.gz", "has_sig": false, "md5_digest": "97662e356fa647c7ce09eaabd79860f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26586, "upload_time": "2017-01-18T06:22:26", "url": "https://files.pythonhosted.org/packages/d0/72/4d778288aa522cf4be81a7c3fffb10dd1982065f0bb63dd83dac5b339ac0/gorilla-0.3.0.tar.gz" } ] }