Skip to main content

WIT definitions and Python bindings for VTX plugins

Project description

vtx-protocol

The Official Python SDK for VTX Project Plugins.

This package provides the type definitions, bindings, and interfaces required to develop VTX-compatible plugins in Python. It serves as the Single Source of Truth (SSOT) for the plugin protocol, ensuring that your implementation adheres to the strict interface contracts defined by the host.

Installation

pip install vtx-protocol

Usage

1. Developing a Plugin

The package exports all necessary data structures and interfaces directly. You can import strict types to ensure your plugin complies with the protocol.

from vtx_protocol import types, sql, stream_io

class Plugin:
    def handle(self, req: types.HttpRequest) -> types.HttpResponse:
        """
        Handle an incoming HTTP request.
        """
        print(f"Received request: {req.method} {req.path}")

        return types.HttpResponse(
            status=200,
            body=None
        )

    def get_manifest(self) -> types.Manifest:
        """
        Return the plugin manifest.
        """
        return types.Manifest(
            id="my-python-plugin",
            version="1.0.0",
            name="My Python Plugin",
            description="A sample plugin implemented in Python",
            entrypoint="handle"
        )

2. Accessing Protocol Definitions

For tooling or build scripts that require access to the raw interface definitions, the package provides helper functions to locate the bundled WIT files.

import vtx_protocol

# Get the absolute path to the bundled vtx.wit file
wit_path = vtx_protocol.get_wit_path()

# Read the content of the WIT file directly
wit_content = vtx_protocol.get_wit_content()

Build Process

To compile your Python code into a VTX-compatible WebAssembly component, use componentize-py with the protocol definitions provided by this package.

# Example build command using componentize-py
componentize-py \
  --wit-path $(python -c "import vtx_protocol; print(vtx_protocol.get_wit_path())") \
  --world plugin \
  componentize app -o plugin.wasm

Versioning

This package follows Semantic Versioning. The version number (Major.Minor.Patch) corresponds strictly to the version of the vtx:api WIT interface definition.

  • Major/Minor: Changes in the interface contract.
  • Patch: Bug fixes or non-breaking internal updates.

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

vtx_protocol-2.2.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vtx_protocol-2.2.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file vtx_protocol-2.2.0.tar.gz.

File metadata

  • Download URL: vtx_protocol-2.2.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vtx_protocol-2.2.0.tar.gz
Algorithm Hash digest
SHA256 5f7e7d017d7c55563ee0377cbfc82d97641dba5271e6abd00e9c398b15d5074f
MD5 942b29741142178bfb8283e14c87343f
BLAKE2b-256 316ea318e7daefd9bf3bed566e86056296949772a53b4cc7ead9c6dec3ebf798

See more details on using hashes here.

Provenance

The following attestation bundles were made for vtx_protocol-2.2.0.tar.gz:

Publisher: release.yml on Vtxdeo/vtx-protocol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vtx_protocol-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: vtx_protocol-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vtx_protocol-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f26e03cee94d6ba62f7e90431e3265db0c690fbd2f0b6925519fac02344e2d7
MD5 eaa76b8ec0064f0fb7547ffe71b7c63e
BLAKE2b-256 2a386e3b94dc1645a0bdcea39864732d44b4f85a35a9ca2d47bd0f07a3007625

See more details on using hashes here.

Provenance

The following attestation bundles were made for vtx_protocol-2.2.0-py3-none-any.whl:

Publisher: release.yml on Vtxdeo/vtx-protocol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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