{"id":18581710,"url":"https://github.com/jpablo/python-extension-methods","last_synced_at":"2026-01-24T23:32:16.915Z","repository":{"id":68198795,"uuid":"2205694","full_name":"jpablo/python-extension-methods","owner":"jpablo","description":"Metaclass for easily extending classes (monkeypatching)","archived":false,"fork":false,"pushed_at":"2011-08-14T15:35:42.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T04:08:01.797Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/jpablo.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2011-08-14T15:14:19.000Z","updated_at":"2013-10-22T04:34:57.000Z","dependencies_parsed_at":"2023-02-21T02:46:21.155Z","dependency_job_id":null,"html_url":"https://github.com/jpablo/python-extension-methods","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jpablo/python-extension-methods","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpablo%2Fpython-extension-methods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpablo%2Fpython-extension-methods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpablo%2Fpython-extension-methods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpablo%2Fpython-extension-methods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpablo","download_url":"https://codeload.github.com/jpablo/python-extension-methods/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpablo%2Fpython-extension-methods/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28738998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-07T00:06:46.169Z","updated_at":"2026-01-24T23:32:15.546Z","avatar_url":"https://github.com/jpablo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExtendClass\n\nA metaclass that allows to extend a class with methods from another.\n\n## Example\n```python\nfrom django.contrib.auth.models import User\n\nclass UserExtension(object):\n\n    __metaclass__ = ExtendClass(User)\n\n    @property\n    def profile(self):\n        return self.get_profile()\n\n    def in_group(self, name):\n        return self.groups.filter(name=name).count() \u003e 0\n\n# \u003e\u003e\u003e u = User.objects.all()[0]\n# \u003e\u003e\u003e assert u.profile == u.get_profile()\n# \u003e\u003e\u003e assert u.in_group(\"crazy_group\") == False\n```\n\n## TODO\n\nThe real reason for this metaclass is to detect if we are overriding something.\n\n1. Warn if something is being overriden\n2. Optionally force override\n3. Friendly interface, something like \"class UserExtension(User,Extension): ... \"\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpablo%2Fpython-extension-methods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpablo%2Fpython-extension-methods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpablo%2Fpython-extension-methods/lists"}