Skip to main content

Plugin Catalog

Generic plugin registry with typed descriptors and attribute-based filtering for Python.

Overview

vcti-plugin-catalog is the registry layer for plugin-style architectures — anywhere an application keeps a set of interchangeable components (parsers, exporters, validators, loaders) and must pick the right one at runtime. A Descriptor[T] pairs a component instance with its metadata: a unique id, a display name, and a free-form attributes dict. A Registry[D] holds those descriptors, retrieves them by id in constant time, and filters them by attribute rules via vcti-lookup. The registry does no discovery — it never imports, constructs, or invokes a plugin, so the wiring and trust decisions stay in your code. Both classes are generic and built to be subclassed into a typed, domain-specific catalog.

Installation

pip install "vcti-plugin-catalog>=2.0.0"

In pyproject.toml dependencies

dependencies = [
    "vcti-plugin-catalog>=2.0.0",
]

Quick Start

from vcti.lookup import Rule
from vcti.plugincatalog import Descriptor, Registry

# Define your plugin type
class Parser:
    def __init__(self, extensions: list[str]):
        self.extensions = extensions

# Create descriptors with metadata
csv_parser = Descriptor(
    id="csv",
    name="CSV Parser",
    instance=Parser([".csv"]),
    attributes={"file_type": "text", "streaming": True},
)

json_parser = Descriptor(
    id="json",
    name="JSON Parser",
    instance=Parser([".json"]),
    attributes={"file_type": "text", "streaming": False},
)

binary_parser = Descriptor(
    id="hdf5",
    name="HDF5 Parser",
    instance=Parser([".h5", ".hdf5"]),
    attributes={"file_type": "binary", "streaming": False},
)

# Build a registry
registry = Registry()
registry.register_many([csv_parser, json_parser, binary_parser])

# Lookup by ID
parser = registry.get("csv").instance

# Filter by attributes
text_parsers = registry.lookup.filter([Rule("file_type", "==", "text")])
# [csv_parser_desc, json_parser_desc]

# Multiple rules (AND)
streaming = registry.lookup.filter([
    Rule("file_type", "==", "text"),
    Rule("streaming", "==", True),
])
# [csv_parser_desc]

# OR filtering
subset = registry.lookup.filter_any([
    Rule("file_type", "==", "binary"),
    Rule("streaming", "==", True),
])
# [csv_parser_desc, hdf5_parser_desc]

# First match
first = registry.lookup.first([Rule("file_type", "==", "text")])

Core API

Descriptor[T]

Generic container holding plugin metadata and instance:

Attribute Type Description
id str Unique identifier
name str Human-readable name
instance T The plugin instance
description str | None Optional description
attributes dict[str, Any] Filterable metadata

Registry[D]

Collection manager for descriptors:

Method Description
register(descriptor) Add a descriptor
register_many(descriptors) Add multiple descriptors
unregister(id) Remove a descriptor
unregister_many(ids) Remove multiple descriptors
get(id) Retrieve by ID (raises EntryNotFoundError)
find(id) Retrieve by ID or return None
all() List all descriptors
ids() List all IDs
lookup Cached Lookup for attribute filtering
create_lookup() New independent Lookup instance
copy() Shallow copy of the registry
clear() Remove all descriptors
isolated(preload=, **kwargs) Context manager for test isolation; kwargs go to the constructor

The registry also supports in, len(), and for ... in iteration.

Filtering

The registry.lookup property returns a vcti.lookup.Lookup instance that filters against descriptor .attributes:

from vcti.lookup import Rule

# AND — all rules must match
registry.lookup.filter([Rule("type", "==", "text"), Rule("active", "==", True)])

# OR — any rule matches
registry.lookup.filter_any([Rule("type", "==", "text"), Rule("type", "==", "csv")])

# NOT — exclude matches
registry.lookup.exclude([Rule("deprecated", "==", True)])

# First match
registry.lookup.first([Rule("type", "==", "text")])

See vcti-lookup for the full filtering API including operators, modifiers, and more.

Lifecycle

# Safe lookup (returns None instead of raising)
desc = registry.find("maybe-missing")

# Remove a plugin
registry.unregister("hdf5")

# Remove several at once
registry.unregister_many(["csv", "json"])

# Iterate over all registered descriptors
for desc in registry:
    print(desc.id, desc.name)

Test Isolation

with Registry.isolated(preload=[csv_parser, json_parser]) as test_reg:
    assert len(test_reg) == 2
    test_reg.unregister("csv")
    assert len(test_reg) == 1
# test_reg is discarded — the original registry is untouched

Dependencies


Documentation

If you want to… Read
Get started using the package Quick Start above
See practical, real-world usage docs/patterns.md
Extend the library (new descriptor types, registry subclasses) docs/extending.md
Understand the architecture and design decisions docs/design.md
Navigate and understand the source docs/source-guide.md

Metadata

Release files for vcti-plugin-catalog 2.0.0

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

Source distribution (sdist)

Source distribution for vcti-plugin-catalog 2.0.0
File Size Uploaded Provenance Actions
vcti_plugin_catalog-2.0.0.tar.gz 23.2 kB With provenance Details for vcti_plugin_catalog-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vcti-plugin-catalog 2.0.0
File Interpreter ABI Platform Actions
vcti_plugin_catalog-2.0.0-py3-none-any.whl Python 3 none any Details for vcti_plugin_catalog-2.0.0-py3-none-any.whl

Total release size: 32.4 kB

Release files / vcti_plugin_catalog-2.0.0.tar.gz

Download URL vcti_plugin_catalog-2.0.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fb56354a026bb6742d5f028aa8d8a7fe510b3f6639bec19acc763cbcdd09c2d8
BLAKE2b-256 checksum
How to use checksums
4b249fb35afcde1182d3796bfe1725ca2fbab2e30b58986476c85e8c6c17f7b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / vcti_plugin_catalog-2.0.0-py3-none-any.whl

Download URL vcti_plugin_catalog-2.0.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e3eda8403ef66cb6c898789759e06217737d2313b927782285b58db8c530303
BLAKE2b-256 checksum
How to use checksums
80a5d658d047b3e12d1ebdec68c3d0a30dbb1aa91497434eb994d04332b8f965
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for vcti-plugin-catalog 2.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vcti_plugin_catalog-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

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