Skip to main content

Generic Python class loader for robust plugin infrastructure

Project description

Gufo Loader

Generic Python class loader for robust plugin infrastructure.

PyPi version Downloads Python Versions License Build codecov Sponsors Ruff


Documentation: https://docs.gufolabs.com/gufo_loader/

Source Code: 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 - the collaborative effort led by 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 and bring them as separate packages. Then we work on API, performance tuning, documentation, and testing. The NOC uses the final result as the external dependencies.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gufo_loader-1.0.5.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gufo_loader-1.0.5-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file gufo_loader-1.0.5.tar.gz.

File metadata

  • Download URL: gufo_loader-1.0.5.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gufo_loader-1.0.5.tar.gz
Algorithm Hash digest
SHA256 650738fe7521399ba3b663727458405d118b902cfe2257fecba706aceef5bc3d
MD5 d935655171bc618a985520216796eaab
BLAKE2b-256 2e8f9cf59d092082effe74a56a8280df02e62eb69899f6071c40f727795b2ef7

See more details on using hashes here.

Provenance

The following attestation bundles were made for gufo_loader-1.0.5.tar.gz:

Publisher: py-tests.yml on gufolabs/gufo_loader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gufo_loader-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: gufo_loader-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gufo_loader-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 862202d6de8196371d031b6e40adc5f1dbbd1ca36181531c819130fe20aa949d
MD5 cd9dd0be2f229e50fee1570307e14b55
BLAKE2b-256 8148709b18512f171134a80d8812bb647af69655d652ec30c18553c5ec7deab3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gufo_loader-1.0.5-py3-none-any.whl:

Publisher: py-tests.yml on gufolabs/gufo_loader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page