Skip to main content

Python Terraform Provider Framework

Project description

🐍 Pyvider: Build Terraform Providers in Pure Python

PyPI CI Status License Python Version

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

📦 Installation

# Using pip
pip install pyvider

# Using uv (recommended)
uv add pyvider

🚀 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

🚦 Project Status

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

⚠️ Alpha Software - APIs may change before 1.0 release. Best suited for internal tooling, experimentation, and learning. See the Roadmap for details.

🤝 Contributing

Contributions welcome! See Contributing Guidelines.

# Development setup
uv sync
uv run pytest
uv run ruff check

📄 License

Apache 2.0 - See LICENSE for details.

🔗 Links


Made with ❤️ by Provide

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.0.1100.post1.tar.gz (115.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.0.1100.post1-py3-none-any.whl (173.2 kB view details)

Uploaded Python 3

File details

Details for the file pyvider-0.0.1100.post1.tar.gz.

File metadata

  • Download URL: pyvider-0.0.1100.post1.tar.gz
  • Upload date:
  • Size: 115.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for pyvider-0.0.1100.post1.tar.gz
Algorithm Hash digest
SHA256 eeca3d23d27b5c87704934efe74de907984fac71e25891a4a7fed9008e9f0696
MD5 44c447a8d54e5376574bac65cad45d08
BLAKE2b-256 60586ea3f24f30bfbe20d84f0c829434a61f7974f1f1de2217806564c71c4c0e

See more details on using hashes here.

File details

Details for the file pyvider-0.0.1100.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyvider-0.0.1100.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 dda7e35f28b7484bb632596142b9987e542e480fae63673750e57482bdd88b76
MD5 8e59fe827b145ed411ebc7ba80b94de7
BLAKE2b-256 faf6e3ce35a8dda81c5c5170b595295662aa31dfb2779c73dd7882270238549c

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