Skip to main content

A plugin framework

Project description

yantra

yantra is a simple plugin manager/plugin discovery framework.

Usage

Let's assume you have a class called BaseReportPlugin which all report plugins derive from.

from yantra import PluginManager, PluginType
from reports import BaseReportPlugin

# Define the type
report_type = PluginType(name='report',
                         base_class=BaseReportPlugin',
                         path='/plugins/reports/')

# Instantiate the manager
plugin_manager = PluginManager([report_type])

# Fetch plugins
plugin_manager.get_plugins(report_type)

You can register multiple plugin types. An alternate way to register plugin types is as follows:

plugin_manager = PluginManager()
plugin_manager.register_plugin_type(foo_type)

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

yantra-0.6.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

yantra-0.6.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file yantra-0.6.0.tar.gz.

File metadata

  • Download URL: yantra-0.6.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for yantra-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4f3c8ab53695d61cc7671f2cc10464d988d79f3ba517cd95dec95168c2975faf
MD5 947993446df33d7a28812938e3c522e8
BLAKE2b-256 b19b5a92fe4d938b727ad8033248f2b0d2dccfd02a0e145fb63e5de6531bae31

See more details on using hashes here.

File details

Details for the file yantra-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: yantra-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for yantra-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82962779e996efdebdb750797ce0cff7f9f441ec90842e7dce9b171955706f5f
MD5 59cddcc1729f3364b6985dc34c9c95ca
BLAKE2b-256 0a13ca9a98f63c985e3789526cf0332f24ee430ea150af2b3f1efb14ed6580e2

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