gufo-loader


Namegufo-loader JSON
Version 1.0.4 PyPI version JSON
download
home_pageNone
SummaryGeneric Python class loader for robust plugin infrastructure
upload_time2025-08-24 13:46:10
maintainerNone
docs_urlNone
authorGufo Labs
requires_python>=3.9
licenseBSD 3-Clause License
keywords loader plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Gufo Loader

*Generic Python class loader for robust plugin infrastructure*.

[![PyPi version](https://img.shields.io/pypi/v/gufo_loader.svg)](https://pypi.python.org/pypi/gufo_loader/)
![Downloads](https://img.shields.io/pypi/dw/gufo_loader)
![Python Versions](https://img.shields.io/pypi/pyversions/gufo_loader)
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
![Build](https://img.shields.io/github/actions/workflow/status/gufolabs/gufo_loader/py-tests.yml?branch=master)
![Sponsors](https://img.shields.io/github/sponsors/gufolabs)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json)](https://github.com/charliermarsh/ruff)

---

**Documentation**: [https://docs.gufolabs.com/gufo_loader/](https://docs.gufolabs.com/gufo_loader/)

**Source Code**: [https://github.com/gufolabs/gufo_loader/](https://github.com/gufolabs/gufo_loader/)

---

Loader delivers plugins from one or many plugin packages.

## Loader

Loader is the _dict_-like singleton providing the following services:

* plugin initialization and fetching.
* plugins enumeration.

Plugins are not dependent on the loader and do not need any registration
process. The loaders are lazy by nature, meaning the plugin will be imported 
and initialized just in time when the user code requests the plugin.

## Plugins

Plugins are named entities dedicated to the given task. Each plugin
is defined in its python module. Depending on the loader settings
plugins can be:

* *Instances*: Singleton instances having the class as the ancestor.
* *Subclasses*: Classes having the common ancestor.
* *Protocols*: Classes following the set of methods.

## Plugin Packages

Plugin packages are plain Python packages: the directory containing
python files with plugins and the empty `__init__.py` file.

Plugin name must match the module name. For example, module
`my_plugin.py` will define the plugin `my_plugin`.

Examples:

    Plugins as the subclasses:

        loader = Loader[Type[BasePlugin]](base="myproject.plugins")

    Plugins as the singletones:

        loader = Loader[BasePlugin](base="myproject.plugins")

    Plugins as the protocols:

        loader = Loader[MyProtocol](base="myproject.plugins")

## Virtues

* Clean dict-like API.
* Full abstraction from the plugin internals.
* Custom plugins.
* Built with security in mind.
* Full Python typing support.
* Editor completion.
* Well-tested, battle-proven code.
* 100% test coverage.

## On Gufo Stack

This product is a part of [Gufo Stack][Gufo Stack] - the collaborative effort 
led by [Gufo Labs][Gufo Labs]. Our goal is to create a robust and flexible 
set of tools to create network management software and automate 
routine administration tasks.

To do this, we extract the key technologies that have proven themselves 
in the [NOC][NOC] and bring them as separate packages. Then we work on API,
performance tuning, documentation, and testing. The [NOC][NOC] uses the final result
as the external dependencies.

[Gufo Stack][Gufo Stack] makes the [NOC][NOC] better, and this is our primary task. But other products
can benefit from [Gufo Stack][Gufo Stack] too. So we believe that our effort will make 
the other network management products better.

[Gufo Labs]: https://gufolabs.com/
[Gufo Stack]: https://docs.gufolabs.com/
[NOC]: https://getnoc.com/

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gufo-loader",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "loader, plugin",
    "author": "Gufo Labs",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/56/ab/c7abf3721d3008426e976477e66a8f7bc4107bd6551d1cd162eb65a16f9d/gufo_loader-1.0.4.tar.gz",
    "platform": null,
    "description": "# Gufo Loader\n\n*Generic Python class loader for robust plugin infrastructure*.\n\n[![PyPi version](https://img.shields.io/pypi/v/gufo_loader.svg)](https://pypi.python.org/pypi/gufo_loader/)\n![Downloads](https://img.shields.io/pypi/dw/gufo_loader)\n![Python Versions](https://img.shields.io/pypi/pyversions/gufo_loader)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n![Build](https://img.shields.io/github/actions/workflow/status/gufolabs/gufo_loader/py-tests.yml?branch=master)\n![Sponsors](https://img.shields.io/github/sponsors/gufolabs)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json)](https://github.com/charliermarsh/ruff)\n\n---\n\n**Documentation**: [https://docs.gufolabs.com/gufo_loader/](https://docs.gufolabs.com/gufo_loader/)\n\n**Source Code**: [https://github.com/gufolabs/gufo_loader/](https://github.com/gufolabs/gufo_loader/)\n\n---\n\nLoader delivers plugins from one or many plugin packages.\n\n## Loader\n\nLoader is the _dict_-like singleton providing the following services:\n\n* plugin initialization and fetching.\n* plugins enumeration.\n\nPlugins are not dependent on the loader and do not need any registration\nprocess. The loaders are lazy by nature, meaning the plugin will be imported \nand initialized just in time when the user code requests the plugin.\n\n## Plugins\n\nPlugins are named entities dedicated to the given task. Each plugin\nis defined in its python module. Depending on the loader settings\nplugins can be:\n\n* *Instances*: Singleton instances having the class as the ancestor.\n* *Subclasses*: Classes having the common ancestor.\n* *Protocols*: Classes following the set of methods.\n\n## Plugin Packages\n\nPlugin packages are plain Python packages: the directory containing\npython files with plugins and the empty `__init__.py` file.\n\nPlugin name must match the module name. For example, module\n`my_plugin.py` will define the plugin `my_plugin`.\n\nExamples:\n\n    Plugins as the subclasses:\n\n        loader = Loader[Type[BasePlugin]](base=\"myproject.plugins\")\n\n    Plugins as the singletones:\n\n        loader = Loader[BasePlugin](base=\"myproject.plugins\")\n\n    Plugins as the protocols:\n\n        loader = Loader[MyProtocol](base=\"myproject.plugins\")\n\n## Virtues\n\n* Clean dict-like API.\n* Full abstraction from the plugin internals.\n* Custom plugins.\n* Built with security in mind.\n* Full Python typing support.\n* Editor completion.\n* Well-tested, battle-proven code.\n* 100% test coverage.\n\n## On Gufo Stack\n\nThis product is a part of [Gufo Stack][Gufo Stack] - the collaborative effort \nled by [Gufo Labs][Gufo Labs]. Our goal is to create a robust and flexible \nset of tools to create network management software and automate \nroutine administration tasks.\n\nTo do this, we extract the key technologies that have proven themselves \nin the [NOC][NOC] and bring them as separate packages. Then we work on API,\nperformance tuning, documentation, and testing. The [NOC][NOC] uses the final result\nas the external dependencies.\n\n[Gufo Stack][Gufo Stack] makes the [NOC][NOC] better, and this is our primary task. But other products\ncan benefit from [Gufo Stack][Gufo Stack] too. So we believe that our effort will make \nthe other network management products better.\n\n[Gufo Labs]: https://gufolabs.com/\n[Gufo Stack]: https://docs.gufolabs.com/\n[NOC]: https://getnoc.com/\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "Generic Python class loader for robust plugin infrastructure",
    "version": "1.0.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/gufolabs/gufo_loader/issues",
        "Changelog": "https://github.com/gufolabs/gufo_loader/blob/master/CHANGELOG.md",
        "Documentation": "https://docs.gufolabs.com/gufo_loader/",
        "Homepage": "https://github.com/gufolabs/gufo_loader/",
        "Source Code": "https://github.com/gufolabs/gufo_loader/"
    },
    "split_keywords": [
        "loader",
        " plugin"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "426e2257a595f8808976fde5f9bc13af8c159d45f94426d95dca77cf18e48b71",
                "md5": "da3f4df3e048f1e7fa52ce86ab7da116",
                "sha256": "aaccc84bd648a0b0cd066ae5d333479ed72a282106d9e5abcb990020c680a526"
            },
            "downloads": -1,
            "filename": "gufo_loader-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "da3f4df3e048f1e7fa52ce86ab7da116",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7479,
            "upload_time": "2025-08-24T13:46:08",
            "upload_time_iso_8601": "2025-08-24T13:46:08.561006Z",
            "url": "https://files.pythonhosted.org/packages/42/6e/2257a595f8808976fde5f9bc13af8c159d45f94426d95dca77cf18e48b71/gufo_loader-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "56abc7abf3721d3008426e976477e66a8f7bc4107bd6551d1cd162eb65a16f9d",
                "md5": "f13160b28ff48d3ddfad64de41f98ec4",
                "sha256": "a341b09eab6e7b85dfd67505ad7142de3e5c436efd460dc7c5c3186c764f72aa"
            },
            "downloads": -1,
            "filename": "gufo_loader-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "f13160b28ff48d3ddfad64de41f98ec4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 12931,
            "upload_time": "2025-08-24T13:46:10",
            "upload_time_iso_8601": "2025-08-24T13:46:10.364181Z",
            "url": "https://files.pythonhosted.org/packages/56/ab/c7abf3721d3008426e976477e66a8f7bc4107bd6551d1cd162eb65a16f9d/gufo_loader-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-24 13:46:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gufolabs",
    "github_project": "gufo_loader",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gufo-loader"
}
        
Elapsed time: 1.22610s