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 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.4.tar.gz (12.9 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.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gufo_loader-1.0.4.tar.gz
Algorithm Hash digest
SHA256 a341b09eab6e7b85dfd67505ad7142de3e5c436efd460dc7c5c3186c764f72aa
MD5 f13160b28ff48d3ddfad64de41f98ec4
BLAKE2b-256 56abc7abf3721d3008426e976477e66a8f7bc4107bd6551d1cd162eb65a16f9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gufo_loader-1.0.4.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.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for gufo_loader-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 aaccc84bd648a0b0cd066ae5d333479ed72a282106d9e5abcb990020c680a526
MD5 da3f4df3e048f1e7fa52ce86ab7da116
BLAKE2b-256 426e2257a595f8808976fde5f9bc13af8c159d45f94426d95dca77cf18e48b71

See more details on using hashes here.

Provenance

The following attestation bundles were made for gufo_loader-1.0.4-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