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.1.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.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vtx_protocol-2.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 31c7a1ceff10aab1c43144767e8703a10e5584e5e8b431d3c83e516727da97d8
MD5 a6e7451763ce111ae6be86e7004aeb70
BLAKE2b-256 fb53c0f9ace77bd451a4d81620528b9080c2a96403cfc907eef06e2b6c517968

See more details on using hashes here.

Provenance

The following attestation bundles were made for vtx_protocol-2.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: vtx_protocol-2.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44c9cc5d782124ade052183237b333dd946da0322eaede11275406abd1aeefa4
MD5 b5c2fa3dcf951b9faa9c138ed7afc5af
BLAKE2b-256 03920ef437fb1500c7ebf8b48622709d1b442acc0f5857416d4e6b43f5b5dd60

See more details on using hashes here.

Provenance

The following attestation bundles were made for vtx_protocol-2.2.1-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