{ "info": { "author": "Romain Gaucher", "author_email": "r@rgaucher.info", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Programming Language :: Python" ], "description": "Welcome to equip's documentation!\n=================================\n\nequip is a small library that helps with Python bytecode instrumentation. Its API\nis designed to be small and flexible to enable a wide range of possible instrumentations.\n\nThe instrumentation is designed around the injection of bytecode inside the\nbytecode of the program to be instrumented. However, the developer does not need to know\nanything about the Python bytecode.\n\nThe following example shows how to write a simple instrumentation tool that will print all\nmethod called in the program, along with its arguments::\n\n import sys\n import equip\n from equip import Instrumentation, MethodVisitor, SimpleRewriter\n\n BEFORE_CODE = \"\"\"\n print \">> START\"\n print \"[CALL] {file_name}::{method_name}:{lineno}\", {arguments}\n print \"<< END\"\n \"\"\"\n\n class MethodInstr(MethodVisitor):\n def __init__(self):\n MethodVisitor.__init__(self)\n\n def visit(self, meth_decl):\n rewriter = SimpleRewriter(meth_decl)\n rewriter.insert_before(BEFORE_CODE)\n\n instr_visitor = MethodInstr()\n instr = Instrumentation(sys.argv[1])\n if not instr.prepare_program():\n return\n instr.apply(instr_visitor, rewrite=True)\n\nThis program requires the path to the program to instrument, and will compile the source\nto generate the bytecode to instrument. All bytecode will be loaded into its representation,\nand the ``MethodInstr`` visitor will be called on all method declarations.\n\nWhen a change is required (i.e., the code actually needs to be instrumented), the\n``Instrumentation`` will overwrite the ``pyc`` file.\n\nRunning the instrumented program afterwards does not require anything but executing it as you\nwould usually do. If the injected code has external dependencies, you can simply modify the\n``PYTHONPATH`` to point to the required modules.", "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/neuroo/equip", "keywords": "bytecode injection instrumentation", "license": "APACHE", "maintainer": "", "maintainer_email": "", "name": "equip", "package_url": "https://pypi.org/project/equip/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/equip/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/neuroo/equip" }, "release_url": "https://pypi.org/project/equip/0.1/", "requires_dist": null, "requires_python": null, "summary": "Python bytecode instrumentation framework", "version": "0.1" }, "last_serial": 1272430, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "c370883ebd010e2a306607a233dab794", "sha256": "5588c763c7aceb034a90661432b88cca4a229d522ecb71fa790c58e3cefa5601" }, "downloads": -1, "filename": "equip-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c370883ebd010e2a306607a233dab794", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 33546, "upload_time": "2014-10-16T11:01:33", "url": "https://files.pythonhosted.org/packages/6c/f9/cfbe8302096d75f4cbc56c2785c9a02b36c44e4639283fa2e7c98b0257b9/equip-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f7b8826b441d330bf90fbf97aa9fe49", "sha256": "d667c25f9b4bb9d060eef799b6fed715565c1840c754c1f257292083bd1883ea" }, "downloads": -1, "filename": "equip-0.1.tar.gz", "has_sig": false, "md5_digest": "9f7b8826b441d330bf90fbf97aa9fe49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25052, "upload_time": "2014-10-16T11:01:30", "url": "https://files.pythonhosted.org/packages/c1/d5/6b0ffdd5255e5479894bc0a79430216843ab0c6f3591a8a7a9909e829660/equip-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c370883ebd010e2a306607a233dab794", "sha256": "5588c763c7aceb034a90661432b88cca4a229d522ecb71fa790c58e3cefa5601" }, "downloads": -1, "filename": "equip-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c370883ebd010e2a306607a233dab794", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 33546, "upload_time": "2014-10-16T11:01:33", "url": "https://files.pythonhosted.org/packages/6c/f9/cfbe8302096d75f4cbc56c2785c9a02b36c44e4639283fa2e7c98b0257b9/equip-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f7b8826b441d330bf90fbf97aa9fe49", "sha256": "d667c25f9b4bb9d060eef799b6fed715565c1840c754c1f257292083bd1883ea" }, "downloads": -1, "filename": "equip-0.1.tar.gz", "has_sig": false, "md5_digest": "9f7b8826b441d330bf90fbf97aa9fe49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25052, "upload_time": "2014-10-16T11:01:30", "url": "https://files.pythonhosted.org/packages/c1/d5/6b0ffdd5255e5479894bc0a79430216843ab0c6f3591a8a7a9909e829660/equip-0.1.tar.gz" } ] }