Skip to main content

No project description provided

Project description

Gufo Loader

Generic Python class loader for robust plugin infrastructure.

PyPi version Python Versions License Build Sponsors


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.
  • Full Python typing support.
  • Editor completion.
  • Well-tested, battle-proven code.

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.3.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

gufo_loader-1.0.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gufo_loader-1.0.3.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for gufo_loader-1.0.3.tar.gz
Algorithm Hash digest
SHA256 fa18b1c41b68862a0968bac7e14c83bc213a93da4567747d14b4112f3ea272d7
MD5 8cb46f6de852c1bd6e9bcec895296b41
BLAKE2b-256 081d50b36c0e7fed8bbeb2f9d86ba68ef5e5397b1ab82a894a537d89f462ef95

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gufo_loader-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for gufo_loader-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9ffa1bd67981f68405fdca233d3ae6553a282e46c1e0ea22d18da22b38076048
MD5 2a6888f487e5bd5a39eef557cf906af2
BLAKE2b-256 fa1b911dd6252bd989f98dba37524d9cbdfe6596924499dd6e9eb2caea899c3a

See more details on using hashes here.

Supported by

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