{"id":22493522,"url":"https://github.com/ri0t/python-mro-graph","last_synced_at":"2025-08-23T23:16:15.720Z","repository":{"id":147301895,"uuid":"312641619","full_name":"ri0t/python-mro-graph","owner":"ri0t","description":"A small tool to generate and illustrate (via dot) the method resolution order graph of Python objects","archived":false,"fork":false,"pushed_at":"2020-11-14T17:56:46.000Z","size":23,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T23:18:21.019Z","etag":null,"topics":["developer-tools","dot","graph","method","mro","order","python2","python3","resolution","tool","visualizer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ri0t.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-13T17:29:48.000Z","updated_at":"2020-11-14T17:56:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9b79c0c-f6f8-49f9-84f7-259bb4c7d785","html_url":"https://github.com/ri0t/python-mro-graph","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ri0t%2Fpython-mro-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ri0t%2Fpython-mro-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ri0t%2Fpython-mro-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ri0t%2Fpython-mro-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ri0t","download_url":"https://codeload.github.com/ri0t/python-mro-graph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924499,"owners_count":20694728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","dot","graph","method","mro","order","python2","python3","resolution","tool","visualizer"],"created_at":"2024-12-06T18:40:06.268Z","updated_at":"2025-03-27T20:46:10.437Z","avatar_url":"https://github.com/ri0t.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"python-mro-graph generator\n##########################\n\nA small tool to generate and illustrate (via dot) the method resolution order graph of\nPython objects\n\nBased off of Michele Simionato's original work from 2003, which you can find here:\nhttp://www.phyast.pitt.edu/~micheles/python/drawMRO.html\n\nI added packaging foam and a click based command line interface and some minor\nupdates. Nothing that changes the basic functionality much, except perhaps an additional\ndot-source export.\n\nRequirements\n============\n\nGenerating a graph needs the dot tool installed. Usually this tool resides in the\n`graphviz` package.\n\nAdditionally - to display the resulting graphs - either imagemagick or ghostview or\nsome other postscript or png viewer is required.\n\nUsage\n=====\n\nCommand line tool\n-----------------\n\nYou will need to be able to import the object you want to investigate.\n\nSimple usage: builtins\n~~~~~~~~~~~~~~~~~~~~~~\n\nA simple example demonstrating usage for builtin objects:\n\n.. code-block::\n\n    mro-graph \"\" \"dict\"\n\n..which displays the MRO of a simple dictionary. Notice that IMPORT_EXEC\nis left empty, that is because we do not need to import anything to inspect\nbuiltins.\n\nComplex usage: packaged objects\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSay, you have a package called `test` which contains a module called `test_module`\nwhich in turn contains the object you want to inspect, called `test_object`.\n\nTo inspect it, call `mro-graph` and instruct it to generate a graph:\n\n.. code-block::\n\n    mro-graph \"from test.test_module import test_object\" \"test_object\"\n\n..which should result in it displaying the MRO graph to you.\n\nSee the command line help for more details:\n\n.. code-block::\n\n    mro-graph --help\n\nAs importable component\n-----------------------\n\nYou can also do it this way:\n\n.. code-block::\n\n    from mro_graph import MROGraph\n\n    MROGraph(dict)\n\nThis will generate and display the MRO graph of Python's builtin dictionary.\nBy using it this way, you can inspect live objects right inside your program.\n\nLicense\n=======\n\nCopyright (C) 2003 Michele Simionato\n\nCopyright (C) 2019-2020 Heiko 'riot' Weinen\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fri0t%2Fpython-mro-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fri0t%2Fpython-mro-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fri0t%2Fpython-mro-graph/lists"}