Skip to main content

Python Terraform Provider Framework

Project description

🐍🏗️ Pyvider

License Python 3.11+ uv Ruff CI

Pyvider is a Python framework for building Terraform providers. Write infrastructure providers using Python's elegance, type safety, and rich ecosystem while maintaining full compatibility with Terraform Plugin Protocol v6.

✨ Key Features

  • 🐍 Pure Python - Write providers using familiar Python patterns and libraries
  • 🎯 Type-Safe - Leverage type hints and attrs for robust code
  • 🚀 Decorator-Based - Simple registration system handles protocol complexity
  • 📦 Protocol v6 - Full Terraform Plugin Protocol v6 implementation
  • ⚡ Async - Built on modern async/await for high performance
  • 🧪 Testable - Comprehensive testing with pytest integration

Quick Start

from pyvider.providers import register_provider, BaseProvider
from pyvider.resources import register_resource, BaseResource
from pyvider.schema import s_resource, a_str
import attrs

@register_provider("mycloud")
class MyCloudProvider(BaseProvider):
    """Your cloud provider"""
    pass

@register_resource("server")
class Server(BaseResource):
    """Manages a server"""

    @classmethod
    def get_schema(cls):
        return s_resource({
            "name": a_str(required=True),
            "id": a_str(computed=True),
        })

    async def _create_apply(self, ctx):
        # Create your resource
        return State(id="srv-123", name=ctx.config.name), None

    async def read(self, ctx):
        # Read current state
        return ctx.state

See the full example in the Quick Start Guide →

Documentation

📖 Read the Full Documentation →

Quick Links

Development

Quick Start

# Set up environment
uv sync

# Run common tasks
we run test       # Run tests
we run lint       # Check code
we run format     # Format code
we tasks          # See all available commands

Available Commands

This project uses wrknv for task automation. Run we tasks to see all available commands.

Common tasks:

  • we run test - Run all tests
  • we run test.coverage - Run tests with coverage
  • we run test.parallel - Run tests in parallel
  • we run lint - Check code quality
  • we run lint.fix - Auto-fix linting issues
  • we run format - Format code
  • we typecheck - Run type checker

See CLAUDE.md for detailed development instructions and architecture information.

🤝 Contributing

Contributions welcome! See Contributing Guidelines and the Development section above for setup instructions.

📄 License

Apache 2.0 - See LICENSE for details.

📦 Installation

# Using uv (recommended)
uv add pyvider

🚦 Project Status

Version: 0.0.x (Alpha) Protocol: Terraform Plugin Protocol v6 Python: 3.11+

⚠️ Pre-release - APIs may change before 1.0 release. Best suited for internal tooling, experimentation, and learning.

🔗 Links


Copyright (c) provide.io LLC.

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

pyvider-0.4.0.tar.gz (127.5 kB view details)

Uploaded Source

Built Distribution

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

pyvider-0.4.0-py3-none-any.whl (179.8 kB view details)

Uploaded Python 3

File details

Details for the file pyvider-0.4.0.tar.gz.

File metadata

  • Download URL: pyvider-0.4.0.tar.gz
  • Upload date:
  • Size: 127.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyvider-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2efb67aa6b7e5975a95b8bf2443b8d439d73daa0e40dce3b70c6a01e9dae1171
MD5 d9db899bf128443992347428c7b1483d
BLAKE2b-256 6a25eedaa4c070e793b6c98d6049cfdd231acef03d31aa57db2a636122e131df

See more details on using hashes here.

File details

Details for the file pyvider-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pyvider-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 179.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyvider-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fe8e87b7257f297070dc8259932d54d2566557f7b57cefb83accbec5728d437
MD5 3db03cb0889af6878d7559d274521fc7
BLAKE2b-256 9c0701e84c4269a4218b28c4adc598bdeb3070361cb32e8994766dcb84fb9f1e

See more details on using hashes here.

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