{"id":19657723,"url":"https://github.com/esss/hookman","last_synced_at":"2025-04-09T20:07:57.014Z","repository":{"id":37484044,"uuid":"139453138","full_name":"ESSS/hookman","owner":"ESSS","description":"A plugin management system in python to applications (in totally or partially) written in C++.      ","archived":false,"fork":false,"pushed_at":"2025-04-09T17:34:27.000Z","size":500,"stargazers_count":29,"open_issues_count":2,"forks_count":5,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-09T20:07:51.158Z","etag":null,"topics":["hacktoberfest","hook","plugin-manager","plugin-system","python"],"latest_commit_sha":null,"homepage":"https://hookman.readthedocs.io","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/ESSS.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","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":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-02T14:16:32.000Z","updated_at":"2025-02-28T18:06:18.000Z","dependencies_parsed_at":"2023-12-26T16:04:59.438Z","dependency_job_id":"ea34bb86-2a0f-482f-8ff3-82c4fcf7d3d8","html_url":"https://github.com/ESSS/hookman","commit_stats":{"total_commits":247,"total_committers":16,"mean_commits":15.4375,"dds":0.4858299595141701,"last_synced_commit":"51285dd07537ca5378b3c542154e17aee2d6c4fb"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fhookman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fhookman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fhookman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fhookman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ESSS","download_url":"https://codeload.github.com/ESSS/hookman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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":["hacktoberfest","hook","plugin-manager","plugin-system","python"],"created_at":"2024-11-11T15:33:23.402Z","updated_at":"2025-04-09T20:07:56.992Z","avatar_url":"https://github.com/ESSS.png","language":"Python","readme":"=======\nHookman\n=======\n\n.. image:: https://img.shields.io/pypi/v/python-hookman.svg\n    :target: https://pypi.python.org/pypi/python-hookman\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/python-hookman.svg\n    :target: https://anaconda.org/conda-forge/python-hookman\n\n.. image:: https://img.shields.io/pypi/pyversions/python-hookman.svg\n    :target: https://pypi.org/project/python-hookman\n\n.. image:: https://codecov.io/gh/ESSS/hookman/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/ESSS/hookman\n\n.. image:: https://github.com/ESSS/hookman/workflows/Hookman%20-%20CI/badge.svg\n    :target: https://github.com/ESSS/hookman/actions\n\n.. image:: https://readthedocs.org/projects/hookman/badge/?version=latest\n    :target: https://hookman.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n\nThis documentation covers HookMan usage \u0026 API.\n\nFor information about HookMan,  read the section above. For public changelog and how the project is maintained, please check the `GitHub page`_\n\nWhat is HookMan?\n================\n\n``HookMan`` is a python package that provides a plugin management system to applications,\nspecially those who are written (in totally or partially) in C++.\n\nIt enables external contributors to implement plugins which act as extensions written in C/C++\nthat interact with the application through well-defined *hooks*.\n\nThis system was largely inspired by `pluggy`_,\nthe plugin system which powers `pytest`_, `tox`_, and `devpi`_, but with the intent to be called\nfrom a C++ application rather than from Python.\n\nIt was conceived to facilitate the application development, allowing hooks to be exposed in a\nclear way and allowing plugins to be developed without access to classes or data from the application.\n\nWith ``HookMan`` your application can have access to the hooks implemented on plugins as simple as the example below.\n\n.. code-block:: python\n\n    # Initializing a class\n    hm = HookMan(specs=acme_specs, plugin_dirs=['path1','path2'])\n\n    hook_caller = hm.get_hook_caller()\n\n    # Getting access to the hook implementation\n    friction_factor = hook_caller.friction_factor()\n    env_temperature = hook_caller.env_temperature()\n\n    # Checking if the hook was implemented\n    assert friction_factor is not None\n    assert env_temperature is None\n\n    # Executing the hook, wherever it is implemented either in plugin A or B.\n    ff_result = friction_factor(1, 2.5)\n    env_tmp_result = env_temperature(35.5, 45.5)\n\nHow does it work?\n-----------------\n\nIn order to use ``HookMan`` in your application, it is necessary to inform which ``Hooks``\nare available to be implemented through a configuration object.\n\n\nWith this configuration defined, users can create plugins that implement available ``Hooks`` extending the behavior of your application.\n\n\nAll plugins informed to your application will be validated by HookMan (to check which hooks are implemented),\nand an object holding a reference to the ``Hooks`` will be passed to the application.\n\n\nThe ``HookMan`` project uses the library pybind11_ to interact between Python and C/C++,\nallowing a straightforward usage for who is calling the function (either in Python or in C++).\n\n\nDefining some terminologies:\n\n- ``Application`` ⇨  The program that offers the extensions.\n- ``Hook``        ⇨  An extension of the Application.\n- ``Plugin``      ⇨  The program that implements the ``Hooks``.\n- ``User``        ⇨  The person who installed the application.\n\n\n\n\n`Read the docs to learn more!`_\n\n* Documentation: https://hookman.readthedocs.io.\n* Free software: MIT license\n\n\nCredits\n-------\nThanks for pluggy_,  which is a similar project (plugin system) and source for many ideas.\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _`GitHub page` :                   https://github.com/ESSS/hookman\n.. _`read the docs to learn more!` :  https://hookman.readthedocs.io\n.. _Cookiecutter:                     https://github.com/audreyr/cookiecutter\n.. _devpi:                            https://github.com/devpi/devpi\n.. _pluggy:                           https://github.com/pytest-dev/pluggy\n.. _pybind11:                         https://github.com/pybind/pybind11\n.. _pytest:                           https://github.com/pytest-dev/pytest\n.. _tox:                              https://github.com/tox-dev/tox\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesss%2Fhookman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesss%2Fhookman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesss%2Fhookman/lists"}