Skip to main content

simplug

A simple plugin system for Python with async hooks support.

Features

  • Decorator-based API: Define hooks with @simplug.spec and implement with @simplug.impl
  • Async support: First-class async hooks with sync/async bridging
  • Flexible result collection: 18 built-in strategies for collecting plugin results
  • Priority system: Control plugin execution order
  • Setuptools entrypoints: Load plugins from installed packages
  • Singleton per project: Same instance returned for same project name

Installation

pip install -U simplug

Quick Start

from simplug import Simplug

# Create a plugin manager
simplug = Simplug('myproject')

# Define a hook specification
class MySpec:
    @simplug.spec
    def process_data(self, data):
        """Process data in plugins."""

# Implement the hook in plugins
class PluginA:
    @simplug.impl
    def process_data(self, data):
        return data.upper()

class PluginB:
    @simplug.impl
    def process_data(self, data):
        return data.lower()

# Register plugins
simplug.register(PluginA, PluginB)

# Call the hook
results = simplug.hooks.process_data("Hello")
print(results)  # ['HELLO', 'hello']

Documentation

Full documentation is available at https://pwwang.github.io/simplug/

Getting Started

  1. Define hooks - Specify what plugins can customize
  2. Implement hooks - Create plugins with implementations
  3. Register plugins - Load plugins into your application
  4. Call hooks - Trigger plugin execution

For detailed guides and API reference, see the full documentation.

Examples

See the examples directory for complete examples:

License

MIT

Metadata

Release files for simplug 0.5.8

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

Source distribution (sdist)

Source distribution for simplug 0.5.8
File Size Uploaded Provenance Actions
simplug-0.5.8.tar.gz 151.3 kB Without provenance Details for simplug-0.5.8.tar.gz

Built distribution (wheel)

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

Total release size: 163.5 kB

Release files / simplug-0.5.8.tar.gz

Download URL simplug-0.5.8.tar.gz
Size 151.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2f603baf35e4fd65c380d41c7ecc61a0905a9c8c1285de6fb5fd5e9908dc835f
BLAKE2b-256 checksum
How to use checksums
8b73aacf6b1b6d3deeb1d65b520d38d0d5f23bcc979b1649900fc078b96c077a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / simplug-0.5.8-py3-none-any.whl

Download URL simplug-0.5.8-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e0fb42d0784994fe577744a633b569edcb95f818452a802314c6ec9b0df9e2e
BLAKE2b-256 checksum
How to use checksums
81499d677ebd04e2b42293c0d2b962c20159dc92a4de63d99e874962e3f32ab1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for simplug 0.5.8

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.

Release history Release notifications | RSS feed

This release

0.5.8 This release

2 release files No provenance

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