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


Made with ❤️ by Provide

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.3.32.tar.gz (125.0 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.3.32-py3-none-any.whl (178.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyvider-0.3.32.tar.gz
Algorithm Hash digest
SHA256 9e76fe9f3e045434a3cfceed2e4d4b17c6511b6cbda5667d48ec9a5338fe5dfa
MD5 3fb881fdae93e5b722333b4ff05cfe7a
BLAKE2b-256 03cd55720d92aac79444888928fa45223b19c530236eaa5d8aa276528feea9dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvider-0.3.32.tar.gz:

Publisher: release.yml on provide-io/pyvider

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

File details

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

File metadata

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

File hashes

Hashes for pyvider-0.3.32-py3-none-any.whl
Algorithm Hash digest
SHA256 9030c7425540aa7f01083c125819cd23aa2b561e10edc48516e079c6bbf12109
MD5 e5e3ffdb41aa970068032a121b462854
BLAKE2b-256 22cb4a89673681a8f6b40db68b8b107d225323e89d90ef6ab2385a20b0724541

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvider-0.3.32-py3-none-any.whl:

Publisher: release.yml on provide-io/pyvider

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