{"id":19082271,"url":"https://github.com/waikato-datamining/coed","last_synced_at":"2025-06-21T04:36:22.086Z","repository":{"id":235067588,"uuid":"789995851","full_name":"waikato-datamining/coed","owner":"waikato-datamining","description":"Configurable Object Entry-point Discovery","archived":false,"fork":false,"pushed_at":"2024-10-03T01:50:28.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-25T20:02:46.941Z","etag":null,"topics":["entrypoints","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waikato-datamining.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","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":"2024-04-22T04:23:08.000Z","updated_at":"2024-10-03T01:50:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e41ec2bb-b9bd-44b5-ab28-c0a3d8e4b29d","html_url":"https://github.com/waikato-datamining/coed","commit_stats":null,"previous_names":["waikato-datamining/coed"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/waikato-datamining/coed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fcoed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fcoed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fcoed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fcoed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waikato-datamining","download_url":"https://codeload.github.com/waikato-datamining/coed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fcoed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261064352,"owners_count":23104722,"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":["entrypoints","python3"],"created_at":"2024-11-09T02:42:46.696Z","updated_at":"2025-06-21T04:36:17.075Z","avatar_url":"https://github.com/waikato-datamining.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coed\nConfigurable Object Entry-point Discovery.\n\n## Installation\n\nInstall via pip:\n\n```bash\npip install \"git+https://github.com/waikato-datamining/coed.git\"\n```\n\n## Usage\n\nApproach:\n\n1. define a class lister function\n2. reference the class lister function in `setup.py`\n3. create a custom registry\n4. query classes\n\nFor the examples below, we assume that the project is called `project42`.\n\n### Class lister function\n\nThe class lister function simply returns a dictionary of super classes \nassociated with lists of packages that classes derived from these super \nclasses may occur in. \n\nFor example, the following function is located in module `project42.class_lister`:\n\n```python\nfrom typing import List, Dict\n\ndef list_classes() -\u003e Dict[str, List[str]]:\n    return {\n        \"project42.superclass.One\": [\n            \"project42.one\",\n            \"project42.two\",\n        ],\n        \"project42.superclass.Two\": [\n            \"project42.deep.deeper.deepest.another\",\n        ],\n        \"project42.superclass.Three\": [\n            \"project42.one\",\n            \"project42.three\",\n            \"project42.deep.four\",\n            \"project42.five\",\n        ],\n    }\n```\n\n### Entry point in setup.py\n\nThe format for referencing the class lister function is as follows:\n\n```\n    ...\n    entry_points={\n        \"class_lister\": [\n            \"unique_name=module_name:function_name\",\n        ],\n    },\n    ...\n```\n\nIf the `function_name` is `list_classes`, it can be omitted.\n\nThe above example class lister function would be referenced like this:\n\n```\n    ...\n    entry_points={\n        \"class_lister\": [\n            \"project42=project42.class_lister\",\n        ],\n    },\n    ...\n```\n\n### Custom registry\n\nCreate a custom registry (module `project42.registry`):\n\n```python\nfrom coed.registry import Registry as CRegistry\n\nENV_CLASSLISTERS = \"PROJECT42_CLASSLISTERS\"\n\nclass Registry(CRegistry):\n    \"\"\"\n    Registry for managing plugins.\n    \"\"\"\n\n    def __init__(self):\n        super().__init__(env_class_listers=ENV_CLASSLISTERS)\n\n\nREGISTRY = Registry()\n```\n\n**Notes** \nThe environment variable is useful while developing, as the entrypoints\nare only available when installing the library.\n\nWhile developing in your IDE, you can set the `PROJECT42_CLASSLISTERS`\nenvironment variable to list all your class lister functions (comma-separated list),\ne.g.:\n\n```\nPROJECT42_CLASSLISTERS=project42.class_lister:list_classes\n```\n\n### Query classes\n\nWith the registry in place, you can now obtain all the classes that have been \nassociated with a certain super class, e.g.:\n\n```python\nfrom project42.registry import REGISTRY\n\nclasses = REGISTRY.classes(\"project42.superclass.One\")\nfor c in classes:\n    print(c)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaikato-datamining%2Fcoed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaikato-datamining%2Fcoed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaikato-datamining%2Fcoed/lists"}