{ "info": { "author": "guyskk", "author_email": "guyskk@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "# Module Graph\n\nShow python modules dependency graph and static memory usage.\n\n## Install\n\nFirst you need [graphviz](https://www.graphviz.org/) installed in your system.\n\n- Mac:\n\n ```\n brew install graphviz\n ```\n\n- Ubuntu:\n\n ```\n sudo apt-get update\n sudo apt-get install graphviz libgraphviz-dev pkg-config\n ```\n\nThen:\n\n```\npip install 'module-graph[all]'\n```\n\n## Usage\n\n### Analysis current installed modules\n\nTravel all modules and generate graph data:\n\n```\npython -m module_graph.run_traveler\n```\n\nCommand reference:\n\n```\nusage: run_traveler.py [-h] [--modules MODULES] [--ignore IGNORE]\n\nModule Graph Traveler\n\noptional arguments:\n -h, --help show this help message and exit\n --modules MODULES top level modules to check, default all modules\n --ignore IGNORE ignore modules (shell patterns)\n```\n\n### Analysis modules used by application\n\n> **Warning**: the hooker will do crazy patch to `sys` module, your application may be slower or crash!\n\nSetup hooker as early as possible in application.\n\n```python\nimport module_graph\n\nif __name__ == \"__main__\":\n memory_hooker = module_graph.setup_hooker(\n save_to='data/module_graph.json', verbose=True)\n```\n\nRun your aplication for a while, then stop it.\nThe hooker will generate data for all modules used by application.\n\n### Render graph\n\nUse `module-graph` command to render graph, for example:\n\n```\nmodule-graph --input-filepath data/module_graph.json\n```\n\nCommand reference:\n\n```\nusage: module-graph [-h] [--modules-filepath MODULES_FILEPATH]\n [--input-filepath INPUT_FILEPATH]\n [--output-filepath OUTPUT_FILEPATH]\n [--threshold THRESHOLD]\n\nModule Graph Render\n\noptional arguments:\n -h, --help show this help message and exit\n --modules-filepath MODULES_FILEPATH\n modules to render, default all modules\n --input-filepath INPUT_FILEPATH\n the module graph data generated by hooker (json file)\n --output-filepath OUTPUT_FILEPATH\n render output PDF filepath\n --threshold THRESHOLD\n donot show module which memory usage < threshold (MB)\n```\n\n## How it work\n\nIt patch `sys.meta_path`, `sys.modules` and all module loaders,\nthen record memory before and after module import.\n\n## License\n\nThis package is distributed under the MIT license.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/guyskk/module_graph", "keywords": "module dependency graph memory", "license": "", "maintainer": "", "maintainer_email": "", "name": "module-graph", "package_url": "https://pypi.org/project/module-graph/", "platform": "", "project_url": "https://pypi.org/project/module-graph/", "project_urls": { "Homepage": "https://github.com/guyskk/module_graph" }, "release_url": "https://pypi.org/project/module-graph/0.0.1/", "requires_dist": null, "requires_python": ">=3.4, <4", "summary": "Show python modules dependency graph and static memory usage.", "version": "0.0.1" }, "last_serial": 5894874, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "06ce93a7bd1b21e1d1a6757fa5badc13", "sha256": "8d28b8ca24a7f83f8b4388b2fabfb17802e6ac489e33488b463dc67e168f8338" }, "downloads": -1, "filename": "module-graph-0.0.1.tar.gz", "has_sig": false, "md5_digest": "06ce93a7bd1b21e1d1a6757fa5badc13", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, <4", "size": 8582, "upload_time": "2019-09-27T08:32:52", "url": "https://files.pythonhosted.org/packages/1e/7f/5342a99e5dfaf0a5b9db1239878398461195ca34906125cb5a7c54b9981f/module-graph-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "06ce93a7bd1b21e1d1a6757fa5badc13", "sha256": "8d28b8ca24a7f83f8b4388b2fabfb17802e6ac489e33488b463dc67e168f8338" }, "downloads": -1, "filename": "module-graph-0.0.1.tar.gz", "has_sig": false, "md5_digest": "06ce93a7bd1b21e1d1a6757fa5badc13", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, <4", "size": 8582, "upload_time": "2019-09-27T08:32:52", "url": "https://files.pythonhosted.org/packages/1e/7f/5342a99e5dfaf0a5b9db1239878398461195ca34906125cb5a7c54b9981f/module-graph-0.0.1.tar.gz" } ] }