{"id":20687626,"url":"https://github.com/klauer/demi","last_synced_at":"2025-10-24T13:15:43.801Z","repository":{"id":48114469,"uuid":"454936531","full_name":"klauer/demi","owner":"klauer","description":"demi - de-multiple-inheritance; squash class inheritance (Python 3.9+)","archived":false,"fork":false,"pushed_at":"2022-07-21T21:50:13.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-21T12:27:33.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-02T21:10:09.000Z","updated_at":"2022-02-02T21:10:38.000Z","dependencies_parsed_at":"2022-08-12T18:50:52.712Z","dependency_job_id":null,"html_url":"https://github.com/klauer/demi","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/klauer/demi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klauer%2Fdemi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klauer%2Fdemi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klauer%2Fdemi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klauer%2Fdemi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klauer","download_url":"https://codeload.github.com/klauer/demi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klauer%2Fdemi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231165,"owners_count":25245675,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-16T22:57:49.599Z","updated_at":"2025-10-24T13:15:38.766Z","avatar_url":"https://github.com/klauer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"demi - de-multiple-inheritance; squash class inheritance\n========================================================\n\nDid you make a mistake in designing a mess of classes with multiple inheritance\neverywhere?\n\nDo you want to understand deeply nested class hierarchies without navigating\nmany different source code files?\n\nWill you avoid making such mistakes in the future?\n\n... well, my answers to the above questions are \"yes :(\", \"yes!\", and \"probably\nnot\", respectively.\n\nIn any case -\n\nThis repo is a proof-of-concept of a tool that may have the potential to help\nwith the above.  It probably won't help you just yet.\n\nRequirements\n------------\n\n* Python 3.9+ (for ``ast.unparse``)\n\nUsage\n-----\n\nInstall\n\n```bash\n$ pip install demi\n```\n\nTry with a provided test class:\n```bash\n$ demi import demi.tests.cls_ab.C\n```\n\nOr preferrably, reformat with black at the same time:\n```bash\n$ demi import demi.tests.cls_ab.C |black -\n```\n\n```python\nclass C:\n    \"\"\"A Docstring\n\n    B Docstring\n\n    C Docstring\"\"\"\n\n    a_value = \"A\"\n\n    def afunc(self) -\u003e str:\n        return \"A\"\n\n    def superfunc(self) -\u003e int:\n        def _super_A() -\u003e int:\n            b = ord(self.afunc())\n            a = b + 2\n            return a\n\n        return _super_A() + 1\n\n    b_value = \"B\"\n    c_value = \"C\"\n\n    def bfunc(self) -\u003e str:\n        return \"B\"\n\n    def cfunc(self) -\u003e str:\n        return \"C\"\n```\n\nOr maybe try something from the standard library:\n```\ndemi import argparse.BooleanOptionalAction\ndemi import tkinter.Widget\n...\n```\n\nMaybe TODO\n----------\n\n* Properties have the same name twice, so only the setter gets shown\n* Switch to redbaron to retain comments?\n* Automatically invoke black to reformat the output?\n* Test suite?\n* For returns at the end of the method, simplify code?\n* Consider astor for Python below 3.9?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklauer%2Fdemi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklauer%2Fdemi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklauer%2Fdemi/lists"}