Skip to main content

Plugable: A Python Plugin Framework

Badges:

  • Build: Build Status
  • Coverage: Coverage Status

This package exposes a framework for writing extensible applications.

Specifically, it allows consumers to mark an abstract class as "Plugable", using standard inheritance semantics and ABC decorators:

from abc import abstractmethod
from plugable import Plugable

class AbstractInterface(Plugable):
    @abstractmethod
    def example(self):
        pass

Following this, you can create subclasses for differing implementations, and register them with the AbstractInterface registry, like so:

class ExampleOne(AbstractInterface, register="one"): # Integrated registration
    def example(self):
        print("You ran ExampleOne!")

class ExampleTwo(AbstractInterface):
    def example(self):
        print("You ran ExampleTwo!")

AbstractInterface.registry.register("two", ExampleTwo) # Explicit registration

Finally, you can access and consume the registered implementations, like so:

AbstractInterface.get("one").example()  # You ran ExampleOne!
AbstractInterface.get("two").example()  # You ran ExampleTwo!

Metadata

Release files for plugable 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plugable 1.2.2
File Size Uploaded Provenance Actions
plugable-1.2.2.tar.gz 3.9 kB Without provenance Details for plugable-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plugable 1.2.2
File Interpreter ABI Platform Actions
plugable-1.2.2-py3-none-any.whl Python 3 none any Details for plugable-1.2.2-py3-none-any.whl

Total release size: 8.0 kB

Release files / plugable-1.2.2.tar.gz

Download URL plugable-1.2.2.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bc0782c11255f206f606595c3065a397571e5dc91b08b2b0126ed462ef3b8cc4
BLAKE2b-256 checksum
How to use checksums
f811b89c680a1e19640f36fc70497418b4312c7f74a7aeb1a39ddfa7343c0118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / plugable-1.2.2-py3-none-any.whl

Download URL plugable-1.2.2-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97412801790acfdedf936e4255d9a467095d2cb708ff701ba37b14a751117abd
BLAKE2b-256 checksum
How to use checksums
087e3d016cf756cfebc371138bd7f25bcf5719211ccb5532d7636cd9293e873c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for plugable 1.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page